Azure
Cloud integrations are installed from the **Data Sources** page. To configure a cloud integration, go to Settings > Data Sources and click "Add Data Source", select Azure, then in Advanced Settings > Security Capabilities, enable "Automation".
Cloud Services · Azure
Details
| ID | Azure |
|---|---|
| Provider | Microsoft |
| Category | Cloud Services |
| From Version | 8.11.0 |
| Docker Image | demisto/crypto:1.0.0.10120494 |
| Supported Modules | Cloud Posture Security Cortex Cloud Cloud Runtime Security Agentix XSIAM |
README
Cloud integrations are installed from the Data Sources page.
To configure a cloud integration, go to Settings > Data Sources, click Add Data Source, and select Microsoft Azure.
Click Connect, then click Show advanced settings, and under Additional Security Capabilities, enable Automation.
Configure Azure in Cortex
| Parameter | Description | Required |
|---|---|---|
| Application ID | ||
| Default Subscription ID | You can set the value either in the configuration or directly within the commands. If you set it in both places, the value in the command will override the configuration setting. | True |
| Default Resource Group Name | You can set the value either in the configuration or directly within the commands. If you set it in both places, the value in the command will override the configuration setting. | |
| Azure AD endpoint | Azure AD endpoint associated with a national cloud. | False |
| Authentication Type | The type of authentication. Can be Client Credentials (default authentication type), Device Code, Authorization Code, or Azure Managed Identities. | False |
| Trust any certificate (not secure) | False | |
| Use system proxy settings | False | |
| Tenant ID | The tenant ID of the Azure app registration. | False |
| Client Secret | The client secret of the Azure app registration. Required when using the Client Credentials flow. | False |
| Application redirect URI | The application redirect URI for the Authorization Code flow. | False |
| Authorization code | The authorization code for the Authorization Code flow, received from the authorization step. See the Detailed Instructions (?) section. | False |
| Azure Managed Identities Client ID | The managed identities client ID for authentication. Relevant only when the integration is running on an Azure VM. | False |
Commands
You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
azure-nsg-security-rule-update
Update a security rule. If one does not exist, it will be created. The command is deprecated, please use azure-vn-security-rule-update. Required Permissions: Microsoft.Network/networkSecurityGroups/securityRules/read, Microsoft.Network/networkSecurityGroups/securityRules/write.
Base Command
azure-nsg-security-rule-update
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| resource_group_name | The name of the resource group. | Required |
| security_group_name | The name of the security group. | Required |
| security_rule_name | The name of the rule to be updated. | Required |
| direction | The direction of the rule. Possible values are: “Inbound” and “Outbound”. Possible values are: Inbound, Outbound. | Optional |
| action | Whether to allow the traffic. Possible values are “Allow” and “Deny”. Possible values are: Allow, Deny. | Optional |
| protocol | The protocol on which to apply the rule. Possible values are: “Any”, “TCP”, “UDP”, and “ICMP”. Possible values are: Any, TCP, UDP, ICMP. | Optional |
| source | The source IP address range from which incoming traffic will be allowed or denied by this rule. Possible values are “Any”, an IP address range, an application security group, or a default tag. Default is “Any”. | Optional |
| priority | The priority by which the rules will be processed. The lower the number, the higher the priority. We recommend leaving gaps between rules - 100, 200, 300, etc. - so that it is easier to add new rules without having to edit existing rules. Default is “4096”. | Optional |
| source_ports | The source ports from which traffic is allowed or denied by this rule. Provide a single port, such as 80; a port range, such as 1024-65535; or a comma-separated list of single ports and/or port ranges, such as 80,1024-65535. Use an asterisk () to allow traffic on any port. Default is “”. | Optional |
| destination | The destination IP address range for outgoing traffic that is allowed or denied by this rule. The destination filter can be “Any”, an IP address range, an application security group, or a default tag. | Optional |
| destination_ports | The destination ports from which traffic is allowed or denied by this rule. Provide a single port, such as 80; a port range, such as 1024-65535; or a comma-separated list of single ports and/or port ranges, such as 80,1024-65535. Use an asterisk (*) to allow traffic on any port. | Optional |
| description | A description to add to the rule. | Optional |
| access | The network traffic is allowed or denied. Possible values are: Allow, Deny. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.NSGRule.name | String | The rule’s name. |
| Azure.NSGRule.id | String | The rule’s ID. |
| Azure.NSGRule.etag | String | The rule’s ETag. |
| Azure.NSGRule.type | String | The rule’s type. |
| Azure.NSGRule.provisioningState | String | The rule’s provisioning state. |
| Azure.NSGRule.protocol | String | The protocol, which can be “TCP”, “UDP”, “ICMP”, or “*”. |
| Azure.NSGRule.sourcePortRange | String | For a single port, the source port or a range of ports. |
| Azure.NSGRule.sourcePortRanges | String | For multiple ports, a list of these ports. |
| Azure.NSGRule.destinationPortRange | String | For a single port, the destination port or range of ports. |
| Azure.NSGRule.destinationPortRanges | String | For multiple ports, a list of destination ports. |
| Azure.NSGRule.sourceAddressPrefix | String | The source address. |
| Azure.NSGRule.destinationAddressPrefix | String | The destination address. |
| Azure.NSGRule.access | String | The rule’s access. Can be “Allow” or “Deny”. |
| Azure.NSGRule.priority | Number | The rule’s priority. Can be from 100 to 4096. |
| Azure.NSGRule.direction | String | The rule’s direction. Can be “Inbound” or “Outbound”. |
azure-storage-account-update
Updates a specific account storage. Required permissions: Microsoft.Storage/storageAccounts/read, Microsoft.Storage/storageAccounts/write.
Base Command
azure-storage-account-update
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| account_name | The name of the storage account. | Required |
| sku | Gets or sets the SKU name, Required for account creation; optional for update. Possible values are: Premium_LRS, Premium_ZRS, Standard_GRS, Standard_GZRS, Standard_LRS, Standard_RAGRS, Standard_RAGZRS, Standard_ZRS. | Optional |
| kind | Indicates the type of storage account, Required for account creation; optional for update. Possible values are: Storage, StorageV2, BlobStorage, FileStorage, BlockBlobStorage. | Optional |
| location | Gets or sets the location of the resource. The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. Required for account creation; optional for update. Possible values are: eastus, eastus2, westus, westeurope, eastasia, southeastasia, japaneast, japanwest, northcentralus, southcentralus, centralus, northeurope, brazilsouth, australiaeast, australiasoutheast, southindia, centralindia, westindia, canadaeast, canadacentral, westus2, westcentralus, uksouth, ukwest, koreacentral, koreasouth, francecentral, australiacentral, southafricanorth, uaenorth, switzerlandnorth, germanywestcentral, norwayeast. | Optional |
| tags | Gets or sets a list of tags that describe the resource. | Optional |
| custom_domain_name | Gets or sets the custom domain name assigned to the storage account. | Optional |
| use_sub_domain_name | Indicates whether indirect CName validation is enabled. Possible values are: true, false. | Optional |
| enc_key_source | The encryption keySource. Possible values are: Microsoft.Storage, Microsoft.Keyvault. | Optional |
| enc_requireInfrastructureEncryption | Indicates whether the service applies a secondary layer of encryption with platform managed keys for data at rest. Possible values are: true, false. | Optional |
| enc_keyvault_key_name | The name of KeyVault key. | Optional |
| enc_keyvault_key_version | The version of KeyVault key. | Optional |
| enc_keyvault_uri | The Uri of KeyVault. | Optional |
| access_tier | The access tier for the account. Required where kind = BlobStorage. Possible values are: Hot, Cool. | Optional |
| supports_https_traffic_only | Allows https traffic only to storage service if sets to true. Possible values are: true, false. | Optional |
| is_hns_enabled | Account HierarchicalNamespace enabled if sets to true. Possible values are: true, false. | Optional |
| large_file_shares_state | If set to Enabled, allows large file shares. Possible values are: Disabled, Enabled. | Optional |
| allow_blob_public_access | If set to true, allows public access to all blobs or containers in the storage account. Possible values are: true, false. | Optional |
| minimum_tls_version | Sets the minimum TLS version to be permitted on requests to storage. Possible values are: TLS1_0, TLS1_1, TLS1_2. | Optional |
| network_ruleset_bypass | Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are: AzureServices, Logging, Metrics, None. | Optional |
| network_ruleset_default_action | Specifies the default action of allow or deny when no other rules match. Possible values are: Allow, Deny. | Optional |
| network_ruleset_ipRules | Sets the IP ACL rules. | Optional |
| virtual_network_rules | Sets the virtual network rules. | Optional |
| allow_cross_tenant_replication | Allow or disallow cross AAD tenant object replication. Possible values are: true, false. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Storage.StorageAccounts.id | String | Fully qualified resource ID for the resource. |
| Azure.Storage.StorageAccounts.kind | String | The kind of storage account. |
| Azure.Storage.StorageAccounts.location | String | The geo-location where the resource lives. |
| Azure.Storage.StorageAccounts.name | String | The name of the resource. |
| Azure.Storage.StorageAccounts.properties.isHnsEnabled | Boolean | Account HierarchicalNamespace enabled if sets to true. |
| Azure.Storage.StorageAccounts.properties.allowBlobPublicAccess | Boolean | If set to true (default), allows public access to all blobs or containers in the storage account. |
| Azure.Storage.StorageAccounts.properties.minimumTlsVersion | String | The minimum TLS version to be permitted on requests to storage. Default is TLS 1.0. |
| Azure.Storage.StorageAccounts.properties.allowSharedKeyAccess | Boolean | Whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests (including shared access signatures) must be authorized with Azure Active Directory (Azure AD). |
| Azure.Storage.StorageAccounts.properties.creationTime | Date | The creation date and time of the storage account in UTC. |
| Azure.Storage.StorageAccounts.properties.primaryEndpoints | String | The URLs that are used to retrieve a public blob, queue, or table object. |
| Azure.Storage.StorageAccounts.properties.primaryLocation | String | The storage account primary data center location. |
| Azure.Storage.StorageAccounts.properties.provisioningState | String | The status of the storage account at the time the operation was called. |
| Azure.Storage.StorageAccounts.properties.routingPreference.routingChoice | String | The kind of network routing the user chose. |
| Azure.Storage.StorageAccounts.properties.routingPreference.publishMicrosoftEndpoints | Boolean | Whether Microsoft routing storage endpoints are to be published. |
| Azure.Storage.StorageAccounts.properties.routingPreference.publishInternetEndpoints | Boolean | Whether internet routing storage endpoints are to be published. |
| Azure.Storage.StorageAccounts.properties.encryption | String | Encryption settings to be used for server-side encryption for the storage account. |
| Azure.Storage.StorageAccounts.properties.secondaryLocation | String | The geo-replicated secondary location for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS. |
| Azure.Storage.StorageAccounts.properties.statusOfPrimary | String | Whether the storage account primary location is available or unavailable. |
| Azure.Storage.StorageAccounts.properties.statusOfSecondary | String | Whether the storage account secondary location is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. |
| Azure.Storage.StorageAccounts.properties.supportsHttpsTrafficOnly | Boolean | If set to true, allows https traffic only to storage service. |
| Azure.Storage.StorageAccounts.sku.name | String | The SKU name. Required for account creation; optional for update. |
| Azure.Storage.StorageAccounts.sku.tier | String | The SKU tier. This is based on the SKU name. |
| Azure.Storage.StorageAccounts.tags | unknown | Resource tags. |
| Azure.Storage.StorageAccounts.type | String | The storage account type. |
azure-storage-blob-service-properties-set
Sets properties for the blob service in a specific account storage. The command is deprecated, please use azure-storage-blob-service-property-set. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/read, Microsoft.Storage/storageAccounts/blobServices/write.
Base Command
azure-storage-blob-service-properties-set
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The subscription ID. | Required |
| account_name | The name of the storage account. | Required |
| delete_rentention_policy_enabled | Whether DeleteRetentionPolicy is enabled. Possible values are: true, false. | Optional |
| delete_rentention_policy_days | The number of days the deleted item should be retained. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.StorageAccountBlobServiceProperties.id | String | The resource ID. |
| Azure.StorageAccountBlobServiceProperties.name | String | The name of the resource. |
| Azure.StorageAccountBlobServiceProperties.type | String | The type of the resource. |
| Azure.StorageAccountBlobServiceProperties.properties.cors | String | Specifies CORS rules for the Blob service. |
| Azure.StorageAccountBlobServiceProperties.properties.defaultServiceVersion | Date | The default version for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions. |
| Azure.StorageAccountBlobServiceProperties.properties.deleteRetentionPolicy | unknown | The service properties for soft delete. |
| Azure.StorageAccountBlobServiceProperties.properties.isVersioningEnabled | Boolean | If set to true, enables versioning. |
| Azure.StorageAccountBlobServiceProperties.properties.changeFeed | unknown | The blob service properties for change feed events. |
| Azure.StorageAccountBlobServiceProperties.sku.name | String | The SKU name. |
| Azure.StorageAccountBlobServiceProperties.sku.tier | String | The SKU tier. |
azure-policy-assignment-create
Creates a policy assignment. Required permissions: Microsoft.Authorization/policyAssignments/read, Microsoft.Authorization/policyAssignments/write.
Base Command
azure-policy-assignment-create
Input
| Argument Name | Description | Required |
|---|---|---|
| name | Name of the policy assignment. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| scope | The scope of the policy assignment. | Required |
| policy_definition_id | The ID of the policy definition or policy set definition being assigned. | Optional |
| display_name | The assignment display name. | Optional |
| parameters | The JSON object for policy properties parameters and their values. | Optional |
| description | This message will be part of the response in case of policy violation. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Policy.PolicyAssignments.ID | string | The resource ID of the policy assignment. |
| Azure.Policy.PolicyAssignments.Name | string | The name of the policy assignment. |
| Azure.Policy.PolicyAssignments.Type | string | The type of the resource (e.g., ‘Microsoft.Authorization/policyAssignments’). |
| Azure.Policy.PolicyAssignments.Location | string | The location of the policy assignment. |
| Azure.Policy.PolicyAssignments.Identity | unknown | The managed identity associated with the policy assignment. |
| Azure.Policy.PolicyAssignments.Properties.DisplayName | string | The display name of the policy assignment. |
| Azure.Policy.PolicyAssignments.Properties.Description | string | The description of the policy assignment. |
| Azure.Policy.PolicyAssignments.Properties.PolicyDefinitionId | string | The ID of the policy definition or policy set definition being assigned. |
| Azure.Policy.PolicyAssignments.Properties.Scope | string | The scope of the policy assignment. |
| Azure.Policy.PolicyAssignments.Properties.NotScopes | unknown | The list of scopes that are excluded from the policy assignment. |
| Azure.Policy.PolicyAssignments.Properties.Parameters | unknown | The parameter values for the assigned policy rule. |
| Azure.Policy.PolicyAssignments.Properties.Metadata | unknown | The metadata associated with the policy assignment. |
| Azure.Policy.PolicyAssignments.Properties.EnforcementMode | string | The policy assignment enforcement mode (e.g., ‘Default’ or ‘DoNotEnforce’). |
| Azure.Policy.PolicyAssignments.Properties.latestDefinitionVersion | string | The latest version of the policy definition available. This is only present if requested via the $expand query parameter. |
| Azure.Policy.PolicyAssignments.Properties.NonComplianceMessages | unknown | The messages that describe why a resource is non-compliant with the policy. |
| Azure.Policy.PolicyAssignments.Properties.DefinitionVersion | string | The version of the policy definition to use. |
| Azure.Policy.PolicyAssignments.Properties.Overrides | unknown | The policy property value overrides. |
| Azure.Policy.PolicyAssignments.Properties.ResourceSelectors | unknown | The resource selectors to filter policies by resource properties. |
| Azure.Policy.PolicyAssignments.SystemData | unknown | The system metadata relating to this resource. |
azure-postgres-config-set
Updates a configuration of a server. The command is deprecated due to the retirement of Azure PostgreSQL Single Server.
Base Command
azure-postgres-config-set
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Optional |
| server_name | Name of the PostgreSQL server. | Required |
| configuration_name | The configuration setting name. | Required |
| subscription_id | Subscription ID. | Optional |
| source | Source of the configuration. | Optional |
| value | Value of the configuration. | Optional |
Context Output
There is no context output for this command.
azure-webapp-config-set
Updates the configuration settings of an existing Azure Web App. The command is deprecated, please use azure-appservice-webapp-config-update. Required Permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
Base Command
azure-webapp-config-set
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Optional |
| subscription_id | Subscription ID. | Optional |
| name | Name of the Web App. | Required |
| http20_enabled | Configures a web site to allow clients to connect over http2.0. Possible values are: true, false. | Optional |
| remote_debugging_enabled | True if remote debugging is enabled; otherwise, false. Possible values are: true, false. | Optional |
| min_tls_version | Configures the minimum version of TLS required for SSL requests. Possible values are: 1.0, 1.1, 1.2, 1.3. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.WebAppConfig.id | String | Resource ID. |
| Azure.WebAppConfig.name | String | Resource name. |
| Azure.WebAppConfig.type | String | Resource type. |
| Azure.WebAppConfig.location | String | Resource location. |
| Azure.WebAppConfig.properties.numberOfWorkers | Number | Number of workers. |
| Azure.WebAppConfig.properties.defaultDocuments | Unknown | List of default documents. |
| Azure.WebAppConfig.properties.netFrameworkVersion | String | .NET Framework version. |
| Azure.WebAppConfig.properties.phpVersion | String | PHP version. |
| Azure.WebAppConfig.properties.pythonVersion | String | Python version. |
| Azure.WebAppConfig.properties.nodeVersion | String | Node.js version. |
| Azure.WebAppConfig.properties.powerShellVersion | String | PowerShell version. |
| Azure.WebAppConfig.properties.linuxFxVersion | String | Linux app framework and version. |
| Azure.WebAppConfig.properties.windowsFxVersion | String | Windows container image name. |
| Azure.WebAppConfig.properties.requestTracingEnabled | Boolean | Indicates whether request tracing is enabled. |
| Azure.WebAppConfig.properties.remoteDebuggingEnabled | Boolean | Indicates whether remote debugging is enabled. |
| Azure.WebAppConfig.properties.remoteDebuggingVersion | String | Remote debugging version. |
| Azure.WebAppConfig.properties.http20Enabled | Boolean | Indicates whether HTTP/2 is enabled. |
| Azure.WebAppConfig.properties.minTlsVersion | String | Minimum TLS version required. |
| Azure.WebAppConfig.properties.ftpsState | String | State of FTP / FTPS service. |
| Azure.WebAppConfig.properties.webSocketsEnabled | Boolean | Indicates whether WebSockets are enabled. |
| Azure.WebAppConfig.properties.alwaysOn | Boolean | Indicates whether Always On is enabled. |
| Azure.WebAppConfig.properties.managedPipelineMode | String | Managed pipeline mode. |
| Azure.WebAppConfig.properties.loadBalancing | String | Site load balancing mode. |
| Azure.WebAppConfig.properties.autoHealEnabled | Boolean | Indicates whether Auto Heal is enabled. |
| Azure.WebAppConfig.properties.autoHealRules | Unknown | Auto Heal rules configuration. |
| Azure.WebAppConfig.properties.cors.allowedOrigins | Unknown | CORS allowed origins. |
| Azure.WebAppConfig.properties.cors.supportCredentials | Boolean | Indicates whether CORS supports credentials. |
| Azure.WebAppConfig.properties.apiDefinition.url | String | URL of the API definition. |
| Azure.WebAppConfig.properties.apiManagementConfig.id | String | Azure API management integration ID. |
azure-webapp-auth-update
Updates the authentication and authorization settings of an existing Azure Web App. The command is deprecated, please use azure-appservice-webapp-auth-settings-update. Required Permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
Base Command
azure-webapp-auth-update
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Optional |
| subscription_id | Subscription ID. | Optional |
| name | Name of the Web App. | Required |
| enabled | True if the Authentication / Authorization feature is enabled for the current app; otherwise, false. Possible values are: true, false. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.WebAppAuth.id | String | Resource ID. |
| Azure.WebAppAuth.name | String | Resource Name. |
| Azure.WebAppAuth.type | String | Resource type. |
| Azure.WebAppAuth.properties.enabled | Boolean | Indicates whether Authentication/Authorization is enabled for the app. |
| Azure.WebAppAuth.properties.runtimeVersion | String | The RuntimeVersion of the Authentication/Authorization feature. |
| Azure.WebAppAuth.properties.unauthenticatedClientAction | String | The action to take when an unauthenticated client attempts to access the app. |
| Azure.WebAppAuth.properties.tokenStoreEnabled | Boolean | Indicates whether the Azure App Service Authentication platform’s token store is enabled. |
| Azure.WebAppAuth.properties.allowedExternalRedirectUrls | Unknown | External URLs that are allowed to be redirected to as part of logging in or logging out of the app. |
| Azure.WebAppAuth.properties.defaultProvider | String | The default authentication provider to use when multiple providers are configured. |
| Azure.WebAppAuth.properties.clientId | String | The Client ID of the app used for AAD login. |
| Azure.WebAppAuth.properties.clientSecret | String | The client secret associated with the AAD app. |
| Azure.WebAppAuth.properties.clientSecretSettingName | String | The app setting that contains the client secret. |
| Azure.WebAppAuth.properties.issuer | String | The OpenID Connect Issuer URI that represents the entity that issues access tokens. |
| Azure.WebAppAuth.properties.allowedAudiences | Unknown | The list of audiences that can receive the authentication tokens. |
| Azure.WebAppAuth.properties.additionalLoginParams | Unknown | Additional parameters to send to the authentication provider. |
| Azure.WebAppAuth.properties.isAadAutoProvisioned | Boolean | True if AAD is auto-provisioned; otherwise false. |
| Azure.WebAppAuth.properties.googleClientId | String | The Client ID of the app used for Google login. |
| Azure.WebAppAuth.properties.googleClientSecret | String | The client secret associated with the Google app. |
| Azure.WebAppAuth.properties.googleClientSecretSettingName | String | The app setting that contains the client secret. |
| Azure.WebAppAuth.properties.facebookAppId | String | The App ID of the Facebook app used for login. |
| Azure.WebAppAuth.properties.facebookAppSecret | String | The app secret associated with the Facebook app. |
| Azure.WebAppAuth.properties.facebookAppSecretSettingName | String | The app setting that contains the Facebook app secret. |
| Azure.WebAppAuth.properties.twitterConsumerKey | String | The OAuth 1.0a consumer key of the Twitter application used for login. |
| Azure.WebAppAuth.properties.twitterConsumerSecret | String | The consumer secret associated with the Twitter application. |
| Azure.WebAppAuth.properties.twitterConsumerSecretSettingName | String | The app setting that contains the Twitter consumer secret. |
| Azure.WebAppAuth.properties.microsoftAccountClientId | String | The OAuth 2.0 client ID for the Microsoft account provider. |
| Azure.WebAppAuth.properties.microsoftAccountClientSecret | String | The client secret for the Microsoft account provider. |
| Azure.WebAppAuth.properties.microsoftAccountClientSecretSettingName | String | The app setting that contains the Microsoft account client secret. |
| Azure.WebAppAuth.properties.appleClientId | String | The client ID for the Apple provider. |
| Azure.WebAppAuth.properties.appleClientSecret | String | The client secret for the Apple provider. |
| Azure.WebAppAuth.properties.appleClientSecretSettingName | String | The app setting that contains the Apple provider client secret. |
| Azure.WebAppAuth.properties.authFilePath | String | The path to the authentication configuration file. |
azure-mysql-flexible-server-param-set
Updates a server configuration. Required permissions: Microsoft.DBforMySQL/flexibleServers/configurations/read, Microsoft.DBforMySQL/flexibleServers/configurations/write.
Base Command
azure-mysql-flexible-server-param-set
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| server_name | Name of the MySQL flexible server. | Required |
| configuration_name | The name of the server configuration. | Required |
| source | Source of the configuration. | Optional |
| value | Value of the configuration. | Optional |
Context Output
There is no context output for this command.
azure-monitor-log-profile-update
Updates a log profile in Azure Monitoring REST API. Required permissions: Microsoft.Insights/logprofiles/read, Microsoft.Insights/logprofiles/write.
Base Command
azure-monitor-log-profile-update
Input
| Argument Name | Description | Required |
|---|---|---|
| log_profile_name | The name of the log profile to update. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| location | Resource location. | Optional |
| retention_policy_days | Number of days to retain logs. | Optional |
| retention_policy_enabled | Whether to enable the retention policy. Possible values are: true, false. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Monitor.LogProfiles.id | String | The fully qualified Azure resource ID for the log profile. |
| Azure.Monitor.LogProfiles.name | String | The name of the log profile. |
| Azure.Monitor.LogProfiles.type | String | The type of the resource (Microsoft.Insights/logProfiles). |
| Azure.Monitor.LogProfiles.location | String | The location of the log profile. |
| Azure.Monitor.LogProfiles.tags | Object | Resource tags. |
| Azure.Monitor.LogProfiles.properties.storageAccountId | String | The resource ID of the storage account to which diagnostic logs are delivered. |
| Azure.Monitor.LogProfiles.properties.serviceBusRuleId | String | The service bus rule ID to which diagnostic logs are sent. |
| Azure.Monitor.LogProfiles.properties.locations | Array | A list of regions for which events are collected. |
| Azure.Monitor.LogProfiles.properties.categories | Array | A list of categories of logs that are collected. |
| Azure.Monitor.LogProfiles.properties.retentionPolicy.enabled | Boolean | Specifies whether the retention policy is enabled. |
| Azure.Monitor.LogProfiles.properties.retentionPolicy.days | Number | The number of days for the retention policy. |
azure-disk-update
Updates a disk. The command is deprecated, please use azure-compute-disk-update. Required Permissions: Microsoft.Compute/disks/read, Microsoft.Compute/disks/write.
Base Command
azure-disk-update
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Optional |
| subscription_id | Subscription ID. | Optional |
| disk_name | The name of the managed disk that is being created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. | Required |
| public_network_access | Policy for controlling export on the disk. Possible values are: Disabled, Enabled. | Optional |
| network_access_policy | Policy for accessing the disk via network. Possible values are: AllowAll, AllowPrivate, DenyAll. | Optional |
| data_access_auth_mode | Additional authentication requirements when exporting or uploading to a disk or snapshot. Possible values are: AzureActiveDirectory. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Disk.id | String | Resource ID of the disk. |
| Azure.Disk.name | String | Name of the disk. |
| Azure.Disk.type | String | Type of the resource. |
| Azure.Disk.location | String | Location of the disk. |
| Azure.Disk.tags | unknown | Resource tags. |
| Azure.Disk.managedBy | String | ARM ID of the resource that manages the disk. |
| Azure.Disk.sku | unknown | The disk SKU name. |
| Azure.Disk.zones | unknown | A list of availability zones. |
| Azure.Disk.properties.timeCreated | String | The time when the disk was created. |
| Azure.Disk.properties.diskSizeGB | Number | Size of the disk in GB. |
| Azure.Disk.properties.diskIopsReadWrite | Number | The number of IOPS allowed for this disk. |
| Azure.Disk.properties.diskMBpsReadWrite | Number | The bandwidth allowed for this disk in MBps. |
| Azure.Disk.properties.diskIOPSReadOnly | Number | The number of read-only IOPS for this disk. |
| Azure.Disk.properties.diskMBpsReadOnly | Number | The read-only bandwidth for this disk in MBps. |
| Azure.Disk.properties.diskSizeBytes | Number | The size of the disk in bytes. |
| Azure.Disk.properties.networkAccessPolicy | String | Policy for accessing the disk via network. |
| Azure.Disk.properties.publicNetworkAccess | String | Policy for export on the disk. |
| Azure.Disk.properties.burstingEnabled | Boolean | Whether bursting is enabled on the disk. |
| Azure.Disk.properties.optimization | String | The disk optimization setting. |
| Azure.Disk.properties.diskState | String | The current state of the disk. |
| Azure.Disk.properties.supportedCapabilities | unknown | Supported capabilities of the disk. |
| Azure.Disk.properties.supportedPerformanceTiers | unknown | Supported performance tiers of the disk. |
| Azure.Disk.properties.supportedDiskTypes | unknown | Supported disk types for the disk. |
| Azure.Disk.properties.provisioningState | unknown | The provisioning state of the disk. |
| Azure.Disk.properties.timeModified | unknown | The time when the disk was last modified. |
| Azure.Disk.properties.diskAccessId | String | The ARM ID of the DiskAccess resource. |
| Azure.Disk.properties.networkProfile | unknown | The network profile of the disk. |
| Azure.Disk.properties.creationData | unknown | Disk creation data. |
| Azure.Disk.properties.encryption | unknown | Encryption settings for the disk. |
| Azure.Disk.properties.encryptionSettingsCollection | unknown | A collection of encryption settings. |
| Azure.Disk.properties.encryptionType | String | The type of key used to encrypt the data on the disk. |
| Azure.Disk.properties.securityProfile | unknown | Security profile for the disk. |
| Azure.Disk.properties.tieringProfile | unknown | Tiering profile for the disk. |
| Azure.Disk.properties.supportedTierList | unknown | List of supported tiers for the disk. |
| Azure.Disk.properties.availabilityZone | String | Availability zone of the disk. |
| Azure.Disk.properties.dataAccessAuthMode | String | Additional authentication requirements when exporting or uploading to a disk. |
| Azure.Disk.properties.osType | String | The operating system type. |
| Azure.Disk.properties.hyperVGeneration | String | The HyperVGenerationType of the virtual machine. |
| Azure.Disk.properties.lastOwnershipUpdateTime | String | The last time ownership of the disk was updated. |
azure-webapp-update
Updates an Azure Web App. The command is deprecated, please use azure-appservice-webapp-update. Required Permissions: Microsoft.Web/sites/read, Microsoft.Web/sites/write.
Base Command
azure-webapp-update
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Optional |
| subscription_id | Subscription ID. | Optional |
| name | Name of the Web App. | Required |
| identity_type | Managed service identity type. Possible values are: None, SystemAssigned. | Optional |
| https_only | Configures the web site to accept only https requests. Possible values are: true, false. | Optional |
| client_cert_enabled | Configures the web site to accept only https requests. Possible values are: true, false. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.WebApp.id | String | Fully qualified resource ID for the web app. |
| Azure.WebApp.name | String | The name of the web app. |
| Azure.WebApp.type | String | The resource type, e.g., Microsoft.Web/sites. |
| Azure.WebApp.location | String | Geographic location of the web app. |
| Azure.WebApp.kind | String | The kind of the app, e.g., app, functionapp, etc. |
| Azure.WebApp.tags | unknown | Resource tags as key-value pairs. |
| Azure.WebApp.identity.type | String | The type of managed identity (SystemAssigned, UserAssigned, etc.). |
| Azure.WebApp.identity.principalId | String | The principal ID of the system-assigned identity. |
| Azure.WebApp.identity.tenantId | String | The tenant ID of the system-assigned identity. |
| Azure.WebApp.identity.userAssignedIdentities | unknown | The list of user-assigned identities associated with the web app. |
| Azure.WebApp.properties.state | String | Current state of the web app (Running, Stopped, etc.). |
| Azure.WebApp.properties.enabled | Boolean | Whether the web app is enabled. |
| Azure.WebApp.properties.defaultHostName | String | Default host name of the web app. |
| Azure.WebApp.properties.hostNames | unknown | List of host names associated with the web app. |
| Azure.WebApp.properties.repositorySiteName | String | Name of the repository site. |
| Azure.WebApp.properties.clientAffinityEnabled | Boolean | Whether client affinity is enabled. |
| Azure.WebApp.properties.clientCertEnabled | Boolean | Whether client certificates are enabled. |
| Azure.WebApp.properties.clientCertExclusionPaths | String | Paths to exclude from client certificate authentication. |
| Azure.WebApp.properties.hostingEnvironment | String | App Service Environment to use for the web app. |
| Azure.WebApp.properties.serverFarmId | String | Resource ID of the associated App Service plan. |
| Azure.WebApp.properties.reserved | Boolean | Whether the web app is on a Linux plan. |
| Azure.WebApp.properties.isXenon | Boolean | Whether the web app is hosted in Xenon. |
| Azure.WebApp.properties.hyperV | Boolean | Whether Hyper-V is enabled for the web app. |
| Azure.WebApp.properties.siteConfig.appSettings | unknown | List of app settings. |
| Azure.WebApp.properties.siteConfig.metadata | unknown | List of metadata settings. |
| Azure.WebApp.properties.siteConfig.connectionStrings | unknown | List of connection strings. |
| Azure.WebApp.properties.siteConfig.localMySqlEnabled | Boolean | Whether local MySQL is enabled. |
| Azure.WebApp.properties.siteConfig.alwaysOn | Boolean | Whether Always On is enabled. |
| Azure.WebApp.properties.siteConfig.http20Enabled | Boolean | Whether HTTP/2 is enabled. |
| Azure.WebApp.properties.siteConfig.minTlsVersion | String | Minimum TLS version required. |
| Azure.WebApp.properties.siteConfig.ftpsState | String | FTPS state (Disabled, AllAllowed, etc.). |
| Azure.WebApp.properties.siteConfig.linuxFxVersion | String | Runtime stack for Linux apps. |
| Azure.WebApp.properties.siteConfig.windowsFxVersion | String | Runtime stack for Windows apps. |
| Azure.WebApp.properties.siteConfig.numberOfWorkers | Number | Number of workers allocated. |
| Azure.WebApp.properties.siteConfig.webSocketsEnabled | Boolean | Whether WebSockets are enabled. |
| Azure.WebApp.properties.siteConfig.preWarmedInstanceCount | Number | Number of pre-warmed instances. |
| Azure.WebApp.properties.siteConfig.acrUseManagedIdentityCreds | Boolean | Whether ACR uses managed identity credentials. |
| Azure.WebApp.properties.siteConfig.acrUserManagedIdentityID | String | User-assigned identity ID for ACR. |
| Azure.WebApp.properties.siteConfig.scmType | String | Source control management type. |
| Azure.WebApp.properties.siteConfig.use32BitWorkerProcess | Boolean | Whether to use 32-bit worker process. |
| Azure.WebApp.properties.siteConfig.autoHealEnabled | Boolean | Whether auto-heal is enabled. |
| Azure.WebApp.properties.siteConfig.autoHealRules | unknown | Auto-heal rules configuration. |
| Azure.WebApp.properties.siteConfig.tracingOptions | String | Tracing options. |
| Azure.WebApp.properties.siteConfig.remoteDebuggingEnabled | Boolean | Whether remote debugging is enabled. |
| Azure.WebApp.properties.siteConfig.remoteDebuggingVersion | String | Remote debugging version. |
| Azure.WebApp.properties.siteConfig.detailedErrorLoggingEnabled | Boolean | Whether detailed error logging is enabled. |
| Azure.WebApp.properties.siteConfig.httpLoggingEnabled | Boolean | Whether HTTP logging is enabled. |
| Azure.WebApp.properties.siteConfig.requestTracingEnabled | Boolean | Whether request tracing is enabled. |
| Azure.WebApp.properties.siteConfig.requestTracingExpirationTime | DateTime | Request tracing expiration time. |
| Azure.WebApp.properties.siteConfig.remoteDebuggingEnabled | Boolean | Whether remote debugging is enabled. |
| Azure.WebApp.properties.siteConfig.remoteDebuggingVersion | String | Remote debugging version. |
| Azure.WebApp.properties.siteConfig.defaultDocuments | unknown | List of default documents. |
| Azure.WebApp.properties.siteConfig.virtualApplications | unknown | List of virtual applications. |
| Azure.WebApp.properties.siteConfig.loadBalancing | String | Load balancing settings. |
| Azure.WebApp.properties.siteConfig.experiments | unknown | Experiments configuration. |
| Azure.WebApp.properties.siteConfig.limits | unknown | Site limits configuration. |
| Azure.WebApp.properties.siteConfig.autoSwapSlotName | String | Auto-swap slot name. |
| Azure.WebApp.properties.siteConfig.localMySqlEnabled | Boolean | Whether local MySQL is enabled. |
| Azure.WebApp.properties.siteConfig.ipSecurityRestrictions | unknown | IP security restrictions. |
| Azure.WebApp.properties.siteConfig.scmIpSecurityRestrictions | unknown | SCM IP security restrictions. |
| Azure.WebApp.properties.siteConfig.scmIpSecurityRestrictionsUseMain | Boolean | Whether SCM IP restrictions use main settings. |
| Azure.WebApp.properties.siteConfig.cors | unknown | CORS settings. |
| Azure.WebApp.properties.siteConfig.push | unknown | Push settings. |
| Azure.WebApp.properties.siteConfig.apiDefinition | unknown | API definition settings. |
| Azure.WebApp.properties.siteConfig.apiManagementConfig | unknown | API management configuration. |
| Azure.WebApp.properties.siteConfig.autoHealEnabled | Boolean | Whether auto-heal is enabled. |
| Azure.WebApp.properties.siteConfig.autoHealRules | unknown | Auto-heal rules configuration. |
| Azure.WebApp.properties.siteConfig.tracingOptions | String | Tracing options. |
| Azure.WebApp.properties.siteConfig.remoteDebuggingEnabled | Boolean | Whether remote debugging is enabled. |
| Azure.WebApp.properties.siteConfig.remoteDebuggingVersion | String | Remote debugging version. |
| Azure.WebApp.properties.siteConfig.detailedErrorLoggingEnabled | Boolean | Whether detailed error logging is enabled. |
| Azure.WebApp.properties.siteConfig.httpLoggingEnabled | Boolean | Whether HTTP logging is enabled. |
| Azure.WebApp.properties.siteConfig.requestTracingEnabled | Boolean | Whether request tracing is enabled. |
azure-acr-update
Updates a container registry. The command is deprecated, please use azure-cr-registry-update. Required Permissions: Microsoft.ContainerRegistry/registries/read, Microsoft.ContainerRegistry/registries/write.
Base Command
azure-acr-update
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Optional |
| subscription_id | Subscription ID. | Optional |
| registry_name | The name of the container registry. | Required |
| allow_exports | Whether artifacts can be exported. Possible values are: disabled, enabled. | Optional |
| public_network_access | Whether public network access is allowed for the container registry. Possible values are: disabled, enabled. | Optional |
| anonymous_pull_enabled | Whether to enable registry-wide pulls from unauthenticated clients. Possible values are: true, false. | Optional |
| authentication_as_arm_policy | Whether the policy is enabled or not. Possible values are: disabled, enabled. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.ACR.id | String | The resource ID. |
| Azure.ACR.identity | Unknown | The identity of the container registry. |
| Azure.ACR.location | String | The location of the resource. |
| Azure.ACR.name | String | The name of the resource. |
| Azure.ACR.properties.adminUserEnabled | Boolean | The value that indicates whether the admin user is enabled. |
| Azure.ACR.properties.anonymousPullEnabled | Boolean | Enables registry-wide pull from unauthenticated clients. |
| Azure.ACR.properties.creationDate | String | The creation date of the container registry in ISO8601 format. |
| Azure.ACR.properties.dataEndpointEnabled | Boolean | Enable a single data endpoint per region for serving data. |
| Azure.ACR.properties.dataEndpointHostNames | Unknown | List of host names that will serve data when dataEndpointEnabled is true. |
| Azure.ACR.properties.encryption | Unknown | The encryption settings of container registry. |
| Azure.ACR.properties.loginServer | String | The URL that can be used to log into the container registry. |
| Azure.ACR.properties.networkRuleBypassOptions | String | Whether to allow trusted Azure services to access a network restricted registry. |
| Azure.ACR.properties.networkRuleSet | Unknown | The network rule set for a container registry. |
| Azure.ACR.properties.policies | Unknown | The policies for a container registry. |
| Azure.ACR.properties.privateEndpointConnections | Unknown | List of private endpoint connections for a container registry. |
| Azure.ACR.properties.provisioningState | String | The provisioning state of the container registry at the time the operation was called. |
| Azure.ACR.properties.publicNetworkAccess | String | Whether or not public network access is allowed for the container registry. |
| Azure.ACR.properties.status | Unknown | The status of the container registry at the time the operation was called. |
| Azure.ACR.properties.zoneRedundancy | String | Whether or not zone redundancy is enabled for this container registry. |
| Azure.ACR.sku | Unknown | The SKU of the container registry. |
| Azure.ACR.systemData | Unknown | Metadata pertaining to creation and last modification of the resource. |
| Azure.ACR.tags | Unknown | The tags of the resource. |
| Azure.ACR.type | String | The type of the resource. |
azure-postgres-server-update
Updates an existing server. The command is deprecated due to the retirement of Azure PostgreSQL Single Server.
Base Command
azure-postgres-server-update
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Optional |
| subscription_id | Subscription ID. | Optional |
| server_name | Name of the PostgreSQL server. | Required |
| ssl_enforcement | Whether to enable SSL authentication when connecting to the server. Possible values are: Disabled, Enabled. | Optional |
Context Output
There is no context output for this command.
azure-key-vault-update
Updates a key vault in the specified subscription. The command is deprecated, please use azure-keyvault-vault-update. Required Permissions: Microsoft.KeyVault/vaults/read, Microsoft.KeyVault/vaults/write.
Base Command
azure-key-vault-update
Input
| Argument Name | Description | Required |
|---|---|---|
| vault_name | Key Vault name. | Required |
| subscription_id | The subscription ID. | Optional |
| resource_group_name | The name of the resource group. | Optional |
| enable_purge_protection | Whether protection against purge is enabled for this vault. This functionality is always enabled, it cannot be disabled. Possible values are: true. | Optional |
| enable_soft_delete | Whether soft delete is enabled for this key vault. This functionality is always enabled, it cannot be disabled. Possible values are: true. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.KeyVault.id | String | Resource ID. |
| Azure.KeyVault.name | String | Key Vault name. |
| Azure.KeyVault.type | String | Resource type in Azure. |
| Azure.KeyVault.location | String | Key Vault location. |
| Azure.KeyVault.tags | unknown | Resource tags. |
| Azure.KeyVault.properties.sku.family | String | SKU family name. |
| Azure.KeyVault.properties.sku.name | String | SKU name to specify whether the key vault is a standard vault or a premium vault. |
| Azure.KeyVault.properties.tenantId | String | The Entra ID tenant ID that should be used for authenticating requests to the key vault. |
| Azure.KeyVault.properties.accessPolicies | unknown | An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault’s tenant ID. |
| Azure.KeyVault.properties.accessPolicies.tenantId | String | The Entra ID tenant ID that should be used for authenticating requests to the key vault. |
| Azure.KeyVault.properties.accessPolicies.objectId | String | The object ID of a user, service principal or security group in the Entra ID tenant for the vault. The object ID must be unique for the list of access policies. |
| Azure.KeyVault.properties.accessPolicies.permissions | unknown | Permissions the identity has for keys, secrets and certificates. |
| Azure.KeyVault.properties.enabledForDeployment | Boolean | Whether Azure Virtual Machines are allowed to retrieve certificates stored as secrets from the key vault. |
| Azure.KeyVault.properties.enabledForDiskEncryption | Boolean | Whether Azure Disk Encryption is allowed to retrieve secrets from the vault and unwrap keys. |
| Azure.KeyVault.properties.enabledForTemplateDeployment | Boolean | Whether Azure Resource Manager is allowed to retrieve secrets from the key vault. |
| Azure.KeyVault.properties.enableSoftDelete | Boolean | Whether soft delete is enabled for this key vault. |
| Azure.KeyVault.properties.enablePurgeProtection | Boolean | Whether purge protection is enabled for this key vault. |
| Azure.KeyVault.properties.enableRbacAuthorization | Boolean | Whether Azure Key Vault uses Role Based Access Control (RBAC) for authorization of data actions. |
| Azure.KeyVault.properties.vaultUri | String | The URI of the vault for performing operations on keys and secrets. |
| Azure.KeyVault.properties.provisioningState | String | The current provisioning state. |
| Azure.KeyVault.properties.privateEndpointConnections | unknown | List of private endpoint connections associated with the key vault. |
| Azure.KeyVault.properties.networkAcls | unknown | Rules governing the accessibility of the key vault from specific network locations. |
| Azure.KeyVault.properties.networkAcls.bypass | String | What traffic can bypass network rules. |
| Azure.KeyVault.properties.networkAcls.defaultAction | String | The default action when no rules match from ipRules and virtualNetworkRules. |
| Azure.KeyVault.properties.networkAcls.ipRules | unknown | The list of IP address rules. |
| Azure.KeyVault.properties.networkAcls.virtualNetworkRules | unknown | The list of virtual network rules. |
azure-sql-db-threat-policy-update
Updates the database’s threat detection policy. The command is deprecated, please use azure-sqldb-security-alert-policy-update. Required Permissions: Microsoft.Sql/servers/databases/securityAlertPolicies/read, Microsoft.Sql/servers/databases/securityAlertPolicies/write.
Base Command
azure-sql-db-threat-policy-update
Input
| Argument Name | Description | Required |
|---|---|---|
| server_name | Server name. | Required |
| db_name | Database name. | Required |
| email_account_admins_enabled | Whether the alert is sent to the account administrators. Possible values: “true” and “false”. Possible values are: true, false. | Optional |
| subscription_id | Subscription ID. | Optional |
| resource_group_name | The name of the resource group. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.SqlDBThreatPolicy.kind | String | Kind of threat policy. |
| Azure.SqlDBThreatPolicy.location | String | Threat policy location. |
| Azure.SqlDBThreatPolicy.id | String | Threat policy ID. |
| Azure.SqlDBThreatPolicy.name | String | Threat policy name. |
| Azure.SqlDBThreatPolicy.type | String | Threat policy type. |
| Azure.SqlDBThreatPolicy.state | String | Threat policy state. |
| Azure.SqlDBThreatPolicy.creationTime | String | Threat policy creation time. |
| Azure.SqlDBThreatPolicy.retentionDays | Number | Number of days to keep in the Threat Detection audit logs. |
| Azure.SqlDBThreatPolicy.storageAccountAccessKey | String | The identifier key of the Threat Detection audit storage account. |
| Azure.SqlDBThreatPolicy.storageEndpoint | String | Threat Detection audit storage account. |
| Azure.SqlDBThreatPolicy.emailAccountAdmins | Boolean | Email accounts administrators who the alert is sent to. |
| Azure.SqlDBThreatPolicy.emailAddresses | String | List of email addresses to which the alert is sent. |
| Azure.SqlDBThreatPolicy.disabledAlerts | String | List of alerts that are disabled, or an empty string if no alerts are disabled. |
| Azure.SqlDBThreatPolicy.useServerDefault | unknown | Whether to use the default server policy. |
| Azure.SqlDBThreatPolicy.databaseName | String | The name of the database that the threat policy is related to. |
| Azure.SqlDBThreatPolicy.serverName | String | The name of server that the threat policy is related to. |
azure-sql-db-transparent-data-encryption-set
Updates a logical database’s transparent data encryption configuration. Required permissions: Microsoft.Sql/servers/databases/transparentDataEncryption/read, Microsoft.Sql/servers/databases/transparentDataEncryption/write.
Base Command
azure-sql-db-transparent-data-encryption-set
Input
| Argument Name | Description | Required |
|---|---|---|
| server_name | Server name. | Required |
| db_name | Database name. | Required |
| state | The state of the transparent data encryption. Possible values are: Disabled, Enabled. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The name of the resource group. | Required |
Context Output
There is no context output for this command.
azure-vm-instance-details-get
Gets the properties of a given virtual machine. The command is deprecated, please use azure-compute-vm-get. Required Permissions: Microsoft.Compute/virtualMachines/read.
Base Command
azure-vm-instance-details-get
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group to which the virtual machine belongs. To see all the resource groups associated with your subscription, run the azure-list-resource-groups command. |
Required |
| virtual_machine_name | The name of the virtual machine you want to view the details of. | Required |
| expand | The expand expression to apply on the operation. ‘instanceView’ retrieves a snapshot of the runtime properties of the virtual machine that is managed by the platform and can change outside of control plane operations. ‘userData’ retrieves the UserData property as part of the VM model view that was provided by the user during the VM Create/Update operation. Default value is False. Possible values are: instanceView, userData. Default is instanceView. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Compute.name | string | The name of the virtual machine you want to get details of. |
| Azure.Compute.id | string | The ID of the virtual machine. |
| Azure.Compute.location | string | The region in which the virtual machine is hosted. |
| Azure.Compute.Size | number | The size of the deployed virtual machine (in gigabytes). |
| Azure.Compute.OS | string | The OS running on the given virtual machine. |
| Azure.Compute.properties.provisioningState | string | The provisioning state of the deployed virtual machine. |
| Azure.Compute.networkProfile.networkInterfaces | string | The list of network interfaces attached to this virtual machine. |
| Azure.Compute.properties.hardwareProfile.vmSize | string | The size or SKU of the virtual machine, defining CPU, memory, and storage capacity. |
| Azure.Compute.properties.provisioningState | string | The current provisioning state of the virtual machine (e.g., Succeeded, Updating, Failed). |
| Azure.Compute.properties.osProfile | string | The operating system configuration of the virtual machine, including admin credentials and hostname. |
| Azure.Compute.properties.storageProfile | string | The storage settings for the virtual machine, including OS and data disks. |
| Azure.Compute.properties.vmId | string | The unique identifier assigned to the virtual machine instance. |
| Azure.Compute.properties.instanceView | string | Detailed runtime status information about the virtual machine, such as power state and extensions. |
| Azure.Compute.properties.timeCreated | string | The timestamp when the virtual machine was created. |
| Azure.Compute.properties.networkProfile | string | The network configuration of the virtual machine, including associated network interfaces and settings. |
| Azure.Compute.properties.diagnosticsProfile | string | The configuration for boot diagnostics and monitoring of the virtual machine. |
azure-nsg-security-groups-list
List all network security groups. The command is deprecated, please use azure-vn-security-groups-list. Required Permissions: Microsoft.Network/networkSecurityGroups/read.
Base Command
azure-nsg-security-groups-list
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.NSGSecurityGroup.name | String | The security group’s name. |
| Azure.NSGSecurityGroup.id | String | The security group’s ID. |
| Azure.NSGSecurityGroup.type | String | The security group’s type. |
| Azure.NSGSecurityGroup.location | String | The security group’s location. |
| Azure.NSGSecurityGroup.etag | String | The security group’s ETag. |
| Azure.NSGSecurityGroup.tags | String | The security group’s tags. |
| Azure.NSGSecurityGroup.properties.defaultSecurityRules | List | The default security rules. |
| Azure.NSGSecurityGroup.properties.networkInterfaces | List | The network interfaces. |
| Azure.NSGSecurityGroup.properties.provisioningState | String | The provisioning state. |
| Azure.NSGSecurityGroup.properties.resourceGuid | String | The resource GUID. |
| Azure.NSGSecurityGroup.properties.SecurityRules | List | The security rules. |
azure-nsg-security-rule-delete
Delete a security rule. The command is deprecated, please use azure-vn-security-rule-delete. Required Permissions: Microsoft.Network/networkSecurityGroups/securityRules/delete.
Base Command
azure-nsg-security-rule-delete
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| resource_group_name | Resource group name. | Required |
| security_group_name | The name of the security group. | Required |
| security_rule_name | The name of the rule to delete. | Required |
Context Output
There is no context output for this command.
azure-storage-blob-containers-update
Run this command to update a specific blob container. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/containers/write. The command is deprecated, please use azure-storage-blob-container-update.
Base Command
azure-storage-blob-containers-update
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
| container_name | The container name. | Required |
| default_encryption_scope | Uses the specified encryption scope by default for all writes to the container. | Optional |
| deny_encryption_scope_override | Blocks overriding the container’s default encryption scope. Possible values: true, false. Possible values are: true, false. | Optional |
| public_access | Specifies the access level. Possible values: Blob, Container, None. Possible values are: Blob, Container, None. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.StorageBlobContainer.id | String | Fully qualified resource ID for the resource. |
| Azure.StorageBlobContainer.name | String | The name of the resource. |
| Azure.StorageBlobContainer.type | String | The resource type. |
| Azure.StorageBlobContainer.properties.metadata.metadata | String | A metadata entry for the container, in name–value format. |
| Azure.StorageBlobContainer.properties.publicAccess | String | Specifies whether data in the container may be accessed publicly and the access level. |
| Azure.StorageBlobContainer.properties.hasImmutabilityPolicy | Boolean | The hasImmutabilityPolicy property is set to true by SRP if an ImmutabilityPolicy exists for this container, and false if it does not. |
| Azure.StorageBlobContainer.properties.hasLegalHold | Boolean | The hasLegalHold property is set to true by SRP if at least one legal hold tag exists, and false if all tags are cleared. |
azure-vm-instance-start
Powers on a given virtual machine. The command is deprecated, please use azure-compute-vm-start. Required Permissions: Microsoft.Compute/virtualMachines/read, Microsoft.Compute/virtualMachines/start/action.
Base Command
azure-vm-instance-start
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| resource_group_name | Resource Group to which the virtual machine belongs. To see all the resource groups associated with your subscription, run the azure-list-resource-groups command. |
Required |
| virtual_machine_name | Name of the virtual machine to power on. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Compute.name | string | Name of the VM that was started. |
| Azure.Compute.resourceGroup | string | Resource group the VM resides in. |
| Azure.Compute.powerState | string | Whether the VM instance is powered on or off. |
azure-nsg-network-interfaces-list
Gets network interfaces in a resource group. The command is deprecated, please use azure-vn-network-interfaces-list. Required Permissions: Microsoft.Network/networkInterfaces/read.
Base Command
azure-nsg-network-interfaces-list
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The subscription ID. | Required |
| limit | The maximum number of records to return. Default is 50. | Optional |
| all_results | Whether to retrieve all results by overriding the default limit. Possible values are: false, true. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.NSGNetworkInterfaces.name | String | The network interface’s name. |
| Azure.NSGNetworkInterfaces.id | String | The network interface’s ID. |
| Azure.NSGNetworkInterfaces.kind | String | The kind of the network interface. |
| Azure.NSGNetworkInterfaces.etag | String | The ETag of the network interface. |
| Azure.NSGNetworkInterfaces.location | String | The location of the network interface. |
| Azure.NSGNetworkInterfaces.managedBy | String | The entity that manages the network interface. |
| Azure.NSGNetworkInterfaces.tags | String | The tags associated with the network interface. |
| Azure.NSGNetworkInterfaces.properties.provisioningState | String | The network interface’s provisioning state. |
| Azure.NSGNetworkInterfaces.properties.ipConfigurations.name | List | The name of the IP configuration resource that is unique within a resource group. |
| Azure.NSGNetworkInterfaces.properties.ipConfigurations.id | List | The IP configuration resource ID. |
| Azure.NSGNetworkInterfaces.properties.ipConfigurations.etag | List | The ETag of the IP configuration. |
| Azure.NSGNetworkInterfaces.properties.ipConfigurations.type | List | The type of the IP configuration resource. |
| Azure.NSGNetworkInterfaces.properties.tapConfigurations | List | List of tap configurations. |
| Azure.NSGNetworkInterfaces.properties.allowPort25Out | Boolean | Whether port 25 outbound traffic is allowed. |
| Azure.NSGNetworkInterfaces.properties.nicType | String | The network interface card type (Standard/Basic). |
azure-vm-network-interface-details-get
Gets the properties of a given network interface. The command is deprecated, please use azure-vn-network-interface-get. Required Permissions: Microsoft.Network/networkInterfaces/read.
Base Command
azure-vm-network-interface-details-get
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group to which the network interface belongs. To see all the resource groups associated with your subscription, run the azure-list-resource-groups command. |
Required |
| network_interface_name | The name of the network interface you want to view the details of. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Network.Interfaces.properties.ipConfigurations | Unknown | The interface public IP address ID. |
| Azure.Network.Interfaces.properties.macAddress | String | The interface MAC address. |
| Azure.Network.Interfaces.name | String | The interface name. |
| Azure.Network.Interfaces.location | String | The interface location. |
| Azure.Network.Interfaces.id | String | The interface ID. |
| Azure.Network.Interfaces.location | String | The Azure region where the network interface is deployed. |
| Azure.Network.Interfaces.etag | String | A unique read-only string that changes whenever the network interface resource is updated. |
| Azure.Network.Interfaces.kind | String | The type of the network interface resource, used for Azure internal classification. |
| Azure.Network.Interfaces.properties.tapConfigurations | String | The list of tap configurations attached to the network interface for traffic mirroring. |
| Azure.Network.Interfaces.properties.allowPort25Out | String | Indicates whether outbound traffic on port 25 (SMTP) is allowed from this network interface. |
| Azure.Network.Interfaces.properties.nicType | String | Specifies the type of network interface, such as Standard or Elastic. |
| Azure.Network.Interfaces.properties.provisioningState | String | The current provisioning state of the network interface (e.g., Succeeded, Updating, Failed). |
| Azure.Network.Interfaces.properties.dnsSettings | String | The DNS configuration of the network interface, including DNS servers and domain name. |
| Azure.Network.Interfaces.properties.enableIPForwarding | String | Indicates whether IP forwarding is enabled for the network interface. |
azure-nsg-security-rule-get
Get a specific rule. The command is deprecated, please use azure-vn-security-rule-get. Required Permissions: Microsoft.Network/networkSecurityGroups/securityRules/read.
Base Command
azure-nsg-security-rule-get
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| resource_group_name | Resource group name. | Required |
| security_group_name | The name of the security group. | Required |
| security_rule_name | The name of the rule to get. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.NSGRule.name | String | The rule’s name. |
| Azure.NSGRule.id | String | The rule’s ID. |
| Azure.NSGRule.location | String | The rule’s location. |
| Azure.NSGRule.etag | String | The rule’s ETag. |
| Azure.NSGRule.type | String | The rule’s type. |
| Azure.NSGRule.properties.provisioningState | String | The rule’s provisioning state. |
| Azure.NSGRule.properties.protocol | String | The protocol, which can be “TCP”, “UDP”, “ICMP”, or “*”. |
| Azure.NSGRule.properties.sourcePortRange | String | For a single port, the source port or a range of ports. For multiple ports, `sourcePortRanges` is used instead. |
| Azure.NSGRule.properties.sourcePortRanges | String | For multiple ports, a list of ports. For a single port, `sourcePortRange` is used instead. |
| Azure.NSGRule.properties.destinationPortRange | String | For a single port, the destination port or range of ports. For multiple ports, `destinationPortRanges` is used instead. |
| Azure.NSGRule.properties.destinationPortRanges | String | For multiple ports, a list of destination ports. For a single port, `destinationPortRange` is used instead. |
| Azure.NSGRule.properties.sourceAddressPrefix | String | The source address. |
| Azure.NSGRule.properties.destinationAddressPrefix | String | The destination address. |
| Azure.NSGRule.properties.access | String | The rule’s access. Can be “Allow” or “Deny”. |
| Azure.NSGRule.properties.priority | Number | The rule’s priority, ranging from 100 to 4096. |
| Azure.NSGRule.properties.direction | String | The rule’s direction, which can be “Inbound” or “Outbound”. |
azure-nsg-public-ip-addresses-list
Gets public IP addresses in a resource group. The command is deprecated, please use azure-vn-public-ip-addresses-list. Required Permissions: Microsoft.Network/publicIPAddresses/read.
Base Command
azure-nsg-public-ip-addresses-list
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The subscription ID. | Required |
| limit | The maximum number of records to return. Default is 50. | Optional |
| all_results | Whether to retrieve all results by overriding the default limit. Possible values are: false, true. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.NSGPublicIPAddress.name | String | The public IP address’s name. |
| Azure.NSGPublicIPAddress.id | String | The public IP address’s ID. |
| Azure.NSGPublicIPAddress.location | String | The location of the public IP address. |
| Azure.NSGPublicIPAddress.sku | String | The public IP address’s SKU. |
| Azure.NSGPublicIPAddress.type | String | The type of the public IP address. |
| Azure.NSGPublicIPAddress.etag | String | The public IP address’s ETag. |
| Azure.NSGPublicIPAddress.properties.provisioningState | String | The public IP address’s provisioning state. |
| Azure.NSGPublicIPAddress.properties.publicIPAddressVersion | String | The public IP address’s version. |
| Azure.NSGPublicIPAddress.properties.ipAddress | String | The public IP address’s IP address. |
| Azure.NSGPublicIPAddress.properties.domainNameLabel | String | The public IP address’s domain name label. |
| Azure.NSGPublicIPAddress.properties.publicIPAllocationMethod | String | The public IP address’s allocation method. |
| Azure.NSGPublicIPAddress.properties.fqdn | String | The public IP address’s fully qualified domain name (FQDN). |
| Azure.NSGPublicIPAddress.properties.resourceGuid | String | The public IP address’s resource GUID. |
| Azure.NSGPublicIPAddress.sku.name | String | The public IP address’s SKU name. |
| Azure.NSGPublicIPAddress.sku.tier | String | The public IP address’s SKU tier. |
azure-storage-blob-service-properties-get
Run this command to get the blob service properties of a specific account storage. The command is deprecated, please use azure-storage-blob-service-property-get. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/read, Microsoft.Storage/storageAccounts/blobServices/write.
Base Command
azure-storage-blob-service-properties-get
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.StorageBlobServiceProperties.id | String | Fully qualified resource ID for the resource. |
| Azure.StorageBlobServiceProperties.name | String | The name of the resource. |
| Azure.StorageBlobServiceProperties.type | String | The resource type. |
| Azure.StorageBlobServiceProperties.properties.lastAccessTimeTrackingPolicy.enable | Boolean | When set to true, last access time–based tracking is enabled. |
| Azure.StorageBlobServiceProperties.properties.lastAccessTimeTrackingPolicy.name | String | Name of the policy. The valid value is AccessTimeTracking. |
| Azure.StorageBlobServiceProperties.properties.lastAccessTimeTrackingPolicy.trackingGranularityInDays | Number | Specifies the blob object tracking granularity in days, indicating how often the blob should be tracked. |
| Azure.StorageBlobServiceProperties.properties.lastAccessTimeTrackingPolicy.blobType | String | An array of predefined, supported blob types. The only supported value is BlockBlob. |
azure-vm-public-ip-details-get
Gets the properties of a given public IP address. The command is deprecated, please use azure-vn-public-ip-address-get. Required Permissions: Microsoft.Network/publicIPAddresses/read.
Base Command
azure-vm-public-ip-details-get
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group to which the IP address belongs. To see all the resource groups associated with your subscription, run the azure-list-resource-groups command. |
Required |
| address_name | The IP address name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Network.IPConfigurations.location | String | The Azure region where the IP configuration resource is located. |
| Azure.Network.IPConfigurations.id | String | The unique resource ID of the IP configuration. |
| Azure.Network.IPConfigurations.name | String | The name of the IP configuration. |
| Azure.Network.IPConfigurations.etag | String | A unique read-only string that changes whenever the IP configuration resource is updated. |
| Azure.Network.IPConfigurations.properties.idleTimeoutInMinutes | String | The idle timeout value in minutes for the associated public IP address. |
| Azure.Network.IPConfigurations.properties.ipAddress | String | The private IP address assigned to the network interface or resource. |
| Azure.Network.IPConfigurations.properties.provisioningState | String | The current provisioning state of the IP configuration (e.g., Succeeded, Updating, Failed). |
| Azure.Network.IPConfigurations.properties.ipConfiguration | String | The reference to another IP configuration associated with this resource. |
| Azure.Network.IPConfigurations.properties.publicIPAddressVersion | String | The version of the public IP address (IPv4 or IPv6). |
| Azure.Network.IPConfigurations.properties.publicIPAllocationMethod | String | Defines how the public IP address is allocated — Static or Dynamic. |
| Azure.Network.IPConfigurations.properties.resourceGuid | String | The unique Azure resource GUID for the IP configuration. |
| Azure.Network.IPConfigurations.properties.sku | String | The SKU of the public IP address associated with the configuration, defining its performance tier. |
azure-nsg-security-rule-create
Create a security rule. The command is deprecated, please use azure-vn-security-rule-create. Required Permissions: Microsoft.Network/networkSecurityGroups/securityRules/read, Microsoft.Network/networkSecurityGroups/securityRules/write.
Base Command
azure-nsg-security-rule-create
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| resource_group_name | Resource group name. | Required |
| security_group_name | The name of the security group. | Required |
| security_rule_name | The name of the rule to create. | Required |
| direction | The direction of the rule. Possible values are: “Inbound” and “Outbound”. Possible values are: Inbound, Outbound. | Required |
| action | Whether to allow the traffic. Possible values are: “Allow” and “Deny”. Possible values are: Allow, Deny. Default is Allow. | Optional |
| protocol | The protocol on which to apply the rule. Possible values are: “Any”, “TCP”, “UDP” and “ICMP”. Possible values are: Any, TCP, UDP, ICMP. Default is Any. | Optional |
| source | The source IP address range from which incoming traffic is allowed or denied by this rule. Possible values are “Any”, an IP address range, an application security group, or a default tag. Default is “Any”. Default is Any. | Optional |
| priority | The priority of the rule, with a value between 100 and 4096. Each rule in the collection must have a unique priority number. Lower numbers indicate higher priority. | Required |
| source_ports | The source ports from which traffic is allowed or denied by this rule. Provide a single port, such as 80; a port range, such as 1024-65535; or a comma-separated list of single ports and/or port ranges, such as 80,1024-65535. Use an asterisk () to allow traffic on any port. Default is “”. Default is *. | Optional |
| destination | The destination IP address range for outgoing traffic that is allowed or denied by this rule. The destination filter can be “Any”, an IP address range, an application security group, or a default tag. Default is Any. | Optional |
| destination_ports | The destination ports from which traffic is allowed or denied by this rule. Provide a single port, such as 80; a port range, such as 1024-65535; or a comma-separated list of single ports and/or port ranges, such as 80,1024-65535. Use an asterisk () to allow traffic on any port. Default is. | Optional |
| description | A description to add to the rule. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.NSGRule.name | String | The rule’s name. |
| Azure.NSGRule.id | String | The rule’s ID. |
| Azure.NSGRule.etag | String | The rule’s ETag. |
| Azure.NSGRule.type | String | The rule’s type. |
| Azure.NSGRule.properties.provisioningState | String | The rule’s provisioning state. |
| Azure.NSGRule.properties.protocol | String | The protocol, which can be “TCP”, “UDP”, “ICMP”, or “*”. |
| Azure.NSGRule.properties.sourcePortRange | String | For a single port, the source port or a range of ports. For multiple ports, `sourcePortRanges` is used instead. |
| Azure.NSGRule.properties.sourcePortRanges | String | For multiple ports, a list of ports. For a single port, `sourcePortRange` is used instead. |
| Azure.NSGRule.properties.destinationPortRange | String | For a single port, the destination port or range of ports. For multiple ports, `destinationPortRanges` is used instead. |
| Azure.NSGRule.properties.destinationPortRanges | String | For multiple ports, a list of destination ports. For a single port, `destinationPortRange` is used instead. |
| Azure.NSGRule.properties.sourceAddressPrefix | String | The source address. |
| Azure.NSGRule.properties.destinationAddressPrefix | String | The destination address. |
| Azure.NSGRule.properties.access | String | The rule’s access. Can be “Allow” or “Deny”. |
| Azure.NSGRule.properties.priority | Number | The rule’s priority, ranging from 100 to 4096. |
| Azure.NSGRule.properties.direction | String | The rule’s direction, which can be “Inbound” or “Outbound”. |
azure-nsg-resource-group-list
Gets all resource groups for a subscription. The command is deprecated, please use azure-rm-resource-groups-list. Required Permissions: Microsoft.Resources/subscriptions/resourceGroups/read.
Base Command
azure-nsg-resource-group-list
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| limit | Limit on the number of resource groups to return. Default is 50. | Optional |
| tag | A single tag in the form of {"Tag Name":"Tag Value"} to filter the list by. |
Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.NSGResourceGroup.id | String | The unique identifier of the Azure Network Security Groups resource group. |
| Azure.NSGResourceGroup.name | String | The name of the Azure Network Security Groups resource group. |
| Azure.NSGResourceGroup.type | String | The type of the Azure Network Security Groups resource group. |
| Azure.NSGResourceGroup.location | String | The location of the Azure Network Security Groups resource group. |
| Azure.NSGResourceGroup.properties.provisioningState | String | The provisioning state of the Azure Network Security Groups resource group. |
| Azure.NSGResourceGroup.tags.Owner | String | The owner tag of the Azure Network Security Groups resource group. |
| Azure.NSGResourceGroup.tags | Unknown | The tags associated with the Azure Network Security Groups resource group. |
| Azure.NSGResourceGroup.tags.Name | String | The name tag of the Azure Network Security Groups resource group. |
| Azure.NSGResourceGroup.managedBy | String | The entity that manages the Azure Network Security Groups resource group. |
| Azure.NSGResourceGroup.tags.aNSG-managed-cluster-name | String | The ANSG managed cluster name tag associated with the Azure Network Security Groups resource group. |
| Azure.NSGResourceGroup.tags.aNSG-managed-cluster-rg | String | The ANSG managed cluster resource group tag associated with the Azure Network Security Groups resource group. |
| Azure.NSGResourceGroup.tags.type | String | The type tag associated with the Azure Network Security Groups resource group. |
azure-vm-instance-power-off
Powers off a given virtual machine. The command is deprecated, please use azure-compute-vm-power-off. Required Permissions: Microsoft.Compute/virtualMachines/read, Microsoft.Compute/virtualMachines/poweroff/action.
Base Command
azure-vm-instance-power-off
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group to which the virtual machine belongs. | Required |
| virtual_machine_name | The name of the virtual machine to power off. To see all virtual machines with their associated names for a specific resource group, run the azure-compute-vm-list command. |
Required |
| skip_shutdown | Set to True to request non-graceful VM shutdown. Possible values are: true, false. Default is false. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Compute.name | string | The name of the virtual machine that was powered off. |
| Azure.Compute.resourceGroup | string | The resource group in which the virtual machine resides. |
| Azure.Compute.powerState | string | Whether the virtual machine instance is powered on or off. |
azure-billing-usage-list
Returns actual usage and cost details for a given time period, optionally filtered by service name. Required permission: Microsoft.Consumption/usageDetails/read.
Base Command
azure-billing-usage-list
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| expand_result | Whether to expand the result. Default - false. Possible values are: false, true. | Optional |
| filter | Optional filter for the API. API argument - $filter. | Optional |
| metric | The metric to retrieve. API values [actualcost, amortizedcost, usage]. Possible values are: Actual Cost, Amortized Cost, Usage. | Optional |
| max_results | Maximum results to return. Default - 50, Max - 1000. Default is 50. | Optional |
| next_page_token | Next page token for pagination. Use value from Azure.Billing.UsageNextToken. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Billing.Usage | unknown | List of usage details from Azure Consumption API. |
| Azure.Billing.Usage.id | String | Fully qualified resource ID for the usage detail. |
| Azure.Billing.Usage.name | String | Name of the usage detail resource. |
| Azure.Billing.Usage.type | String | Resource type (Microsoft.Consumption/usageDetails). |
| Azure.Billing.Usage.kind | String | Kind of usage detail (legacy, modern). |
| Azure.Billing.Usage.properties.billingAccountId | String | Billing account identifier. |
| Azure.Billing.Usage.properties.billingAccountName | String | Billing account name. |
| Azure.Billing.Usage.properties.billingPeriodStartDate | Date | Billing period start date. |
| Azure.Billing.Usage.properties.billingPeriodEndDate | Date | Billing period end date. |
| Azure.Billing.Usage.properties.billingProfileId | String | Billing profile identifier. |
| Azure.Billing.Usage.properties.billingProfileName | String | Billing profile name. |
| Azure.Billing.Usage.properties.accountOwnerId | String | Account owner identifier. |
| Azure.Billing.Usage.properties.accountName | String | Account name. |
| Azure.Billing.Usage.properties.subscriptionId | String | Subscription identifier. |
| Azure.Billing.Usage.properties.subscriptionName | String | Subscription name. |
| Azure.Billing.Usage.properties.date | Date | Usage date. |
| Azure.Billing.Usage.properties.product | String | Product name. |
| Azure.Billing.Usage.properties.partNumber | String | Part number for the product. |
| Azure.Billing.Usage.properties.meterId | String | Meter identifier. |
| Azure.Billing.Usage.properties.meterDetails | unknown | Meter details object. |
| Azure.Billing.Usage.properties.meterDetails.meterName | String | Meter name. |
| Azure.Billing.Usage.properties.meterDetails.meterCategory | String | Meter category. |
| Azure.Billing.Usage.properties.meterDetails.meterSubCategory | String | Meter subcategory. |
| Azure.Billing.Usage.properties.meterDetails.unit | String | Unit of measure. |
| Azure.Billing.Usage.properties.meterDetails.meterLocation | String | Meter location. |
| Azure.Billing.Usage.properties.meterDetails.totalIncludedQuantity | Number | Total included quantity. |
| Azure.Billing.Usage.properties.meterDetails.pretaxStandardRate | Number | Pretax standard rate. |
| Azure.Billing.Usage.properties.quantity | Number | Usage quantity. |
| Azure.Billing.Usage.properties.effectivePrice | Number | Effective price for the usage. |
| Azure.Billing.Usage.properties.cost | Number | Cost amount. |
| Azure.Billing.Usage.properties.unitPrice | Number | Unit price. |
| Azure.Billing.Usage.properties.billingCurrency | String | Billing currency. |
| Azure.Billing.Usage.properties.resourceLocation | String | Resource location. |
| Azure.Billing.Usage.properties.consumedService | String | Consumed service name. |
| Azure.Billing.Usage.properties.resourceId | String | Resource identifier. |
| Azure.Billing.Usage.properties.resourceName | String | Resource name. |
| Azure.Billing.Usage.properties.serviceInfo1 | String | Service info 1. |
| Azure.Billing.Usage.properties.serviceInfo2 | String | Service info 2. |
| Azure.Billing.Usage.properties.additionalInfo | String | Additional information. |
| Azure.Billing.Usage.properties.invoiceSection | String | Invoice section. |
| Azure.Billing.Usage.properties.costCenter | String | Cost center. |
| Azure.Billing.Usage.properties.resourceGroup | String | Resource group name. |
| Azure.Billing.Usage.properties.reservationId | String | Reservation identifier. |
| Azure.Billing.Usage.properties.reservationName | String | Reservation name. |
| Azure.Billing.Usage.properties.productOrderId | String | Product order identifier. |
| Azure.Billing.Usage.properties.productOrderName | String | Product order name. |
| Azure.Billing.Usage.properties.offerId | String | Offer identifier. |
| Azure.Billing.Usage.properties.isAzureCreditEligible | Boolean | Whether usage is Azure credit eligible. |
| Azure.Billing.Usage.properties.term | String | Term. |
| Azure.Billing.Usage.properties.publisherName | String | Publisher name. |
| Azure.Billing.Usage.properties.publisherType | String | Publisher type. |
| Azure.Billing.Usage.properties.planName | String | Plan name. |
| Azure.Billing.Usage.properties.chargeType | String | Charge type. |
| Azure.Billing.Usage.properties.frequency | String | Frequency. |
| Azure.Billing.Usage.properties.payGPrice | Number | Pay-as-you-go price. |
| Azure.Billing.Usage.properties.pricingModel | String | Pricing model. |
| Azure.Billing.UsageNextToken | String | Next page token for pagination. |
azure-billing-forecast-list
Returns cost forecast for a subscription over a given time range. Required permission: Microsoft.CostManagement/forecast/read.
Base Command
azure-billing-forecast-list
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| type | Forecast type (required). Possible values are: Usage, ActualCost, AmortizedCost. | Required |
| aggregation_function_name | The name of the column to aggregate (required). Possible values are: PreTaxCostUSD, Cost, CostUSD, PreTaxCost. | Required |
| aggregation_function_type | The name of the aggregation function to use. Default is Sum. | Optional |
| granularity | The granularity of the forecast. Default is Daily. | Optional |
| start_date | Start date for the forecast. Default value current time (UTC). e.g. 2022-01-01T00:00:00Z. | Optional |
| end_date | End date for the forecast. Default value 7 days from current time (UTC). e.g. 2022-01-01T00:00:00Z. | Optional |
| filter | A URL parameter to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. | Optional |
| include_actual_cost | Include actual cost data. Possible values are: true, false. Default is false. | Optional |
| include_fresh_partial_cost | Include fresh partial cost data. Possible values are: true, false. Default is false. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Billing.Forecast.Cost | Number | Cost amount. |
| Azure.Billing.Forecast.CostUSD | Number | Cost in USD. |
| Azure.Billing.Forecast.PreTaxCost | Number | Pre-tax cost amount. |
| Azure.Billing.Forecast.UsageDate | String | Usage date for the forecast (YYYY-MM-DD format). |
| Azure.Billing.Forecast.CostStatus | String | Cost status (Forecast, Actual). |
| Azure.Billing.Forecast.Currency | String | Currency code for the forecast. |
azure-billing-budgets-list
Lists configured budgets at the subscription or resource group level. Required permission: Microsoft.Consumption/budgets/read.
Base Command
azure-billing-budgets-list
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| budget_name | Name of the budget. Optional; if provided, returns a specific budget. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Billing.Budget | unknown | List of budget details from Azure Consumption API. |
| Azure.Billing.Budget.id | String | Fully qualified resource ID for the budget. |
| Azure.Billing.Budget.name | String | Name of the budget resource. |
| Azure.Billing.Budget.type | String | Resource type (Microsoft.Consumption/budgets). |
| Azure.Billing.Budget.eTag | String | ETag for the budget resource. |
| Azure.Billing.Budget.properties.category | String | Budget category (Cost, Usage). |
| Azure.Billing.Budget.properties.amount | Number | Budget amount limit. |
| Azure.Billing.Budget.properties.timeGrain | String | Time grain for the budget (Monthly, Quarterly, Annually). |
| Azure.Billing.Budget.properties.timePeriod | unknown | Time period object for the budget. |
| Azure.Billing.Budget.properties.timePeriod.startDate | Date | Start date of the budget period. |
| Azure.Billing.Budget.properties.timePeriod.endDate | Date | End date of the budget period. |
| Azure.Billing.Budget.properties.currentSpend | unknown | Current spend object. |
| Azure.Billing.Budget.properties.currentSpend.amount | Number | Current spend amount. |
| Azure.Billing.Budget.properties.currentSpend.unit | String | Currency unit for current spend. |
| Azure.Billing.Budget.properties.notifications | unknown | Budget notifications configuration. |
| Azure.Billing.Budget.properties.filter | unknown | Budget filter configuration. |
| Azure.Billing.Budget.properties.filter.and | unknown | AND filter conditions. |
| Azure.Billing.Budget.properties.filter.dimensions | unknown | Dimension filters. |
| Azure.Billing.Budget.properties.filter.dimensions.name | String | Dimension name (ResourceGroup, ResourceType, etc.). |
| Azure.Billing.Budget.properties.filter.dimensions.operator | String | Filter operator (In, Equal). |
| Azure.Billing.Budget.properties.filter.dimensions.values | unknown | Filter values array. |
| Azure.Billing.Budget.properties.filter.tags | unknown | Tag filters. |
| Azure.Billing.Budget.properties.filter.tags.name | String | Tag name. |
| Azure.Billing.Budget.properties.filter.tags.operator | String | Tag filter operator. |
| Azure.Billing.Budget.properties.filter.tags.values | unknown | Tag filter values. |
| Azure.Billing.Budget.properties.forecastSpend | unknown | Forecasted spend object. |
| Azure.Billing.Budget.properties.forecastSpend.amount | Number | Forecasted spend amount. |
| Azure.Billing.Budget.properties.forecastSpend.unit | String | Currency unit for forecasted spend. |
azure-storage-container-property-get
Retrieves properties for a specific Container. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/read.
Base Command
azure-storage-container-property-get
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Container. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Storage.Container.Property.Last-Modified | Date | Last modified time of the container. |
| Azure.Storage.Container.Property.Etag | String | The entity tag for the container. |
| Azure.Storage.Container.Property.X-Ms-Lease-Status | String | The lease status of the container. |
| Azure.Storage.Container.Property.X-Ms-Lease-State | String | The lease state of the container. |
| Azure.Storage.Container.Property.X-Ms-Has-Immutability-Policy | String | Indicates whether the container has an immutability policy set on it. |
| Azure.Storage.Container.Property.X-Ms-Has-Legal-Hold | String | Indicates whether the container has a legal hold. |
| Azure.Storage.Container.ContainerName | String | Container name. |
azure-storage-container-create
Creates a new Container under the specified account. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/write.
Base Command
azure-storage-container-create
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Container to create. Rules for naming containers can be found here: https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers–blobs–and-metadata . |
Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
There is no context output for this command.
azure-storage-container-delete
Marks a specific Container for deletion. The Container and any Blobs contained within it will be deleted during garbage collection. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/delete.
Base Command
azure-storage-container-delete
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Container to delete. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
There is no context output for this command.
azure-storage-container-blob-create
Create a new Blob under the specified Container. The command is deprecated, please use azure-storage-blob-create. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write.
Base Command
azure-storage-container-blob-create
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Blob Container. | Required |
| file_entry_id | The entry ID of the file to upload as a new blob. Available from the war room while the context data contains file output. | Required |
| blob_name | The name of the Blob to create. Default is the file name | Optional |
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
There is no context output for this command.
azure-storage-container-blob-get
Retrieve Blob from Container. The command is deprecated, please use azure-storage-blob-get. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read.
Base Command
azure-storage-container-blob-get
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Blob Container. | Required |
| blob_name | The name of the Blob to retrieve. | Required |
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| File.Size | String | The size of the file. |
| File.SHA1 | String | The SHA1 hash of the file. |
| File.SHA256 | String | The SHA256 hash of the file. |
| File.Name | String | The name of the file. |
| File.SSDeep | String | The SSDeep hash of the file. |
| File.EntryID | String | The entry ID of the file. |
| File.Info | String | File information. |
| File.Type | String | The file type. |
| File.MD5 | Unknown | The MD5 hash of the file. |
| File.Extension | String | The file extension. |
azure-storage-container-blob-tag-get
Retrieve the tags of the specified Blob. The command is deprecated, please use azure-storage-blob-tag-get. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/read.
Base Command
azure-storage-container-blob-tag-get
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Blob Container. | Required |
| blob_name | The name of the blob. | Required |
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.StorageContainer.Container.Blob.Tag.Key | String | Tag key. |
| Azure.StorageContainer.Container.Blob.Tag.Value | String | Tag value. |
| Azure.StorageContainer.Container.Blob.name | String | Blob name. |
| Azure.StorageContainer.Container.name | String | Container name. |
azure-storage-container-blob-tag-set
Sets the tags for the specified Blob. The command replace the entire tags of the Blob and can be used to remove tags. The command is deprecated, please use azure-storage-blob-tag-set. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/read, Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/write.
Base Command
azure-storage-container-blob-tag-set
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Blob Container. | Required |
| blob_name | The name of the blob. | Required |
| tags | Tags fields in JSON format: {“tag-name-1”: “tag-value-1”, “tag-name-2”: “tag-value-2”}. The tags fields may contain at most 10 tags. | Required |
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
There is no context output for this command.
azure-storage-container-blob-property-get
Retrieve Blob properties. The command is deprecated, please use azure-storage-blob-property-get. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read.
Base Command
azure-storage-container-blob-property-get
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Blob Container. | Required |
| blob_name | The name of the blob. | Required |
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.StorageContainer.Container.Blob.Property.last_modified | Date | Last modified time of the blob. |
| Azure.StorageContainer.Container.Blob.Property.etag | String | The entity tag for the blob. |
| Azure.StorageContainer.Container.Blob.Property.lease_status | String | The lease status of the blob. |
| Azure.StorageContainer.Container.Blob.Property.lease_state | String | The lease state of the blob. |
| Azure.StorageContainer.Container.Blob.Property.blob_type | String | The blob type. |
| Azure.StorageContainer.Container.Blob.Property.content_length | Number | The size of the blob in bytes. |
| Azure.StorageContainer.Container.Blob.Property.content_type | String | The content type specified for the blob. If no content type was specified, the default content type is application/octet-stream. |
| Azure.StorageContainer.Container.Blob.Property.content-md5 | String | The MD5 hash of the blob content. |
| Azure.StorageContainer.Container.Blob.Property.creation_time | Date | The date at which the blob was created. |
| Azure.StorageContainer.Container.Blob.name | String | Blob name. |
azure-storage-container-blob-property-set
Set Blob properties. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write.
Base Command
azure-storage-container-blob-property-set
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Blob Container. | Required |
| blob_name | The name of the blob. | Required |
| subscription_id | The subscription ID. | Required |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
| content_type | Blob content type. Indicates the media type of the blob. | Optional |
| content_md5 | Blob MD5 hash value. Can be used by the client to check for content integrity. | Optional |
| content_encoding | Blob content encoding. Used to specify the compression algorithm of the blob content. | Optional |
| content_language | Blob content language. Describes the human languages of the blob content. | Optional |
| content_disposition | Blob content disposition. Conveys additional information about how to process the response payload, and also can be used to attach additional metadata. | Optional |
| cache_control | Modifies the cache control string for the blob. Indicates directives for caching in both requests and responses. | Optional |
| request_id | Request ID generated by the client and recorded in the analytics logs when storage analytics logging is enabled. | Optional |
| lease_id | Required if the blob has an active lease. | Optional |
Context Output
There is no context output for this command.
azure-storage-container-public-access-block
Blocks public access to a container. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/setAcl/action.
Base Command
azure-storage-container-public-access-block
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | Name of a container. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
There is no context output for this command.
azure-storage-blob-property-get
Retrieve Blob properties. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read.
Base Command
azure-storage-blob-property-get
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Blob Container. | Required |
| blob_name | The name of the blob. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Storage.Blob.Property.Last-Modified | Date | Last modified time of the blob. |
| Azure.Storage.Blob.Property.Etag | String | The entity tag for the blob. |
| Azure.Storage.Blob.Property.X-Ms-Lease-Status | String | The lease status of the blob. |
| Azure.Storage.Blob.Property.X-Ms-Lease-State | String | The lease state of the blob. |
| Azure.Storage.Blob.Property.X-Ms-Blob-Type | String | The blob type. |
| Azure.Storage.Blob.Property.Content-Type | String | The content type specified for the blob. If no content type was specified, the default content type is application/octet-stream. |
| Azure.Storage.Blob.Property.Content-Md5 | String | The MD5 hash of the blob content. |
| Azure.Storage.Blob.Property.X-Ms-Creation-Time | String | The date at which the blob was created. |
| Azure.Storage.Blob.Property.Server | String | The server used to process the request. |
| Azure.Storage.Blob.Property.Accept-Ranges | String | Indicates that the service supports requests for partial blob content. |
| Azure.Storage.Blob.Property.Connection | String | The connection status of the response. |
| Azure.Storage.Blob.Property.Date | String | A UTC date/time value generated by the service that indicates the time when the response was initiated. |
| Azure.Storage.Blob.Property.Transfer-Encoding | String | The form of encoding used to safely transfer the payload to the user. |
| Azure.Storage.Blob.Property.X-Ms-Access-Tier | String | The tier of page blob on a Premium Storage account or tier of a block blob in a Blob Storage or general purpose v2 account. |
| Azure.Storage.Blob.Property.X-Ms-Access-Tier-Inferred | String | For page blobs on a Premium Storage account only. If the access tier isn’t explicitly set on the blob, the tier is inferred based on its content length, and this header is returned with a value of true. |
| Azure.Storage.Blob.Property.X-Ms-Request-Id | String | This header uniquely identifies the request that was made. |
| Azure.Storage.Blob.Property.X-Ms-Server-Encrypted | String | The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. |
| Azure.Storage.Blob.Property.X-Ms-Version | String | Specifies the version of the operation to use for this request. |
| Azure.Storage.Blob.name | String | Blob name. |
| Azure.Storage.Blob.ContainerName | String | Container name. |
azure-storage-blob-tag-get
Retrieve the tags of the specified Blob. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/read.
Base Command
azure-storage-blob-tag-get
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Blob Container. | Required |
| blob_name | The name of the blob. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Storage.Blob.Tag.Key | String | Tag key. |
| Azure.Storage.Blob.Tag.Value | String | Tag value. |
| Azure.Storage.Blob.name | String | Blob name. |
| Azure.Storage.Blob.ContainerName | String | Container name. |
azure-compute-vm-list
Lists all the virtual machines in the specified subscription. Use the next_token argument to view the next page of results. Required Permissions: Microsoft.Compute/virtualMachines/read.
Base Command
azure-compute-vm-list
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The name of the resource group. | Required |
| next_token | The URI to fetch the next page of results. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Compute.VirtualMachines.type | String | The type of the resource. |
| Azure.Compute.VirtualMachines.location | String | The location of the resource. |
| Azure.Compute.VirtualMachines.tags | Unknown | The tags of the resource. |
| Azure.Compute.VirtualMachines.id | String | The ID of the resource. |
| Azure.Compute.VirtualMachines.name | String | The name of the resource. |
| Azure.Compute.VirtualMachines.etag | String | The ETag of the virtual machine, used to prevent overwriting concurrent updates. |
| Azure.Compute.VirtualMachines.extendedLocation | Unknown | The extended location of the Virtual Machine. |
| Azure.Compute.VirtualMachines.identity | Unknown | The identity of the virtual machine, if configured. |
| Azure.Compute.VirtualMachines.managedBy | Unknown | MThe ARM resource ID of the Virtual Machine Scale Set (VMSS) that manages the virtual machine, if applicable. Used for internal resource group delete optimization. |
| Azure.Compute.VirtualMachines.placement | Unknown | The user-defined constraints for virtual machine hardware placement. This property cannot be changed once the VM is provisioned. Minimum api-version: 2024-11-01. |
| Azure.Compute.VirtualMachines.plan | Unknown | Information about the marketplace image used to create the virtual machine. |
| Azure.Compute.VirtualMachines.systemData | Unknown | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
| Azure.Compute.VirtualMachines.zones | Unknown. | The availability zones. |
| Azure.Compute.VirtualMachines.properties.vmId | String | The unique ID of the virtual machine. |
| Azure.Compute.VirtualMachines.properties.availabilitySet | String | The availability set that the virtual machine is in. |
| Azure.Compute.VirtualMachines.properties.hardwareProfile | Unknown | The hardware settings for the virtual machine. |
| Azure.Compute.VirtualMachines.properties.storageProfile | Unknown | The storage settings for the virtual machine disks. |
| Azure.Compute.VirtualMachines.properties.osProfile | Unknown | The operating system settings for the virtual machine. |
| Azure.Compute.VirtualMachines.properties.networkProfile | Unknown | The network interfaces of the virtual machine. |
| Azure.Compute.VirtualMachines.properties.provisioningState | String | The provisioning state, which only appears in the response. |
| Azure.Compute.VirtualMachines.properties.additionalCapabilities | Unknown | Additional capabilities enabled or disabled on the virtual machine. |
| Azure.Compute.VirtualMachines.properties.securityProfile | Unknown | The security settings for the virtual machine. |
| Azure.Compute.VirtualMachines.properties.diagnosticsProfile | Unknown | The boot diagnostic settings state. |
| Azure.Compute.VirtualMachines.properties.virtualMachineScaleSet | Unknown | The virtual machine scale set that the virtual machine is in. |
| Azure.Compute.VirtualMachines.properties.proximityPlacementGroup | Unknown | The proximity placement group that the virtual machine is in. |
| Azure.Compute.VirtualMachines.properties.scheduledEventsPolicy | Unknown | The Redeploy, Reboot, and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the virtual machine. |
| Azure.Compute.VirtualMachines.properties.priority | String | The priority for the virtual machine. |
| Azure.Compute.VirtualMachines.properties.evictionPolicy | String | The eviction policy for the virtual machine. |
| Azure.Compute.VirtualMachines.properties.billingProfile | Unknown | The billing related details of a Azure Spot virtual machine. |
| Azure.Compute.VirtualMachines.properties.host | Unknown | The host that the virtual machine is in. |
| Azure.Compute.VirtualMachines.properties.hostGroup | Unknown | The host group that the virtual machine is in. |
| Azure.Compute.VirtualMachines.properties.licenseType | String | The license type for bringing your own license scenario. |
| Azure.Compute.VirtualMachines.properties.extensionsTimeBudget | String | The time alloted for all extensions to start. |
| Azure.Compute.VirtualMachines.properties.platformFaultDomain | Number | The fault domain that the virtual machine is in. |
| Azure.Compute.VirtualMachines.properties.scheduledEventsProfile | Unknown | The scheduled event related configurations. |
| Azure.Compute.VirtualMachines.properties.userData | String | The user data for the VM, which must be base-64 encoded. |
| Azure.Compute.VirtualMachines.properties.capacityReservation | Unknown | The capacity reservation related details of a virtual machine. |
| Azure.Compute.VirtualMachines.properties.applicationProfile | Unknown | The gallery applications that should be made available to the VM/VMSS. |
| Azure.Compute.VirtualMachines.properties.timeCreated | Date | The time when the virtual machine was created. |
| Azure.Compute.VirtualMachines.plan.name | String | The plan name. |
| Azure.Compute.VirtualMachines.plan.publisher | String | The publisher of the plan. |
| Azure.Compute.VirtualMachines.plan.product | String | The product of the plan. |
| Azure.Compute.VirtualMachines.plan.promotionCode | String | The promotion code of the plan. |
| Azure.Compute.VirtualMachines.resources.properties | Unknown | The properties of the resource. |
| Azure.Compute.VirtualMachines.resources.id | String | The ID of the resource. |
| Azure.Compute.VirtualMachines.resources.name | String | The name of the resource. |
| Azure.Compute.VirtualMachines.resources.type | String | The type of the resource. |
| Azure.Compute.VirtualMachines.resources.location | String | The location of the resource. |
| Azure.Compute.VirtualMachines.resources.tags | Unknown | The tags of the resource. |
| Azure.Compute.VirtualMachines.identity.principalId | String | The principal ID of the identity. |
| Azure.Compute.VirtualMachines.identity.tenantId | String | The tenant ID of the identity. |
| Azure.Compute.VirtualMachines.identity.type | String | The type of the identity. |
| Azure.Compute.VirtualMachines.identity.userAssignedIdentities | String | The list of user assigned identities associated with the virtual machine. |
| Azure.Compute.VirtualMachines.zones | String | The zones of the virtual machine. |
| Azure.Compute.VirtualMachines.extendedLocation.name | String | The name of the extended location. |
| Azure.Compute.VirtualMachines.extendedLocation.type | String | The type of the extended location. |
| Azure.Compute.VirtualMachines.properties.instanceView | Unknown | The virtual machine instance view. |
| Azure.Compute.VirtualMachinesNextToken | String | The URI to fetch the next page of VMs. Run the same command with the next_token argument to get the next page of VMs. |
azure-compute-vm-get
Gets the properties of a given virtual machine. Required Permissions: Microsoft.Compute/virtualMachines/read.
Base Command
azure-compute-vm-get
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group to which the virtual machine belongs. | Required |
| virtual_machine_name | The name of the virtual machine you want to view the details of. To see all the virtual machines with their associated names for a specific resource group, run the azure-compute-vm-list command. |
Required |
| expand | The expand expression to apply on the operation. ‘InstanceView’ retrieves a snapshot of the runtime properties of the virtual machine that is managed by the platform and can change outside of control plane operations. ‘UserData’ retrieves the UserData property as part of the VM model view that was provided by the user during the VM Create/Update operation. Possible values are: instanceView, userData, resiliencyView. Default is instanceView. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Compute.VirtualMachines.name | string | The name of the virtual machine you want to get details of. |
| Azure.Compute.VirtualMachines.id | string | The ID of the virtual machine. |
| Azure.Compute.VirtualMachines.location | string | The region in which the virtual machine is hosted. |
| Azure.Compute.VirtualMachines.properties.provisioningState | string | The provisioning state of the deployed virtual machine. |
| Azure.Compute.VirtualMachines.networkProfile.networkInterfaces | string | The list of network interfaces attached to this virtual machine. |
| Azure.Compute.VirtualMachines.properties.hardwareProfile | Unknown | Specifies the hardware settings for the virtual machine. |
| Azure.Compute.VirtualMachines.properties.osProfile | string | The operating system configuration of the virtual machine, including admin credentials and hostname. |
| Azure.Compute.VirtualMachines.properties.storageProfile | string | The storage settings for the virtual machine, including OS and data disks. |
| Azure.Compute.VirtualMachines.properties.vmId | string | The unique identifier assigned to the virtual machine instance. |
| Azure.Compute.VirtualMachines.properties.instanceView | string | Detailed runtime status information about the virtual machine, such as power state and extensions. |
| Azure.Compute.VirtualMachines.properties.timeCreated | string | The timestamp when the virtual machine was created. |
| Azure.Compute.VirtualMachines.properties.networkProfile | string | The network configuration of the virtual machine, including associated network interfaces and settings. |
| Azure.Compute.VirtualMachines.properties.diagnosticsProfile | string | The configuration for boot diagnostics and monitoring of the virtual machine. |
azure-vn-security-group-create
Creates a network security group. Required Permissions: Microsoft.Network/networkSecurityGroups/write.
Base Command
azure-vn-security-group-create
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| security_group_name | The name of the network security group. | Required |
| location | The location of the network security group. Possible values are: australiacentral, australiacentral2, australiaeast, australiasoutheast, brazilsouth, brazilsoutheast, brazilus, canadacentral, canadaeast, centralindia, centralus, centraluseuap, eastasia, eastus, eastus2, eastus2euap, francecentral, francesouth, germanynorth, germanywestcentral, israelcentral, italynorth, japaneast, japanwest, jioindiacentral, jioindiawest, koreacentral, koreasouth, malaysiasouth, mexicocentral, newzealandnorth, northcentralus, northeurope, norwayeast, norwaywest, polandcentral, qatarcentral, southafricanorth, southafricawest, southcentralus, southeastasia, southindia, spaincentral, swedencentral, swedensouth, switzerlandnorth, switzerlandwest, uaecentral, uaenorth, uksouth, ukwest, westcentralus, westeurope, westindia, westus, westus2, westus3, australiaeastfoundational, austriaeast, chilecentral, eastusslv, indonesiacentral, israelnorthwest, malaysiawest, southcentralus2, southeastus, southeastus3, southwestus, usgovarizona, usgovtexas, usgovvirginia. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.VirtualNetworks.SecurityGroups.name | String | The security group’s name. |
| Azure.VirtualNetworks.SecurityGroups.id | String | The security group’s ID. |
| Azure.VirtualNetworks.SecurityGroups.etag | String | The security group’s ETag. |
| Azure.VirtualNetworks.SecurityGroups.type | String | The resource type. |
| Azure.VirtualNetworks.SecurityGroups.location | String | The resource location. |
| Azure.VirtualNetworks.SecurityGroups.properties.provisioningState | String | The provisioning state of the network security group resource. |
| Azure.VirtualNetworks.SecurityGroups.properties.resourceGuid | String | The resource GUID property of the network security group resource. |
| Azure.VirtualNetworks.SecurityGroups.properties.flushConnection | Boolean | When enabled, flows created from Network Security Group connections will be re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. |
| Azure.VirtualNetworks.SecurityGroups.properties.securityRules | Unknown | A collection of security rules of the network security group. |
| Azure.VirtualNetworks.SecurityGroups.properties.defaultSecurityRules | Unknown | A collection of the default security rules of the network security group. |
| Azure.VirtualNetworks.SecurityGroups.properties.flowLogs | Unknown | A collection of references to flow log resources. |
| Azure.VirtualNetworks.SecurityGroups.properties.networkInterfaces | Unknown | A collection of references to network interfaces. |
| Azure.VirtualNetworks.SecurityGroups.properties.subnets | Unknown | A collection of references to subnets. |
azure-compute-vm-power-off
Powers off a given virtual machine. Required Permissions: Microsoft.Compute/virtualMachines/poweroff/action.
Base Command
azure-compute-vm-power-off
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group to which the virtual machine belongs. To see all the resource groups associated with your subscription, run the azure-rm-resource-groups-list command. |
Required |
| virtual_machine_name | The name of the virtual machine to power off. To see all virtual machines with their associated names for a specific resource group, run the azure-compute-vm-list command. |
Required |
| skip_shutdown | Set to True to request non-graceful VM shutdown. Possible values are: true, false. Default is false. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Compute.VirtualMachines.name | string | The name of the virtual machine that was powered off. |
| Azure.Compute.VirtualMachines.resourceGroup | string | The resource group in which the virtual machine resides. |
| Azure.Compute.VirtualMachines.powerState | string | Whether the virtual machine instance is powered on or off. |
azure-compute-vm-start
Powers on a given virtual machine. Required Permissions: Microsoft.Compute/virtualMachines/start/action.
Base Command
azure-compute-vm-start
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | Resource Group to which the virtual machine belongs. | Required |
| virtual_machine_name | Name of the virtual machine to power on. To see all virtual machines and their associated names for a specific resource group, run the azure-compute-vm-list command. |
Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Compute.VirtualMachines.name | String | Name of the VM that was started. |
| Azure.Compute.VirtualMachines.resourceGroup | String | Resource group the VM resides in. |
| Azure.Compute.VirtualMachines.powerState | String | Whether the VM instance is powered on or off. |
azure-cosmosdb-db-account-update
Updates the properties of an existing Azure Cosmos DB database account. The required permissions are: Microsoft.DocumentDB/databaseAccounts/read, Microsoft.DocumentDB/databaseAccounts/write.
Base Command
azure-cosmosdb-db-account-update
Input
| Argument Name | Description | Required |
|---|---|---|
| account_name | Cosmos DB database account name. | Required |
| disable_key_based_metadata_write_access | Whether to disable write operations on metadata resources via account keys. Possible values are: true, false. | Optional |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The name of the resource group. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.CosmosDB.DBAccounts.id | String | The unique resource identifier of the ARM resource. |
| Azure.CosmosDB.DBAccounts.name | String | The name of the ARM resource. |
| Azure.CosmosDB.DBAccounts.location | String | The location of the resource group to which the resource belongs. |
| Azure.CosmosDB.DBAccounts.kind | String | The database account type. |
| Azure.CosmosDB.DBAccounts.identity.type | String | The type of identity used for the resource. |
| Azure.CosmosDB.DBAccounts.identity.userAssignedIdentities | Unknown | The list of user identities associated with the resource. |
| Azure.CosmosDB.DBAccounts.properties.analyticalStorageConfiguration | Unknown | Analytical storage specific properties. |
| Azure.CosmosDB.DBAccounts.properties.apiProperties | Unknown | API specific properties. |
| Azure.CosmosDB.DBAccounts.properties.backupPolicy | Unknown | The policy for taking backups on an account. |
| Azure.CosmosDB.DBAccounts.properties.capabilities | Unknown | List of Cosmos DB capabilities for the account. |
| Azure.CosmosDB.DBAccounts.properties.capacity | Number | Properties related to capacity enforcement on an account. |
| Azure.CosmosDB.DBAccounts.properties.connectorOffer | String | The Cassandra connector offer type for the Cosmos DB database account. |
| Azure.CosmosDB.DBAccounts.properties.consistencyPolicy | String | The consistency policy for the Cosmos DB database account. |
| Azure.CosmosDB.DBAccounts.properties.cors | Unknown | The CORS policy for the Cosmos DB database account. |
| Azure.CosmosDB.DBAccounts.properties.createMode | String | The mode of account creation. |
| Azure.CosmosDB.DBAccounts.properties.customerManagedKeyStatus | String | Status of the Customer Managed Key feature on the account. |
| Azure.CosmosDB.DBAccounts.properties.databaseAccountOfferType | String | The offer type for the Cosmos DB database account. |
| Azure.CosmosDB.DBAccounts.properties.defaultIdentity | String | The default identity for accessing key vault used in features like customer managed keys. |
| Azure.CosmosDB.DBAccounts.properties.disableKeyBasedMetadataWriteAccess | Boolean | Whether write operations on metadata resources via account keys is disabled. |
| Azure.CosmosDB.DBAccounts.properties.disableLocalAuth | Boolean | Whether local authentication is disabled. |
| Azure.CosmosDB.DBAccounts.properties.documentEndpoint | String | The connection endpoint for the Cosmos DB database account. |
| Azure.CosmosDB.DBAccounts.properties.enableAnalyticalStorage | Boolean | Whether storage analytics are enabled. |
| Azure.CosmosDB.DBAccounts.properties.enableAutomaticFailover | Boolean | Enables automatic failover of the write region. |
| Azure.CosmosDB.DBAccounts.properties.enableBurstCapacity | Boolean | Whether Burst Capacity is enabled. |
| Azure.CosmosDB.DBAccounts.properties.enableCassandraConnector | Boolean | Enables the Cassandra connector on the Cosmos DB account. |
| Azure.CosmosDB.DBAccounts.properties.enableFreeTier | Boolean | Whether Free Tier is enabled. |
| Azure.CosmosDB.DBAccounts.properties.enableMultipleWriteLocations | Boolean | Enables the account to write in multiple locations. |
| Azure.CosmosDB.DBAccounts.properties.enablePartitionMerge | Boolean | Whether Partition Merge is enabled. |
| Azure.CosmosDB.DBAccounts.properties.enablePerRegionPerPartitionAutoscale | Boolean | Whether PerRegionPerPartitionAutoscale is enabled. |
| Azure.CosmosDB.DBAccounts.properties.failoverPolicies | Unknown | An array that contains the regions ordered by their failover priorities. |
| Azure.CosmosDB.DBAccounts.properties.instanceId | String | A unique identifier assigned to the database account. |
| Azure.CosmosDB.DBAccounts.properties.ipRules | Unknown | List of IP rules. |
| Azure.CosmosDB.DBAccounts.properties.isVirtualNetworkFilterEnabled | Boolean | Whether the Virtual Network ACL rules are enabled. |
| Azure.CosmosDB.DBAccounts.properties.keyVaultKeyUri | String | The URI of the key vault. |
| Azure.CosmosDB.DBAccounts.properties.keysMetadata | Unknown | Metadata related to each access key for the given Cosmos DB database account. |
| Azure.CosmosDB.DBAccounts.properties.locations | Unknown | An array that contains all of the locations enabled for the Cosmos DB account. |
| Azure.CosmosDB.DBAccounts.properties.minimalTlsVersion | String | The minimum allowed TLS version. |
| Azure.CosmosDB.DBAccounts.properties.networkAclBypass | String | Which services are allowed to bypass firewall checks. |
| Azure.CosmosDB.DBAccounts.properties.networkAclBypassResourceIds | Unknown | List of resource IDs that are allowed to bypass firewall checks. |
| Azure.CosmosDB.DBAccounts.properties.privateEndpointConnections | Unknown | List of private endpoint connections. |
| Azure.CosmosDB.DBAccounts.properties.provisioningState | String | The status of the Cosmos DB account at the time the operation was called. |
| Azure.CosmosDB.DBAccounts.properties.readLocations | Unknown | An array that contains the read locations enabled for the Cosmos DB account. |
| Azure.CosmosDB.DBAccounts.properties.virtualNetworkRules | Unknown | List of Virtual Network ACL rules. |
| Azure.CosmosDB.DBAccounts.properties.writeLocations | Unknown | An array that contains the write locations enabled for the Cosmos DB account. |
azure-keyvault-vault-update
Updates a key vault in the specified subscription. The required permissions are: Microsoft.KeyVault/vaults/read, Microsoft.KeyVault/vaults/write.
Base Command
azure-keyvault-vault-update
Input
| Argument Name | Description | Required |
|---|---|---|
| vault_name | Key Vault name. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The name of the resource group. | Required |
| enable_purge_protection | Whether protection against purge is enabled for this vault. This functionality is always enabled, it cannot be disabled. Possible values are: true, false. | Optional |
| enable_soft_delete | Whether soft delete is enabled for this key vault. This functionality is always enabled, it cannot be disabled. Possible values are: true, false. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.KeyVault.Vault.id | String | Resource ID. |
| Azure.KeyVault.Vault.name | String | Key Vault name. |
| Azure.KeyVault.Vault.type | String | Resource type in Azure. |
| Azure.KeyVault.Vault.location | String | Key Vault location. |
| Azure.KeyVault.Vault.tags | Unknown | Resource tags. |
| Azure.KeyVault.Vault.properties.sku | String | SKU details. |
| Azure.KeyVault.Vault.properties.tenantId | String | The Entra ID tenant ID that should be used for authenticating requests to the key vault. |
| Azure.KeyVault.Vault.properties.accessPolicies | Unknown | An array of 0 to 1024 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault’s tenant ID. |
| Azure.KeyVault.Vault.properties.enabledForDeployment | Boolean | Whether Azure Virtual Machines are allowed to retrieve certificates stored as secrets from the key vault. |
| Azure.KeyVault.Vault.properties.enabledForDiskEncryption | Boolean | Whether Azure Disk Encryption is allowed to retrieve secrets from the vault and unwrap keys. |
| Azure.KeyVault.Vault.properties.enabledForTemplateDeployment | Boolean | Whether Azure Resource Manager is allowed to retrieve secrets from the key vault. |
| Azure.KeyVault.Vault.properties.enableSoftDelete | Boolean | Whether soft delete is enabled for this key vault. |
| Azure.KeyVault.Vault.properties.enablePurgeProtection | Boolean | Whether purge protection is enabled for this key vault. |
| Azure.KeyVault.Vault.properties.enableRbacAuthorization | Boolean | Whether Azure Key Vault uses Role Based Access Control, RBAC, for authorization of data actions. |
| Azure.KeyVault.Vault.properties.vaultUri | String | The URI of the vault for performing operations on keys and secrets. |
| Azure.KeyVault.Vault.properties.provisioningState | String | The current provisioning state. |
| Azure.KeyVault.Vault.properties.privateEndpointConnections | Unknown | List of private endpoint connections associated with the key vault. |
| Azure.KeyVault.Vault.properties.networkAcls | Unknown | Rules governing the accessibility of the key vault from specific network locations. |
azure-rm-resource-groups-list
Gets all resource groups for a subscription. Required Permissions: Microsoft.Resources/subscriptions/resourceGroups/read.
Base Command
azure-rm-resource-groups-list
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| limit | Limit on the number of resource groups to return. Default is 50. | Optional |
| tag | A single tag in the form of {"Tag Name":"Tag Value"} to filter the list by. |
Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.ResourceManagement.ResourceGroups.id | String | The unique identifier of the Azure Network Security Groups resource group. |
| Azure.ResourceManagement.ResourceGroups.name | String | The name of the Azure Network Security Groups resource group. |
| Azure.ResourceManagement.ResourceGroups.type | String | The type of the Azure Network Security Groups resource group. |
| Azure.ResourceManagement.ResourceGroups.location | String | The location of the Azure Network Security Groups resource group. |
| Azure.ResourceManagement.ResourceGroups.properties.provisioningState | String | The provisioning state of the Azure Network Security Groups resource group. |
| Azure.ResourceManagement.ResourceGroups.tags.Owner | String | The owner tag of the Azure Network Security Groups resource group. |
| Azure.ResourceManagement.ResourceGroups.tags | Unknown | The tags associated with the Azure Network Security Groups resource group. |
| Azure.ResourceManagement.ResourceGroups.tags.Name | String | The name tag of the Azure Network Security Groups resource group. |
| Azure.ResourceManagement.ResourceGroups.managedBy | String | The entity that manages the Azure Network Security Groups resource group. |
| Azure.ResourceManagement.ResourceGroups.tags.aNSG-managed-cluster-name | String | The ANSG managed cluster name tag associated with the Azure Network Security Groups resource group. |
| Azure.ResourceManagement.ResourceGroups.tags.aNSG-managed-cluster-rg | String | The ANSG managed cluster resource group tag associated with the Azure Network Security Groups resource group. |
| Azure.ResourceManagement.ResourceGroups.tags.type | String | The type tag associated with the Azure Network Security Groups resource group. |
azure-sqldb-security-alert-policy-update
Updates a database’s security alert policy. The required permissions are: Microsoft.Sql/servers/databases/securityAlertPolicies/read, Microsoft.Sql/servers/databases/securityAlertPolicies/write.
Base Command
azure-sqldb-security-alert-policy-update
Input
| Argument Name | Description | Required |
|---|---|---|
| server_name | Server name. | Required |
| db_name | Database name. | Required |
| email_account_admins_enabled | Whether the alert is sent to the account administrators. Possible values are: true, false. | Optional |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The name of the resource group. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.SqlDB.SecurityAlertPolicies.id | String | Threat policy ID. |
| Azure.SqlDB.SecurityAlertPolicies.name | String | Threat policy name. |
| Azure.SqlDB.SecurityAlertPolicies.properties.state | String | Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database. |
| Azure.SqlDB.SecurityAlertPolicies.properties.creationTime | String | Specifies the UTC creation time of the policy. |
| Azure.SqlDB.SecurityAlertPolicies.properties.retentionDays | Number | Specifies the number of days to keep in the Threat Detection audit logs. |
| Azure.SqlDB.SecurityAlertPolicies.properties.storageAccountAccessKey | String | Specifies the identifier key of the Threat Detection audit storage account. |
| Azure.SqlDB.SecurityAlertPolicies.properties.storageEndpoint | String | Specifies the blob storage endpoint. |
| Azure.SqlDB.SecurityAlertPolicies.properties.emailAccountAdmins | Boolean | Specifies that the alert is sent to the account administrators. |
| Azure.SqlDB.SecurityAlertPolicies.properties.emailAddresses | String | Specifies an array of e-mail addresses to which the alert is sent. |
| Azure.SqlDB.SecurityAlertPolicies.properties.disabledAlerts | Unknown | Specifies an array of alerts that are disabled. |
| Azure.SqlDB.SecurityAlertPolicies.systemData.createdAt | Unknown | The timestamp of resource creation (UTC). |
| Azure.SqlDB.SecurityAlertPolicies.systemData.createdBy | Unknown | The identity that created the resource. |
| Azure.SqlDB.SecurityAlertPolicies.systemData.createdByType | Unknown | The type of identity that created the resource. |
| Azure.SqlDB.SecurityAlertPolicies.systemData.lastModifiedAt | Unknown | The timestamp of resource last modification (UTC). |
| Azure.SqlDB.SecurityAlertPolicies.systemData.lastModifiedBy | Unknown | The identity that last modified the resource. |
| Azure.SqlDB.SecurityAlertPolicies.systemData.lastModifiedByType | Unknown | The type of identity that last modified the resource. |
azure-vn-network-interfaces-list
Gets network interfaces in a resource group. Required permissions: Microsoft.Network/networkInterfaces/read.
Base Command
azure-vn-network-interfaces-list
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| limit | The maximum number of records to return. Default is 50. | Optional |
| all_results | Whether to retrieve all results by overriding the default limit. Possible values are: false, true. Default is false. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.VirtualNetworks.NetworkInterfaces.name | String | The network interface’s name. |
| Azure.VirtualNetworks.NetworkInterfaces.id | String | The network interface’s ID. |
| Azure.VirtualNetworks.NetworkInterfaces.kind | String | The kind of the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.etag | String | The ETag of the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.location | String | The location of the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.managedBy | String | The entity that manages the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.tags | String | The tags associated with the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.provisioningState | String | The network interface’s provisioning state. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.ipConfigurations | Unknown | A list of IPConfigurations of the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.tapConfigurations | List | List of tap configurations. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.allowPort25Out | Boolean | Whether port 25 outbound traffic is allowed. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.nicType | String | The network interface card type (Standard/Basic). |
azure-vn-public-ip-addresses-list
Gets public IP addresses in a resource group. Required permissions: Microsoft.Network/publicIPAddresses/read.
Base Command
azure-vn-public-ip-addresses-list
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| limit | The maximum number of records to return. Default is 50. | Optional |
| all_results | Whether to retrieve all results by overriding the default limit. Possible values are: false, true. Default is false. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.VirtualNetworks.PublicIPAddresses.name | String | The public IP address’s name. |
| Azure.VirtualNetworks.PublicIPAddresses.id | String | The public IP address’s ID. |
| Azure.VirtualNetworks.PublicIPAddresses.location | String | The location of the public IP address. |
| Azure.VirtualNetworks.PublicIPAddresses.sku | String | The public IP address’s SKU. |
| Azure.VirtualNetworks.PublicIPAddresses.type | String | The type of the public IP address. |
| Azure.VirtualNetworks.PublicIPAddresses.etag | String | The public IP address’s ETag. |
| Azure.VirtualNetworks.PublicIPAddresses.properties.provisioningState | String | The public IP address’s provisioning state. |
| Azure.VirtualNetworks.PublicIPAddresses.properties.publicIPAddressVersion | String | The public IP address’s version. |
| Azure.VirtualNetworks.PublicIPAddresses.properties.ipAddress | String | The public IP address’s IP address. |
| Azure.VirtualNetworks.PublicIPAddresses.properties.publicIPAllocationMethod | String | The public IP address’s allocation method. |
| Azure.VirtualNetworks.PublicIPAddresses.properties.resourceGuid | String | The public IP address’s resource GUID. |
| Azure.VirtualNetworks.PublicIPAddresses.sku.name | String | The public IP address’s SKU name. |
| Azure.VirtualNetworks.PublicIPAddresses.sku.tier | String | The public IP address’s SKU tier. |
| Azure.VirtualNetworks.PublicIPAddresses.properties.ipConfiguration | String | The reference to another IP configuration associated with this resource. |
azure-vn-security-groups-list
List all network security groups. Required permissions: Microsoft.Network/networkSecurityGroups/read.
Base Command
azure-vn-security-groups-list
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.VirtualNetworks.SecurityGroups.name | String | The security group’s name. |
| Azure.VirtualNetworks.SecurityGroups.id | String | The security group’s ID. |
| Azure.VirtualNetworks.SecurityGroups.type | String | The security group’s type. |
| Azure.VirtualNetworks.SecurityGroups.location | String | The security group’s location. |
| Azure.VirtualNetworks.SecurityGroups.etag | String | The security group’s ETag. |
| Azure.VirtualNetworks.SecurityGroups.tags | String | The security group’s tags. |
| Azure.VirtualNetworks.SecurityGroups.properties.defaultSecurityRules | List | The default security rules. |
| Azure.VirtualNetworks.SecurityGroups.properties.networkInterfaces | List | The network interfaces. |
| Azure.VirtualNetworks.SecurityGroups.properties.provisioningState | String | The provisioning state. |
| Azure.VirtualNetworks.SecurityGroups.properties.resourceGuid | String | The resource GUID. |
| Azure.VirtualNetworks.SecurityGroups.properties.SecurityRules | List | The security rules. |
azure-vn-security-rule-create
Create a security rule. Required permissions: Microsoft.Network/networkSecurityGroups/securityRules/read, Microsoft.Network/networkSecurityGroups/securityRules/write.
Base Command
azure-vn-security-rule-create
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | Resource group name. | Required |
| security_group_name | The name of the security group. | Required |
| security_rule_name | The name of the rule to create. | Required |
| direction | The direction of the rule. Possible values are: Inbound, Outbound. | Required |
| access | Whether to allow the traffic. Possible values are: Allow, Deny. Default is Allow. | Optional |
| protocol | The protocol on which to apply the rule. Possible values are: Any, TCP, UDP, ICMP. Default is Any. | Optional |
| source | The source IP address range from which incoming traffic is allowed or denied by this rule. Possible values are “Any”, an IP address range, an application security group, or a default tag. Default is Any. | Optional |
| priority | The priority of the rule, with a value between 100 and 4096. Each rule in the collection must have a unique priority number. Lower numbers indicate higher priority. | Required |
| source_ports | The source ports from which traffic is allowed or denied by this rule. Provide a single port, such as 80; a port range, such as 1024-65535; or a comma-separated list of single ports and/or port ranges, such as 80,1024-65535. Use an asterisk (*) to allow traffic on any port. Default is *. |
Optional |
| destination | The destination IP address range for outgoing traffic that is allowed or denied by this rule. The destination filter can be “Any”, an IP address range, an application security group, or a default tag. Default is Any. | Optional |
| destination_ports | The destination ports from which traffic is allowed or denied by this rule. Provide a single port, such as 80; a port range, such as 1024-65535; or a comma-separated list of single ports and/or port ranges, such as 80,1024-65535. Use an asterisk () to allow traffic on any port. Default is. | Optional |
| description | A description to add to the rule. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.VirtualNetworks.SecurityRules.name | String | The rule’s name. |
| Azure.VirtualNetworks.SecurityRules.id | String | The rule’s ID. |
| Azure.VirtualNetworks.SecurityRules.etag | String | The rule’s ETag. |
| Azure.VirtualNetworks.SecurityRules.type | String | The rule’s type. |
| Azure.VirtualNetworks.SecurityRules.properties.provisioningState | String | The rule’s provisioning state. |
| Azure.VirtualNetworks.SecurityRules.properties.protocol | String | The protocol, which can be “TCP”, “UDP”, “ICMP”, or “*”. |
| Azure.VirtualNetworks.SecurityRules.properties.sourcePortRange | String | For a single port, the source port or a range of ports. For multiple ports, sourcePortRanges is used instead. |
| Azure.VirtualNetworks.SecurityRules.properties.sourcePortRanges | String | For multiple ports, a list of ports. For a single port, sourcePortRange is used instead. |
| Azure.VirtualNetworks.SecurityRules.properties.destinationPortRange | String | For a single port, the destination port or range of ports. For multiple ports, destinationPortRanges is used instead. |
| Azure.VirtualNetworks.SecurityRules.properties.destinationPortRanges | String | For multiple ports, a list of destination ports. For a single port, destinationPortRange is used instead. |
| Azure.VirtualNetworks.SecurityRules.properties.sourceAddressPrefix | String | The source address. |
| Azure.VirtualNetworks.SecurityRules.properties.destinationAddressPrefix | String | The destination address. |
| Azure.VirtualNetworks.SecurityRules.properties.access | String | The rule’s access. Can be “Allow” or “Deny”. |
| Azure.VirtualNetworks.SecurityRules.properties.priority | Number | The rule’s priority, ranging from 100 to 4096. |
| Azure.VirtualNetworks.SecurityRules.properties.direction | String | The rule’s direction, which can be “Inbound” or “Outbound”. |
azure-vn-network-interface-update
Updates a network interface. Required Permissions: Microsoft.Network/networkInterfaces/read, Microsoft.Network/networkInterfaces/write, Microsoft.Network/virtualNetworks/subnets/join/action, Microsoft.Network/publicIPAddresses/join/action, Microsoft.Network/networkSecurityGroups/join/action, Microsoft.Network/loadBalancers/backendAddressPools/join/action.
Base Command
azure-vn-network-interface-update
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group to which the network interface belongs. | Required |
| network_interface_name | The name of the network interface to update. | Required |
| location | The location of the network security group. Possible values are: australiacentral, australiacentral2, australiaeast, australiasoutheast, brazilsouth, brazilsoutheast, brazilus, canadacentral, canadaeast, centralindia, centralus, centraluseuap, eastasia, eastus, eastus2, eastus2euap, francecentral, francesouth, germanynorth, germanywestcentral, israelcentral, italynorth, japaneast, japanwest, jioindiacentral, jioindiawest, koreacentral, koreasouth, malaysiasouth, mexicocentral, newzealandnorth, northcentralus, northeurope, norwayeast, norwaywest, polandcentral, qatarcentral, southafricanorth, southafricawest, southcentralus, southeastasia, southindia, spaincentral, swedencentral, swedensouth, switzerlandnorth, switzerlandwest, uaecentral, uaenorth, uksouth, ukwest, westcentralus, westeurope, westindia, westus, westus2, westus3, australiaeastfoundational, austriaeast, chilecentral, eastusslv, indonesiacentral, israelnorthwest, malaysiawest, southcentralus2, southeastus, southeastus3, southwestus, usgovarizona, usgovtexas, usgovvirginia. | Optional |
| enable_ip_forwarding | Whether to enable IP forwarding for the network interface. Possible values are: true, false. | Optional |
| enable_accelerate_networking | Whether the network interface is configured for accelerated networking. Possible values are: true, false. | Optional |
| auxiliary_mode | The auxiliary mode of the Network Interface resource. Possible values are: MaxConnections, Floating, AcceleratedConnections. | Optional |
| auxiliary_sku | The auxiliary SKU of the Network Interface resource. Possible values are: A1, A2, A4, A8. | Optional |
| dns_servers | A comma-separated list of DNS server IP addresses for the network interface. | Optional |
| internal_dns_name_label | The internal DNS name label for the network interface. | Optional |
| network_security_group_name | The name of the network security group. | Optional |
| remove_network_security_group | Whether to remove the property networkSecurityGroup from the network interface. Possible values are: yes, no. Default is no. | Optional |
| nic_type | The type of Network Interface resource. Possible values are: Standard, Elastic. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.VirtualNetworks.NetworkInterfaces.id | String | The network interface ID. |
| Azure.VirtualNetworks.NetworkInterfaces.name | String | The network interface name. |
| Azure.VirtualNetworks.NetworkInterfaces.location | String | The Azure region where the network interface is deployed. |
| Azure.VirtualNetworks.NetworkInterfaces.etag | String | A unique read-only string that changes whenever the network interface resource is updated. |
| Azure.VirtualNetworks.NetworkInterfaces.type | String | The resource type. |
| Azure.VirtualNetworks.NetworkInterfaces.tags | Unknown | The resource tags. |
| Azure.VirtualNetworks.NetworkInterfaces.extendedLocation | Unknown | The extended location of the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.provisioningState | String | The current provisioning state of the network interface (e.g., Succeeded, Updating, Failed). |
| Azure.VirtualNetworks.NetworkInterfaces.properties.ipConfigurations | Unknown | The list of IP configurations for the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.dnsSettings | Unknown | The DNS configuration of the network interface, including DNS servers and domain name. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.macAddress | String | The MAC address of the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.enableIPForwarding | Boolean | Whether IP forwarding is enabled for the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.enableAcceleratedNetworking | Boolean | Whether accelerated networking is enabled for the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.networkSecurityGroup | Unknown | The network security group associated with the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.primary | Boolean | Whether this is a primary network interface on a virtual machine. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.virtualMachine | Unknown | The reference to a virtual machine. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.nicType | String | The type of network interface (Standard or Elastic). |
| Azure.VirtualNetworks.NetworkInterfaces.properties.auxiliaryMode | Unknown | The auxiliary mode of the Network Interface resource. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.auxiliarySku | Unknown | The auxiliary SKU of the Network Interface resource. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.defaultOutboundConnectivityEnabled | Boolean | Whether default outbound connectivity for nic was configured. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.disableTcpStateTracking | Boolean | Whether to disable TCP state tracking. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.dscpConfiguration | Unknown | A reference to the DSCP configuration to which the network interface is linked. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.hostedWorkloads | Unknown | A list of references to linked BareMetal resources. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.migrationPhase | Unknown | The migration phase of the Network Interface resource. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.privateEndpoint | Unknown | A reference to the private endpoint to which the network interface is linked. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.privateLinkService | Unknown | The privatelinkservice of the network interface resource. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.resourceGuid | String | The resource GUID property of the network interface resource. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.tapConfigurations | Unknown | A list of TapConfigurations of the network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.vnetEncryptionSupported | Boolean | Whether the virtual machine this nic is attached to supports encryption. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.workloadType | String | The workload type of the NetworkInterface for BareMetal resources. |
azure-vn-security-rule-delete
Delete a security rule. Required permissions: Microsoft.Network/networkSecurityGroups/securityRules/delete.
Base Command
azure-vn-security-rule-delete
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | Resource group name. | Required |
| security_group_name | The name of the security group. | Required |
| security_rule_name | The name of the rule to delete. | Required |
Context Output
There is no context output for this command.
azure-vn-security-rule-get
Get a specific rule. Required permissions: Microsoft.Network/networkSecurityGroups/securityRules/read.
Base Command
azure-vn-security-rule-get
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | Resource group name. | Required |
| security_group_name | The name of the security group. | Required |
| security_rule_name | The name of the rule to get. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.VirtualNetworks.SecurityRules.name | String | The rule’s name. |
| Azure.VirtualNetworks.SecurityRules.id | String | The rule’s ID. |
| Azure.VirtualNetworks.SecurityRules.location | String | The rule’s location. |
| Azure.VirtualNetworks.SecurityRules.etag | String | The rule’s ETag. |
| Azure.VirtualNetworks.SecurityRules.type | String | The rule’s type. |
| Azure.VirtualNetworks.SecurityRules.properties.provisioningState | String | The rule’s provisioning state. |
| Azure.VirtualNetworks.SecurityRules.properties.protocol | String | The protocol, which can be “TCP”, “UDP”, “ICMP”, or “*”. |
| Azure.VirtualNetworks.SecurityRules.properties.sourcePortRange | String | For a single port, the source port or a range of ports. For multiple ports, sourcePortRanges is used instead. |
| Azure.VirtualNetworks.SecurityRules.properties.sourcePortRanges | String | For multiple ports, a list of ports. For a single port, sourcePortRange is used instead. |
| Azure.VirtualNetworks.SecurityRules.properties.destinationPortRange | String | For a single port, the destination port or range of ports. For multiple ports, destinationPortRanges is used instead. |
| Azure.VirtualNetworks.SecurityRules.properties.destinationPortRanges | String | For multiple ports, a list of destination ports. For a single port, destinationPortRange is used instead. |
| Azure.VirtualNetworks.SecurityRules.properties.sourceAddressPrefix | String | The source address. |
| Azure.VirtualNetworks.SecurityRules.properties.destinationAddressPrefix | String | The destination address. |
| Azure.VirtualNetworks.SecurityRules.properties.access | String | The rule’s access. Can be “Allow” or “Deny”. |
| Azure.VirtualNetworks.SecurityRules.properties.priority | Number | The rule’s priority, ranging from 100 to 4096. |
| Azure.VirtualNetworks.SecurityRules.properties.direction | String | The rule’s direction, which can be “Inbound” or “Outbound”. |
azure-vn-security-rule-update
Update a security rule. If one does not exist, it will be created. Required permissions: Microsoft.Network/networkSecurityGroups/securityRules/read, Microsoft.Network/networkSecurityGroups/securityRules/write.
Base Command
azure-vn-security-rule-update
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The name of the resource group. | Required |
| security_group_name | The name of the security group. | Required |
| security_rule_name | The name of the rule to be updated. | Required |
| direction | The direction of the rule. Possible values are: Inbound, Outbound. | Optional |
| protocol | The protocol on which to apply the rule. Possible values are: Any, TCP, UDP, ICMP. | Optional |
| source | The source IP address range from which incoming traffic will be allowed or denied by this rule. Possible values are “Any”, an IP address range, an application security group, or a default tag. | Optional |
| priority | The priority by which the rules will be processed. The lower the number, the higher the priority. We recommend leaving gaps between rules - 100, 200, 300, etc. - so that it is easier to add new rules without having to edit existing rules. | Optional |
| source_ports | The source ports from which traffic is allowed or denied by this rule. Provide a single port, such as 80; a port range, such as 1024-65535; or a comma-separated list of single ports and/or port ranges, such as 80,1024-65535. Use an asterisk (*) to allow traffic on any port. | Optional |
| destination | The destination IP address range for outgoing traffic that is allowed or denied by this rule. The destination filter can be “Any”, an IP address range, an application security group, or a default tag. | Optional |
| destination_ports | The destination ports from which traffic is allowed or denied by this rule. Provide a single port, such as 80; a port range, such as 1024-65535; or a comma-separated list of single ports and/or port ranges, such as 80,1024-65535. Use an asterisk (*) to allow traffic on any port. | Optional |
| description | A description to add to the rule. | Optional |
| access | The network traffic is allowed or denied. Possible values are: Allow, Deny. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.VirtualNetworks.SecurityRules.name | String | The rule’s name. |
| Azure.VirtualNetworks.SecurityRules.id | String | The rule’s ID. |
| Azure.VirtualNetworks.SecurityRules.etag | String | The rule’s ETag. |
| Azure.VirtualNetworks.SecurityRules.type | String | The rule’s type. |
| Azure.VirtualNetworks.SecurityRules.properties.provisioningState | String | The rule’s provisioning state. |
| Azure.VirtualNetworks.SecurityRules.properties.protocol | String | The protocol, which can be “TCP”, “UDP”, “ICMP”, or “*”. |
| Azure.VirtualNetworks.SecurityRules.properties.sourcePortRange | String | For a single port, the source port or a range of ports. For multiple ports, sourcePortRanges is used instead. |
| Azure.VirtualNetworks.SecurityRules.properties.sourcePortRanges | String | For multiple ports, a list of ports. For a single port, sourcePortRange is used instead. |
| Azure.VirtualNetworks.SecurityRules.properties.destinationPortRange | String | For a single port, the destination port or range of ports. For multiple ports, destinationPortRanges is used instead. |
| Azure.VirtualNetworks.SecurityRules.properties.destinationPortRanges | String | For multiple ports, a list of destination ports. For a single port, destinationPortRange is used instead. |
| Azure.VirtualNetworks.SecurityRules.properties.sourceAddressPrefix | String | The source address. |
| Azure.VirtualNetworks.SecurityRules.properties.destinationAddressPrefix | String | The destination address. |
| Azure.VirtualNetworks.SecurityRules.properties.access | String | The rule’s access. Can be “Allow” or “Deny”. |
| Azure.VirtualNetworks.SecurityRules.properties.priority | Number | The rule’s priority, ranging from 100 to 4096. |
| Azure.VirtualNetworks.SecurityRules.properties.direction | String | The rule’s direction, which can be “Inbound” or “Outbound”. |
azure-vn-security-rules-list
Gets all security rules in a network security group. Required permissions: Microsoft.Network/networkSecurityGroups/securityRules/read.
Base Command
azure-vn-security-rules-list
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | Resource group name. | Required |
| network_security_group_name | The name of the network security group. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.VirtualNetworks.SecurityRules.name | String | The rule’s name. |
| Azure.VirtualNetworks.SecurityRules.id | String | The rule’s ID. |
| Azure.VirtualNetworks.SecurityRules.properties.provisioningState | String | The rule’s provisioning state. |
| Azure.VirtualNetworks.SecurityRules.properties.protocol | String | The protocol, which can be “TCP”, “UDP”, “ICMP”, or “*”. |
| Azure.VirtualNetworks.SecurityRules.properties.sourcePortRange | String | For a single port, the source port or a range of ports. |
| Azure.VirtualNetworks.SecurityRules.properties.destinationPortRange | String | For a single port, the destination port or range of ports. |
| Azure.VirtualNetworks.SecurityRules.properties.sourceAddressPrefix | String | The source address. |
| Azure.VirtualNetworks.SecurityRules.properties.destinationAddressPrefix | String | The destination address. |
| Azure.VirtualNetworks.SecurityRules.properties.access | String | The rule’s access. Can be “Allow” or “Deny”. |
| Azure.VirtualNetworks.SecurityRules.properties.priority | Number | The rule’s priority, ranging from 100 to 4096. |
| Azure.VirtualNetworks.SecurityRules.properties.direction | String | The rule’s direction, which can be “Inbound” or “Outbound”. |
Base Command
azure-vn-network-interface-get
Gets the properties of a given network interface. Required permissions: Microsoft.Network/networkInterfaces/read.
Base Command
azure-vn-network-interface-get
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group to which the network interface belongs. | Required |
| network_interface_name | The name of the network interface you want to view the details of. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.VirtualNetworks.NetworkInterfaces.properties.ipConfigurations | Unknown | The interface public IP address ID. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.macAddress | String | The interface MAC address. |
| Azure.VirtualNetworks.NetworkInterfaces.name | String | The interface name. |
| Azure.VirtualNetworks.NetworkInterfaces.location | String | The interface location. |
| Azure.VirtualNetworks.NetworkInterfaces.id | String | The interface ID. |
| Azure.VirtualNetworks.NetworkInterfaces.etag | String | A unique read-only string that changes whenever the network interface resource is updated. |
| Azure.VirtualNetworks.NetworkInterfaces.kind | String | The type of the network interface resource, used for Azure internal classification. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.tapConfigurations | String | The list of tap configurations attached to the network interface for traffic mirroring. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.allowPort25Out | String | Indicates whether outbound traffic on port 25 (SMTP) is allowed from this network interface. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.nicType | String | Specifies the type of network interface, such as Standard or Elastic. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.provisioningState | String | The current provisioning state of the network interface (e.g., Succeeded, Updating, Failed). |
| Azure.VirtualNetworks.NetworkInterfaces.properties.dnsSettings | String | The DNS configuration of the network interface, including DNS servers and domain name. |
| Azure.VirtualNetworks.NetworkInterfaces.properties.enableIPForwarding | String | Indicates whether IP forwarding is enabled for the network interface. |
azure-vn-public-ip-address-get
Gets the properties of a given public IP address. Permissions required: Microsoft.Network/publicIPAddresses/read.
Base Command
azure-vn-public-ip-address-get
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group to which the IP address belongs. | Required |
| address_name | The IP address name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.VirtualNetworks.PublicIPAddresses.name | String | The public IP address’s name. |
| Azure.VirtualNetworks.PublicIPAddresses.id | String | The public IP address’s ID. |
| Azure.VirtualNetworks.PublicIPAddresses.location | String | The location of the public IP address. |
| Azure.VirtualNetworks.PublicIPAddresses.sku | String | The public IP address’s SKU. |
| Azure.VirtualNetworks.PublicIPAddresses.type | String | The type of the public IP address. |
| Azure.VirtualNetworks.PublicIPAddresses.etag | String | The public IP address’s ETag. |
| Azure.VirtualNetworks.PublicIPAddresses.properties.provisioningState | String | The public IP address’s provisioning state. |
| Azure.VirtualNetworks.PublicIPAddresses.properties.publicIPAddressVersion | String | The public IP address’s version. |
| Azure.VirtualNetworks.PublicIPAddresses.properties.ipAddress | String | The public IP address’s IP address. |
| Azure.VirtualNetworks.PublicIPAddresses.properties.publicIPAllocationMethod | String | The public IP address’s allocation method. |
| Azure.VirtualNetworks.PublicIPAddresses.properties.resourceGuid | String | The public IP address’s resource GUID. |
| Azure.VirtualNetworks.PublicIPAddresses.sku.name | String | The public IP address’s SKU name. |
| Azure.VirtualNetworks.PublicIPAddresses.sku.tier | String | The public IP address’s SKU tier. |
| Azure.VirtualNetworks.PublicIPAddresses.properties.ipConfiguration | String | The reference to another IP configuration associated with this resource. |
azure-storage-blob-container-update
Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn’t already exist. Required permissions: Microsoft.Storage/storageAccounts/blobServices/containers/write.
Base Command
azure-storage-blob-container-update
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
| container_name | The container name. | Required |
| default_encryption_scope | Uses the specified encryption scope by default for all writes to the container. | Optional |
| deny_encryption_scope_override | Blocks overriding the container’s default encryption scope. Possible values are: true, false. | Optional |
| public_access | Specifies the access level. Possible values are: Blob, Container, None. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Storage.BlobContainers.id | String | Fully qualified resource ID for the resource. |
| Azure.Storage.BlobContainers.name | String | The name of the resource. |
| Azure.Storage.BlobContainers.type | String | The resource type. |
| Azure.Storage.BlobContainers.properties.metadata | String | A name-value pair to associate with the container as metadata. |
| Azure.Storage.BlobContainers.properties.publicAccess | String | Specifies whether data in the container may be accessed publicly and the access level. |
| Azure.Storage.BlobContainers.properties.hasImmutabilityPolicy | Boolean | The hasImmutabilityPolicy property is set to true by SRP if an ImmutabilityPolicy exists for this container, and false if it does not. |
| Azure.Storage.BlobContainers.properties.hasLegalHold | Boolean | The hasLegalHold property is set to true by SRP if at least one legal hold tag exists, and false if all tags are cleared. |
azure-storage-blob-create
Create a new Blob under the specified Container. Required permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write.
Base Command
azure-storage-blob-create
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
| container_name | The name of the Blob Container. | Required |
| file_entry_id | The entry ID of the file to upload as a new blob. Available from the war room while the context data contains file output. | Required |
| blob_name | The name of the Blob to create. Default is the file name. | Optional |
Context Output
There is no context output for this command.
azure-storage-blob-get
Retrieve a Blob from a Container. Required permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read.
Base Command
azure-storage-blob-get
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
| container_name | The name of the Blob Container. | Required |
| blob_name | The name of the Blob to retrieve. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| File.Size | String | The size of the file. |
| File.SHA1 | String | The SHA1 hash of the file. |
| File.SHA256 | String | The SHA256 hash of the file. |
| File.Name | String | The name of the file. |
| File.SSDeep | String | The SSDeep hash of the file. |
| File.EntryID | String | The entry ID of the file. |
| File.Info | String | File information. |
| File.Type | String | The file type. |
| File.MD5 | String | The MD5 hash of the file. |
| File.Extension | String | The file extension. |
azure-storage-blob-tag-set
Updates the tags for the specified Blob. The command can replace the entire tags of the Blob and can be used to remove tags. Required permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/write.
Base Command
azure-storage-blob-tag-set
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Blob Container. | Required |
| blob_name | The name of the blob. | Required |
| tags | Tags fields in JSON format: {“tag-name-1”: “tag-value-1”, “tag-name-2”: “tag-value-2”}. The tags fields may contain at most 10 tags. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
| append | Whether to append tags to the existing tags or not. Default is false. Possible values are: true, false. | Optional |
Context Output
There is no context output for this command.
azure-storage-blob-property-set
Set Blob properties. Required permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write.
Base Command
azure-storage-blob-property-set
Input
| Argument Name | Description | Required |
|---|---|---|
| container_name | The name of the Blob Container. | Required |
| blob_name | The name of the blob. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
| content_type | Blob content type. Indicates the media type of the blob. | Optional |
| content_md5 | Blob MD5 hash value. Can be used by the client to check for content integrity. | Optional |
| content_encoding | Blob content encoding. Used to specify the compression algorithm of the blob content. Possible values are: identity, gzip, deflate, br, compress, zstd, aes128gcm, dcb, dcz, exi, pack200-gzip, x-compress, x-gzip. | Optional |
| content_language | Blob content language. Describes the human languages of the blob content. | Optional |
| content_disposition | Blob content disposition. Conveys additional information about how to process the response payload, and also can be used to attach additional metadata. | Optional |
| cache_control | Modifies the cache control string for the blob. Indicates directives for caching in both requests and responses. | Optional |
| request_id | Request ID generated by the client and recorded in the analytics logs when storage analytics logging is enabled. | Optional |
| lease_id | Required if the blob has an active lease. | Optional |
Context Output
There is no context output for this command.
azure-appservice-webapp-config-update
Updates the configuration settings of an existing Azure Web App. Required permissions: Microsoft.Web/sites/config/write, Microsoft.Web/sites/config/read.
Base Command
azure-appservice-webapp-config-update
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| name | Name of the Web App. | Required |
| http20_enabled | Configures a web site to allow clients to connect over http2.0. Possible values are: true, false. | Optional |
| remote_debugging_enabled | True if remote debugging is enabled; otherwise, false. Possible values are: true, false. | Optional |
| min_tls_version | Configures the minimum version of TLS required for SSL requests. Possible values are: 1.0, 1.1, 1.2, 1.3. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.AppService.WebAppConfiguration.id | String | Resource ID. |
| Azure.AppService.WebAppConfiguration.name | String | Resource name. |
| Azure.AppService.WebAppConfiguration.type | String | Resource type. |
| Azure.AppService.WebAppConfiguration.location | String | Resource location. |
| Azure.AppService.WebAppConfiguration.properties.numberOfWorkers | Number | Number of workers. |
| Azure.AppService.WebAppConfiguration.properties.defaultDocuments | Unknown | List of default documents. |
| Azure.AppService.WebAppConfiguration.properties.netFrameworkVersion | String | .NET Framework version. |
| Azure.AppService.WebAppConfiguration.properties.phpVersion | String | PHP version. |
| Azure.AppService.WebAppConfiguration.properties.pythonVersion | String | Python version. |
| Azure.AppService.WebAppConfiguration.properties.nodeVersion | String | Node.js version. |
| Azure.AppService.WebAppConfiguration.properties.powerShellVersion | String | PowerShell version. |
| Azure.AppService.WebAppConfiguration.properties.linuxFxVersion | String | Linux app framework and version. |
| Azure.AppService.WebAppConfiguration.properties.windowsFxVersion | String | Windows container image name. |
| Azure.AppService.WebAppConfiguration.properties.requestTracingEnabled | Boolean | Indicates whether request tracing is enabled. |
| Azure.AppService.WebAppConfiguration.properties.remoteDebuggingEnabled | Boolean | Indicates whether remote debugging is enabled. |
| Azure.AppService.WebAppConfiguration.properties.remoteDebuggingVersion | String | Remote debugging version. |
| Azure.AppService.WebAppConfiguration.properties.http20Enabled | Boolean | Indicates whether HTTP/2 is enabled. |
| Azure.AppService.WebAppConfiguration.properties.minTlsVersion | String | Minimum TLS version required. |
| Azure.AppService.WebAppConfiguration.properties.ftpsState | String | State of FTP / FTPS service. |
| Azure.AppService.WebAppConfiguration.properties.webSocketsEnabled | Boolean | Indicates whether WebSockets are enabled. |
| Azure.AppService.WebAppConfiguration.properties.alwaysOn | Boolean | Indicates whether Always On is enabled. |
| Azure.AppService.WebAppConfiguration.properties.managedPipelineMode | String | Managed pipeline mode. |
| Azure.AppService.WebAppConfiguration.properties.loadBalancing | String | Site load balancing mode. |
| Azure.AppService.WebAppConfiguration.properties.autoHealEnabled | Boolean | Indicates whether Auto Heal is enabled. |
| Azure.AppService.WebAppConfiguration.properties.autoHealRules | Unknown | Auto Heal rules configuration. |
| Azure.AppService.WebAppConfiguration.properties.cors | Unknown | Cross-Origin Resource Sharing (CORS) settings. |
| Azure.AppService.WebAppConfiguration.properties.apiDefinition.url | String | URL of the API definition. |
| Azure.AppService.WebAppConfiguration.properties.apiManagementConfig.id | String | Azure API management integration ID. |
azure-appservice-webapp-auth-settings-update
Updates the authentication and authorization settings of an existing Azure Web App. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
Base Command
azure-appservice-webapp-auth-settings-update
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| name | Name of the Web App. | Required |
| enabled | True if the Authentication / Authorization feature is enabled for the current app; otherwise, false. Possible values are: true, false. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.AppService.WebAppAuthSettings.id | String | Resource ID. |
| Azure.AppService.WebAppAuthSettings.name | String | Resource Name. |
| Azure.AppService.WebAppAuthSettings.type | String | Resource type. |
| Azure.AppService.WebAppAuthSettings.properties.enabled | Boolean | Indicates whether Authentication/Authorization is enabled for the app. |
| Azure.AppService.WebAppAuthSettings.properties.runtimeVersion | String | The RuntimeVersion of the Authentication/Authorization feature. |
| Azure.AppService.WebAppAuthSettings.properties.unauthenticatedClientAction | String | The action to take when an unauthenticated client attempts to access the app. |
| Azure.AppService.WebAppAuthSettings.properties.tokenStoreEnabled | Boolean | Indicates whether the Azure App Service Authentication platform’s token store is enabled. |
| Azure.AppService.WebAppAuthSettings.properties.allowedExternalRedirectUrls | Unknown | External URLs that are allowed to be redirected to as part of logging in or logging out of the app. |
| Azure.AppService.WebAppAuthSettings.properties.defaultProvider | String | The default authentication provider to use when multiple providers are configured. |
| Azure.AppService.WebAppAuthSettings.properties.clientId | String | The Client ID of the app used for AAD login. |
| Azure.AppService.WebAppAuthSettings.properties.clientSecret | String | The client secret associated with the AAD app. |
| Azure.AppService.WebAppAuthSettings.properties.clientSecretSettingName | String | The app setting that contains the client secret. |
| Azure.AppService.WebAppAuthSettings.properties.issuer | String | The OpenID Connect Issuer URI that represents the entity that issues access tokens. |
| Azure.AppService.WebAppAuthSettings.properties.allowedAudiences | Unknown | The list of audiences that can receive the authentication tokens. |
| Azure.AppService.WebAppAuthSettings.properties.additionalLoginParams | Unknown | Additional parameters to send to the authentication provider. |
| Azure.AppService.WebAppAuthSettings.properties.isAadAutoProvisioned | Boolean | True if AAD is auto-provisioned; otherwise false. |
| Azure.AppService.WebAppAuthSettings.properties.googleClientId | String | The Client ID of the app used for Google login. |
| Azure.AppService.WebAppAuthSettings.properties.googleClientSecret | String | The client secret associated with the Google app. |
| Azure.AppService.WebAppAuthSettings.properties.googleClientSecretSettingName | String | The app setting that contains the client secret. |
| Azure.AppService.WebAppAuthSettings.properties.facebookAppId | String | The App ID of the Facebook app used for login. |
| Azure.AppService.WebAppAuthSettings.properties.facebookAppSecret | String | The app secret associated with the Facebook app. |
| Azure.AppService.WebAppAuthSettings.properties.facebookAppSecretSettingName | String | The app setting that contains the Facebook app secret. |
| Azure.AppService.WebAppAuthSettings.properties.twitterConsumerKey | String | The OAuth 1.0a consumer key of the Twitter application used for login. |
| Azure.AppService.WebAppAuthSettings.properties.twitterConsumerSecret | String | The consumer secret associated with the Twitter application. |
| Azure.AppService.WebAppAuthSettings.properties.twitterConsumerSecretSettingName | String | The app setting that contains the Twitter consumer secret. |
| Azure.AppService.WebAppAuthSettings.properties.microsoftAccountClientId | String | The OAuth 2.0 client ID for the Microsoft account provider. |
| Azure.AppService.WebAppAuthSettings.properties.microsoftAccountClientSecret | String | The client secret for the Microsoft account provider. |
| Azure.AppService.WebAppAuthSettings.properties.microsoftAccountClientSecretSettingName | String | The app setting that contains the Microsoft account client secret. |
| Azure.AppService.WebAppAuthSettings.properties.appleClientId | String | The client ID for the Apple provider. |
| Azure.AppService.WebAppAuthSettings.properties.appleClientSecret | String | The client secret for the Apple provider. |
| Azure.AppService.WebAppAuthSettings.properties.appleClientSecretSettingName | String | The app setting that contains the Apple provider client secret. |
| Azure.AppService.WebAppAuthSettings.properties.authFilePath | String | The path to the authentication configuration file. |
azure-compute-disk-update
Updates a disk. Required permissions: Microsoft.Compute/disks/read, Microsoft.Compute/disks/write.
Base Command
azure-compute-disk-update
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| disk_name | The name of the managed disk that is being created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. | Required |
| public_network_access | Policy for controlling export on the disk. Possible values are: Disabled, Enabled. | Optional |
| network_access_policy | Policy for accessing the disk via network. Possible values are: AllowAll, AllowPrivate, DenyAll. | Optional |
| data_access_auth_mode | Additional authentication requirements when exporting or uploading to a disk or snapshot. Possible values are: AzureActiveDirectory. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Compute.Disks.id | String | Resource ID of the disk. |
| Azure.Compute.Disks.name | String | Name of the disk. |
| Azure.Compute.Disks.type | String | Type of the resource. |
| Azure.Compute.Disks.location | String | Location of the disk. |
| Azure.Compute.Disks.tags | Unknown | Resource tags. |
| Azure.Compute.Disks.managedBy | String | ARM ID of the resource that manages the disk. |
| Azure.Compute.Disks.sku | unknown | The disk SKU name. |
| Azure.Compute.Disks.zones | unknown | A list of availability zones. |
| Azure.Compute.Disks.properties.timeCreated | String | The time when the disk was created. |
| Azure.Compute.Disks.properties.diskSizeGB | Number | Size of the disk in GB. |
| Azure.Compute.Disks.properties.diskIopsReadWrite | Number | The number of IOPS allowed for this disk. |
| Azure.Compute.Disks.properties.diskMBpsReadWrite | Number | The bandwidth allowed for this disk in MBps. |
| Azure.Compute.Disks.properties.diskIOPSReadOnly | Number | The number of read-only IOPS for this disk. |
| Azure.Compute.Disks.properties.diskMBpsReadOnly | Number | The read-only bandwidth for this disk in MBps. |
| Azure.Compute.Disks.properties.diskSizeBytes | Number | The size of the disk in bytes. |
| Azure.Compute.Disks.properties.networkAccessPolicy | String | Policy for accessing the disk via network. |
| Azure.Compute.Disks.properties.publicNetworkAccess | String | Policy for export on the disk. |
| Azure.Compute.Disks.properties.burstingEnabled | Boolean | Whether bursting is enabled on the disk. |
| Azure.Compute.Disks.properties.optimization | String | The disk optimization setting. |
| Azure.Compute.Disks.properties.diskState | String | The current state of the disk. |
| Azure.Compute.Disks.properties.supportedCapabilities | unknown | Supported capabilities of the disk. |
| Azure.Compute.Disks.properties.supportedPerformanceTiers | unknown | Supported performance tiers of the disk. |
| Azure.Compute.Disks.properties.supportedDiskTypes | unknown | Supported disk types for the disk. |
| Azure.Compute.Disks.properties.provisioningState | unknown | The provisioning state of the disk. |
| Azure.Compute.Disks.properties.timeModified | unknown | The time when the disk was last modified. |
| Azure.Compute.Disks.properties.diskAccessId | String | The ARM ID of the DiskAccess resource. |
| Azure.Compute.Disks.properties.networkProfile | unknown | The network profile of the disk. |
| Azure.Compute.Disks.properties.creationData | unknown | Disk creation data. |
| Azure.Compute.Disks.properties.encryption | unknown | Encryption settings for the disk. |
| Azure.Compute.Disks.properties.encryptionSettingsCollection | unknown | A collection of encryption settings. |
| Azure.Compute.Disks.properties.encryptionType | String | The type of key used to encrypt the data on the disk. |
| Azure.Compute.Disks.properties.securityProfile | unknown | Security profile for the disk. |
| Azure.Compute.Disks.properties.tieringProfile | unknown | Tiering profile for the disk. |
| Azure.Compute.Disks.properties.supportedTierList | unknown | List of supported tiers for the disk. |
| Azure.Compute.Disks.properties.availabilityZone | String | Availability zone of the disk. |
| Azure.Compute.Disks.properties.dataAccessAuthMode | String | Additional authentication requirements when exporting or uploading to a disk. |
| Azure.Compute.Disks.properties.osType | String | The operating system type. |
| Azure.Compute.Disks.properties.hyperVGeneration | String | The HyperVGenerationType of the virtual machine. |
| Azure.Compute.Disks.properties.lastOwnershipUpdateTime | String | The last time ownership of the disk was updated. |
azure-appservice-webapp-update
Updates an Azure Web App. The required permissions are: Microsoft.Web/sites/read, Microsoft.Web/sites/write.
Base Command
azure-appservice-webapp-update
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| name | Name of the Web App. | Required |
| identity_type | Managed service identity type. Possible values are: None, SystemAssigned. | Optional |
| https_only | Configures the web site to accept only https requests. Possible values are: true, false. | Optional |
| client_cert_enabled | Whether client certificates are enabled. Possible values are: true, false. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.AppService.WebApp.id | String | Fully qualified resource ID for the web app. |
| Azure.AppService.WebApp.name | String | The name of the web app. |
| Azure.AppService.WebApp.type | String | The resource type, e.g., Microsoft.Web/sites. |
| Azure.AppService.WebApp.location | String | Geographic location of the web app. |
| Azure.AppService.WebApp.kind | String | The kind of the app, e.g., app, functionapp, etc. |
| Azure.AppService.WebApp.tags | Unknown | Resource tags as key-value pairs. |
| Azure.AppService.WebApp.identity.type | String | The type of managed identity (SystemAssigned, UserAssigned, etc.). |
| Azure.AppService.WebApp.identity.principalId | String | The principal ID of the system-assigned identity. |
| Azure.AppService.WebApp.identity.tenantId | String | The tenant ID of the system-assigned identity. |
| Azure.AppService.WebApp.identity.userAssignedIdentities | Unknown | The list of user-assigned identities associated with the web app. |
| Azure.AppService.WebApp.properties.state | String | Current state of the web app (Running, Stopped, etc.). |
| Azure.AppService.WebApp.properties.enabled | Boolean | Whether the web app is enabled. |
| Azure.AppService.WebApp.properties.defaultHostName | String | Default host name of the web app. |
| Azure.AppService.WebApp.properties.hostNames | String | List of host names associated with the web app. |
| Azure.AppService.WebApp.properties.repositorySiteName | String | Name of the repository site. |
| Azure.AppService.WebApp.properties.clientAffinityEnabled | Boolean | Whether client affinity is enabled. |
| Azure.AppService.WebApp.properties.clientCertEnabled | Boolean | Whether client certificates are enabled. |
| Azure.AppService.WebApp.properties.clientCertExclusionPaths | String | Paths to exclude from client certificate authentication. |
| Azure.AppService.WebApp.properties.hostingEnvironment | String | App Service Environment to use for the web app. |
| Azure.AppService.WebApp.properties.serverFarmId | String | Resource ID of the associated App Service plan. |
| Azure.AppService.WebApp.properties.reserved | Boolean | Whether the web app is on a Linux plan. |
| Azure.AppService.WebApp.properties.isXenon | Boolean | Whether the web app is hosted in Xenon. |
| Azure.AppService.WebApp.properties.hyperV | Boolean | Whether Hyper-V is enabled for the web app. |
| Azure.AppService.WebApp.properties.siteConfig | Unknown | Configuration of the app. |
azure-cr-registry-update
Updates a container registry. Required permissions: Microsoft.ContainerRegistry/registries/read, Microsoft.ContainerRegistry/registries/write.
Base Command
azure-cr-registry-update
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| registry_name | The name of the container registry. | Required |
| allow_exports | Whether artifacts can be exported. Possible values are: disabled, enabled. | Optional |
| public_network_access | Whether public network access is allowed for the container registry. Possible values are: disabled, enabled. | Optional |
| anonymous_pull_enabled | Whether to enable registry-wide pulls from unauthenticated clients. Possible values are: true, false. | Optional |
| authentication_as_arm_policy | Whether the policy is enabled or not. Possible values are: disabled, enabled. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.ContainerRegistry.Registries.id | String | The resource ID. |
| Azure.ContainerRegistry.Registries.identity | Unknown | The identity of the container registry. |
| Azure.ContainerRegistry.Registries.location | String | The location of the resource. |
| Azure.ContainerRegistry.Registries.name | String | The name of the resource. |
| Azure.ContainerRegistry.Registries.properties.adminUserEnabled | Boolean | The value that indicates whether the admin user is enabled. |
| Azure.ContainerRegistry.Registries.properties.anonymousPullEnabled | Boolean | Enables registry-wide pull from unauthenticated clients. |
| Azure.ContainerRegistry.Registries.properties.creationDate | String | The creation date of the container registry in ISO8601 format. |
| Azure.ContainerRegistry.Registries.properties.dataEndpointEnabled | Boolean | Enable a single data endpoint per region for serving data. |
| Azure.ContainerRegistry.Registries.properties.dataEndpointHostNames | Unknown | List of host names that will serve data when dataEndpointEnabled is true. |
| Azure.ContainerRegistry.Registries.properties.encryption | Unknown | The encryption settings of container registry. |
| Azure.ContainerRegistry.Registries.properties.loginServer | String | The URL that can be used to log into the container registry. |
| Azure.ContainerRegistry.Registries.properties.networkRuleBypassOptions | String | Whether to allow trusted Azure services to access a network restricted registry. |
| Azure.ContainerRegistry.Registries.properties.networkRuleSet | Unknown | The network rule set for a container registry. |
| Azure.ContainerRegistry.Registries.properties.policies | Unknown | The policies for a container registry. |
| Azure.ContainerRegistry.Registries.properties.privateEndpointConnections | Unknown | List of private endpoint connections for a container registry. |
| Azure.ContainerRegistry.Registries.properties.provisioningState | String | The provisioning state of the container registry at the time the operation was called. |
| Azure.ContainerRegistry.Registries.properties.publicNetworkAccess | String | Whether or not public network access is allowed for the container registry. |
| Azure.ContainerRegistry.Registries.properties.status | Unknown | The status of the container registry at the time the operation was called. |
| Azure.ContainerRegistry.Registries.properties.zoneRedundancy | String | Whether or not zone redundancy is enabled for this container registry. |
| Azure.ContainerRegistry.Registries.sku | Unknown | The SKU of the container registry. |
| Azure.ContainerRegistry.Registries.systemData | Unknown | Metadata pertaining to creation and last modification of the resource. |
| Azure.ContainerRegistry.Registries.tags | Unknown | The tags of the resource. |
| Azure.ContainerRegistry.Registries.type | String | The type of the resource. |
azure-storage-blob-service-property-get
Run this command to get the blob service properties of a specific account storage. Required permissions: Microsoft.Storage/storageAccounts/blobServices/read.
Base Command
azure-storage-blob-service-property-get
Input
| Argument Name | Description | Required |
|---|---|---|
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| resource_group_name | The resource group name. | Required |
| account_name | The storage account name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Storage.BlobServices.id | String | Fully qualified resource ID for the resource. |
| Azure.Storage.BlobServices.name | String | The name of the resource. |
| Azure.Storage.BlobServices.type | String | The resource type. |
| Azure.Storage.BlobServices.properties.lastAccessTimeTrackingPolicy | Unknown | The blob service property to configure last access time based tracking policy. |
| Azure.Storage.BlobServices.properties.changeFeed | Unknown | The blob service properties for change feed events. |
| Azure.Storage.BlobServices.properties.containerDeleteRetentionPolicy | Unknown | The blob service properties for container soft delete. |
| Azure.Storage.BlobServices.properties.cors | Unknown | The CORS rules for the Blob service. |
| Azure.Storage.BlobServices.properties.defaultServiceVersion | String | The default version to use for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions. |
| Azure.Storage.BlobServices.properties.deleteRetentionPolicy | Unknown | The blob service properties for blob soft delete. |
| Azure.Storage.BlobServices.properties.isVersioningEnabled | Boolean | Whether versioning is enabled. |
| Azure.Storage.BlobServices.properties.restorePolicy | Unknown | The blob service properties for blob restore policy. |
| Azure.Storage.BlobServices.sku.name | String | The SKU name. |
| Azure.Storage.BlobServices.sku.tier | String | The SKU tier. |
azure-storage-blob-service-property-set
Sets properties for the blob service in a specific account storage. Required permissions: Microsoft.Storage/storageAccounts/blobServices/read, Microsoft.Storage/storageAccounts/blobServices/write.
Base Command
azure-storage-blob-service-property-set
Input
| Argument Name | Description | Required |
|---|---|---|
| resource_group_name | The resource group name. | Required |
| subscription_id | The Azure subscription ID. Required for Cortex Platform (which includes Cortex XSIAM version >=3.0 and Cortex Cloud). Optional for Cortex XSOAR and Cortex XSIAM version < 3.0, where it can be retrieved from the integration configuration. | Optional |
| account_name | The name of the storage account. | Required |
| delete_retention_policy_enabled | Whether DeleteRetentionPolicy is enabled. Possible values are: true, false. | Optional |
| delete_retention_policy_days | The number of days the deleted item should be retained. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Azure.Storage.BlobServices.id | String | The resource ID. |
| Azure.Storage.BlobServices.name | String | The name of the resource. |
| Azure.Storage.BlobServices.type | String | The type of the resource. |
| Azure.Storage.BlobServices.properties.cors | Unknown | The CORS rules for the Blob service. |
| Azure.Storage.BlobServices.properties.defaultServiceVersion | String | The default version to use for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions. |
| Azure.Storage.BlobServices.properties.deleteRetentionPolicy | Unknown | The service properties for soft delete. |
| Azure.Storage.BlobServices.properties.isVersioningEnabled | Boolean | Whether versioning is enabled. |
| Azure.Storage.BlobServices.properties.changeFeed | Unknown | The blob service properties for change feed events. |
| Azure.Storage.BlobServices.properties.containerDeleteRetentionPolicy | Unknown | The blob service properties for container soft delete. |
| Azure.Storage.BlobServices.properties.lastAccessTimeTrackingPolicy | Unknown | The blob service property to configure last access time based tracking policy. |
| Azure.Storage.BlobServices.properties.restorePolicy | Unknown | The blob service properties for blob restore policy. |
| Azure.Storage.BlobServices.sku.name | String | The SKU name. |
| Azure.Storage.BlobServices.sku.tier | String | The SKU tier. |
azure-auth-test
Tests the connectivity to Azure. Relevant for the Device Code and Authorization Code authentication flows (used instead of the Test button for these interactive flows).
Base Command
azure-auth-test
Input
There are no input arguments for this command.
Context Output
There is no context output for this command.
azure-generate-login-url
Generates the login URL used for authorization. Relevant only for the Authorization Code authentication flow.
Base Command
azure-generate-login-url
Input
There are no input arguments for this command.
Context Output
There is no context output for this command.
azure-auth-complete
Completes the authorization process for the Device Code flow. Should be used after running the azure-auth-start command.
Base Command
azure-auth-complete
Input
There are no input arguments for this command.
Context Output
There is no context output for this command.
azure-auth-reset
Resets the authentication process. Relevant for the Device Code and Authorization Code authentication flows.
Base Command
azure-auth-reset
Input
There are no input arguments for this command.
Context Output
There is no context output for this command.
azure-auth-start
Starts the authorization process for the Device Code / Authorization Code flows. Follow the instructions in the command results.
Base Command
azure-auth-start
Input
There are no input arguments for this command.
Context Output
There is no context output for this command.
Configuration parameters
app_id— Application IDsubscription_id— Default Subscription ID (required)resource_group_name— Default Resource Group Nameazure_ad_endpoint— Azure AD endpointauth_type— Authentication Typeinsecure— Trust any certificate (not secure)proxy— Use system proxy settingstenant_id— Tenant IDcredentials— Client Secretredirect_uri— Application redirect URIauth_code— Authorization codemanaged_identities_client_id— Azure Managed Identities Client ID
Commands (131)
-
azure-acr-disable-anonymous-pull-quick-actionDeprecatedDisables anonymous pull access for the Azure Container Registry (ACR), requiring clients to authenticate before pulling images. Deprecated. Use Disable Anonymous Pull for ACR instead. Required permissions: Microsoft.ContainerRegistry/registries/read, Microsoft.ContainerRegistry/registries/write.
-
azure-acr-disable-authentication-as-arm-quick-actionDeprecatedDisables the legacy 'authentication as ARM' feature for the Azure Container Registry (ACR). Deprecated. Use Disable ACR ARM Authentication instead. Required permissions: Microsoft.ContainerRegistry/registries/read, Microsoft.ContainerRegistry/registries/write.
-
azure-acr-disable-public-private-access-quick-actionDeprecatedDisables public network access and content exports for the Azure Container Registry (ACR) to enhance security. Deprecated. Use Disable Public Access & Exports on ACR instead. Required permissions: Microsoft.ContainerRegistry/registries/read, Microsoft.ContainerRegistry/registries/write.
-
azure-acr-updateDeprecatedUpdates a container registry. Deprecated. Use the azure-cr-registry-update command instead. Required permissions: Microsoft.ContainerRegistry/registries/read, Microsoft.ContainerRegistry/registries/write.
-
azure-appservice-webapp-auth-settings-updateUpdates the authentication and authorization settings of an existing Azure Web App. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-appservice-webapp-auth-settings-update-quick-actionEnables App Service Authentication for the web app. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-appservice-webapp-config-disable-remote-debugging-quick-actionDisables remote debugging for the web app to reduce the risk of unauthorized code access. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-appservice-webapp-config-updateUpdates the configuration settings of an existing Azure Web App. Required permissions: Microsoft.Web/sites/config/write, Microsoft.Web/sites/config/read.
-
azure-appservice-webapp-config-update-http2-quick-actionEnables HTTP 2.0 for the web app. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-appservice-webapp-config-update-min-tls-version-quick-actionSets the web app's minimum accepted TLS version to 1.2 to enhance security. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-appservice-webapp-updateUpdates an Azure Web App. The required permissions are: Microsoft.Web/sites/read, Microsoft.Web/sites/write.
-
azure-appservice-webapp-update-quick-actionAssigns a system-assigned managed identity to the web app, enabling secure access to other Azure services without managing credentials. Required permissions: Microsoft.Web/sites/read, Microsoft.Web/sites/write.
-
azure-auth-completeCompletes the authorization process for the Device Code flow. Should be used after running the azure-auth-start command.
-
azure-auth-resetResets the authentication process. Relevant for the Device Code and Authorization Code authentication flows.
-
azure-auth-startStarts the authorization process for the Device Code / Authorization Code flows. Follow the instructions in the command results.
-
azure-auth-testTests the connectivity to Azure. Relevant for the Device Code and Authorization Code authentication flows (used instead of the Test button for these interactive flows).
-
azure-billing-budgets-listLists configured budgets at the subscription or resource group level. Required permission: Microsoft.Consumption/budgets/read.
-
azure-billing-forecast-listReturns cost forecast for a subscription over a given time range. Required permission: Microsoft.CostManagement/forecast/read.
-
azure-billing-usage-listReturns actual usage and cost details for a given time period, optionally filtered by service name. Required permission: Microsoft.Consumption/usageDetails/read.
-
azure-compute-disk-updateUpdates a disk. Required permissions: Microsoft.Compute/disks/read, Microsoft.Compute/disks/write.
-
azure-compute-disk-update-data-access-ad-quick-actionSets the data access authentication mode for the managed disk to Azure Active Directory. Required permissions: Microsoft.Compute/disks/read, Microsoft.Compute/disks/write.
-
azure-compute-vm-getGets the properties of a given virtual machine. Required Permissions: Microsoft.Compute/virtualMachines/read.
-
azure-compute-vm-listLists all the virtual machines in the specified subscription. Use the next_token argument to view the next page of results. Required Permissions: Microsoft.Compute/virtualMachines/read.
-
azure-compute-vm-power-offPowers off a given virtual machine. Required Permissions: Microsoft.Compute/virtualMachines/poweroff/action.
-
azure-compute-vm-startPowers on a given virtual machine. Required Permissions: Microsoft.Compute/virtualMachines/start/action.
-
azure-cosmos-db-disable-key-quick-actionDisables key-based write access for Cosmos DB metadata to enhance security.
-
azure-cosmos-db-updateDeprecatedUpdates the properties of an existing Azure Cosmos DB database account. Deprecated. Use the azure-cosmosdb-db-account-update command instead. Required permissions: Microsoft.DocumentDB/databaseAccounts/read, Microsoft.DocumentDB/databaseAccounts/write.
-
azure-cosmosdb-db-account-updateUpdates the properties of an existing Azure Cosmos DB database account. The required permissions are: Microsoft.DocumentDB/databaseAccounts/read, Microsoft.DocumentDB/databaseAccounts/write.
-
azure-cr-disable-anonymous-pull-quick-actionDisables anonymous pull access for the Azure Container Registry (ACR), requiring clients to authenticate before pulling images. Required permissions: Microsoft.ContainerRegistry/registries/read, Microsoft.ContainerRegistry/registries/write.
-
azure-cr-disable-authentication-as-arm-quick-actionDisables the legacy 'authentication as ARM' feature for the Azure Container Registry (ACR). Required permissions: Microsoft.ContainerRegistry/registries/read, Microsoft.ContainerRegistry/registries/write.
-
azure-cr-disable-public-private-access-quick-actionDisables public network access and content exports for the Azure Container Registry (ACR) to enhance security.
-
azure-cr-registry-updateUpdates a container registry. Required permissions: Microsoft.ContainerRegistry/registries/read, Microsoft.ContainerRegistry/registries/write.
-
azure-disable-public-n-private-access-vm-disk-quick-actionDisables all public and private network access for the managed disk. Required permissions: Microsoft.Compute/disks/read, Microsoft.Compute/disks/write.
-
azure-disable-public-private-access-vm-disk-quick-actionDeprecatedDisables all public and private network access for a managed disk. Deprecated. Use Disable Public and Private Access to VM Disk instead. Required permissions: Microsoft.Compute/disks/read, Microsoft.Compute/disks/write.
-
azure-disk-set-data-access-ad-quick-actionDeprecatedSets the data access authentication mode for the managed disk to Azure Active Directory. Deprecated. Use Set Disk Data Access to Azure AD instead. Required permissions: Microsoft.Compute/disks/read, Microsoft.Compute/disks/write.
-
azure-disk-updateDeprecatedUpdates a disk. Deprecated. Use the azure-compute-disk-update command instead. Required permissions: Microsoft.Compute/disks/read, Microsoft.Compute/disks/write.
-
azure-function-app-set-min-tls-version-quick-actionDeprecatedSets the Function App's minimum accepted TLS version to 1.2 to enhance security. Deprecated. Use Set Web App Minimum TLS Version instead. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-generate-login-urlGenerates the login URL used for authorization. Relevant only for the Authorization Code authentication flow.
-
azure-key-vault-purge-and-soft-delete-enable-quick-actionEnables soft delete and purge protection for the Key Vault to prevent the permanent loss of keys and secrets. Note: Once purge-protection and soft-delete is enabled for a key vault, the action is irreversible.
-
azure-key-vault-updateDeprecatedUpdates a key vault in a specific subscription. Deprecated. Use the azure-keyvault-vault-update command instead. Required permissions: Microsoft.KeyVault/vaults/read, Microsoft.KeyVault/vaults/write.
-
azure-keyvault-vault-updateUpdates a key vault in the specified subscription. The required permissions are: Microsoft.KeyVault/vaults/read, Microsoft.KeyVault/vaults/write.
-
azure-monitor-log-profile-updateUpdates a log profile in Azure Monitoring REST API. Required permissions: Microsoft.Insights/logprofiles/read, Microsoft.Insights/logprofiles/write.
-
azure-monitor-log-retention-period-quick-actionSets the log profile’s retention policy to 365 days and enables it across all supported locations. Required permissions: Microsoft.Insights/logprofiles/read, Microsoft.Insights/logprofiles/write.
-
azure-mysql-flexible-server-param-setUpdates a server configuration. Required permissions: Microsoft.DBforMySQL/flexibleServers/configurations/read, Microsoft.DBforMySQL/flexibleServers/configurations/write.
-
azure-mysql-set-secure-transport-quick-actionEnforces secure transport (SSL/TLS) for connections to the MySQL Flexible Server. Required permissions: Microsoft.DBforMySQL/flexibleServers/configurations/read, Microsoft.DBforMySQL/flexibleServers/configurations/write.
-
azure-network-disable-storage-account-access-quick-actionSets the storage account’s default network action to Deny. Only explicitly allowed IPs, subnets, or trusted Azure services will have access. Required permissions: Microsoft.Storage/storageAccounts/read, Microsoft.Storage/storageAccounts/write.
-
azure-nsg-network-interfaces-listDeprecatedGets network interfaces in a resource group. The command is deprecated, please use azure-vn-network-interfaces-list.
-
azure-nsg-public-ip-addresses-listDeprecatedGets public IP addresses in a resource group. The command is deprecated, please use azure-vn-public-ip-addresses-list.
-
azure-nsg-resource-group-listDeprecatedGets all resource groups for a subscription. The command is deprecated, please use azure-rm-resource-groups-list.
-
azure-nsg-security-groups-listDeprecatedLists all network security groups. Deprecated. Use the azure-vn-security-groups-list command instead. Required permission: Microsoft.Network/networkSecurityGroups/read.
-
azure-nsg-security-rule-createDeprecatedCreates a security rule. Deprecated. Use the azure-vn-security-rule-create command instead. Required permissions: Microsoft.Network/networkSecurityGroups/securityRules/read, Microsoft.Network/networkSecurityGroups/securityRules/write.
-
azure-nsg-security-rule-deleteDeprecatedDelete a security rule. The command is deprecated, please use azure-vn-security-rule-delete.
-
azure-nsg-security-rule-delete-quick-actionDeletes a network security group (NSG) rule. Required permission: Microsoft.Network/networkSecurityGroups/securityRules/delete.
-
azure-nsg-security-rule-getDeprecatedRetrieves a specific rule. Deprecated. Use the azure-vn-security-rule-get command instead. Required permission: Microsoft.Network/networkSecurityGroups/securityRules/read.
-
azure-nsg-security-rule-updateDeprecatedUpdates a security rule or creates one if it does not exist. Deprecated. Use the azure-vn-security-rule-update command instead. Required permissions: Microsoft.Network/networkSecurityGroups/securityRules/read, Microsoft.Network/networkSecurityGroups/securityRules/write.
-
azure-nsg-security-rules-listDeprecatedRetrieves all security rules in a network security group. Deprecated. Use the azure-vn-security-rules-list command instead. Required permission: Microsoft.Network/networkSecurityGroups/securityRules/read.
-
azure-policy-assignment-createCreates a policy assignment. Required permission: Microsoft.Authorization/policyAssignments/read, Microsoft.Authorization/policyAssignments/write.
-
azure-policy-assignment-create-quick-actionApplies Microsoft Defender for Cloud built-in recommendations by creating a policy assignment for the SecurityCenterBuiltIn initiative. This sets the following policies to 'AuditIfNotExists': disk encryption monitoring (Windows and Linux), system updates monitoring, and JIT network access monitoring. Rules for adaptive application controls, endpoint protection, and security configuration are excluded. Required permissions: Microsoft.Authorization/policyAssignments/read, Microsoft.Authorization/policyAssignments/write.
-
azure-postgres-config-setDeprecatedUpdates a server configuration. Deprecated due to the retirement of Azure PostgreSQL Single Server. Required permissions: Microsoft.DBforPostgreSQL/servers/configurations/read, Microsoft.DBforPostgreSQL/servers/configurations/write.
-
azure-postgres-config-set-checkpoint-logging-quick-actionDeprecatedEnables checkpoint logging on the PostgreSQL server. Deprecated due to the retirement of Azure PostgreSQL Single Server. Required permissions: Microsoft.DBforPostgreSQL/servers/configurations/read, Microsoft.DBforPostgreSQL/servers/configurations/write.
-
azure-postgres-config-set-connection-throttling-quick-actionDeprecatedEnables connection throttling on the PostgreSQL server to manage log verbosity for concurrent connection queries and errors. Deprecated due to the retirement of Azure PostgreSQL Single Server. Required permissions: Microsoft.DBforPostgreSQL/servers/configurations/read, Microsoft.DBforPostgreSQL/servers/configurations/write.
-
azure-postgres-config-set-disconnection-logging-quick-actionDeprecatedEnables logging client disconnections on the PostgreSQL server. Deprecated due to the retirement of Azure PostgreSQL Single Server. Required permissions: Microsoft.DBforPostgreSQL/servers/configurations/read, Microsoft.DBforPostgreSQL/servers/configurations/write.
-
azure-postgres-config-set-log-retention-period-quick-actionDeprecatedSets the log retention period for the PostgreSQL server to 4 days. NOTE: The recommended log retention period can be from 4 to 7 days. Deprecated due to the retirement of Azure PostgreSQL Single Server. Required permissions: Microsoft.DBforPostgreSQL/servers/configurations/read, Microsoft.DBforPostgreSQL/servers/configurations/write.
-
azure-postgres-config-set-session-connection-logging-quick-actionDeprecatedEnables logging client connections on the PostgreSQL. Deprecated due to the retirement of Azure PostgreSQL Single Server. Required permissions: Microsoft.DBforPostgreSQL/servers/configurations/read, Microsoft.DBforPostgreSQL/servers/configurations/write.
-
azure-postgres-config-set-statement-logging-quick-actionDeprecatedEnables logging statement execution duration on the PostgreSQL server to help with performance analysis. Deprecated due to the retirement of Azure PostgreSQL Single Server. Required permissions: Microsoft.DBforPostgreSQL/servers/configurations/read, Microsoft.DBforPostgreSQL/servers/configurations/write.
-
azure-postgres-server-updateDeprecatedUpdates an existing server. Deprecated due to the retirement of Azure PostgreSQL Single Server. Required permissions: Microsoft.DBforPostgreSQL/servers/read, Microsoft.DBforPostgreSQL/servers/write.
-
azure-postgres-server-update-ssl-enforcement-quick-actionDeprecatedEnforces SSL/TLS connections for the PostgreSQL server to reject unencrypted traffic. Deprecated due to the retirement of Azure PostgreSQL Single Server. Required permissions: Microsoft.DBforPostgreSQL/servers/read, Microsoft.DBforPostgreSQL/servers/write.
-
azure-rm-resource-groups-listGets all resource groups for a subscription. Required Permissions: Microsoft.Resources/subscriptions/resourceGroups/read.
-
azure-set-function-app-http-version2-0-quick-actionDeprecatedEnables HTTP 2.0 for the Function App. Deprecated. Use Set Web App HTTP Version to 2.0 instead. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-set-storage-account-https-only-quick-actionEnforces HTTPS-only traffic for the storage account, rejecting any requests made over HTTP. Required permissions: Microsoft.Storage/storageAccounts/read, Microsoft.Storage/storageAccounts/write.
-
azure-sql-db-threat-policy-updateDeprecatedUpdates the database's threat detection policy. Deprecated. Use the azure-sqldb-security-alert-policy-update command instead. Required permissions: Microsoft.Sql/servers/databases/securityAlertPolicies/read, Microsoft.Sql/servers/databases/securityAlertPolicies/write.
-
azure-sql-db-threat-policy-update-quick-actionEnables email notifications to account administrators for SQL database threat detection alerts.
-
azure-sql-db-transparent-data-encryption-enable-tde-quick-actionEnables Transparent Data Encryption (TDE) for the SQL database to encrypt data at rest.
-
azure-sql-db-transparent-data-encryption-setUpdates a logical database's transparent data encryption configuration. Required permissions: Microsoft.Sql/servers/databases/transparentDataEncryption/read, Microsoft.Sql/servers/databases/transparentDataEncryption/write.
-
azure-sqldb-security-alert-policy-updateUpdates a database's security alert policy. The required permissions are: Microsoft.Sql/servers/databases/securityAlertPolicies/read, Microsoft.Sql/servers/databases/securityAlertPolicies/write.
-
azure-storage-account-updateUpdates a specific account storage. Required permissions: Microsoft.Storage/storageAccounts/read, Microsoft.Storage/storageAccounts/write.
-
azure-storage-allow-access-quick-actionConfigures the storage account's network rules to allow traffic from trusted Azure services. Required permissions: Microsoft.Storage/storageAccounts/read, Microsoft.Storage/storageAccounts/write.
-
azure-storage-blob-container-updateUpdates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. Required permissions: Microsoft.Storage/storageAccounts/blobServices/containers/write.
-
azure-storage-blob-containers-updateDeprecatedRun this command to update a specific blob container. The command is deprecated, please use azure-storage-blob-container-update.
-
azure-storage-blob-createCreate a new Blob under the specified Container. Required permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write.
-
azure-storage-blob-enable-soft-delete-quick-actionDeprecatedEnables blob soft delete for the storage account to retain deleted blobs for 30 days. The quick action is now deprecated, please use Enable Blob Soft Deletion. Required permissions: Microsoft.Storage/storageAccounts/blobServices/read, Microsoft.Storage/storageAccounts/blobServices/write.
-
azure-storage-blob-getRetrieve a Blob from a Container. Required permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read.
-
azure-storage-blob-property-getRetrieve Blob properties. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read.
-
azure-storage-blob-property-setSet Blob properties. Required permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write.
-
azure-storage-blob-service-properties-getDeprecatedRun this command to get the blob service properties of a specific account storage. The command is deprecated, please use azure-storage-blob-service-property-get.
-
azure-storage-blob-service-properties-setDeprecatedSets properties for the blob service in a specific account storage. The command is deprecated, please use azure-storage-blob-service-property-set.Required permissions: Microsoft.Storage/storageAccounts/blobServices/read, Microsoft.Storage/storageAccounts/blobServices/write.
-
azure-storage-blob-service-property-getRun this command to get the blob service properties of a specific account storage. Required permissions: Microsoft.Storage/storageAccounts/blobServices/read.
-
azure-storage-blob-service-property-setSets properties for the blob service in a specific account storage. Required permissions: Microsoft.Storage/storageAccounts/blobServices/read, Microsoft.Storage/storageAccounts/blobServices/write.
-
azure-storage-blob-soft-deletion-enable-quick-actionEnables blob soft delete for the storage account to retain deleted blobs for 30 days. Required permissions: Microsoft.Storage/storageAccounts/blobServices/read, Microsoft.Storage/storageAccounts/blobServices/write.
-
azure-storage-blob-tag-getRetrieve the tags of the specified Blob. Required Permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/read.
-
azure-storage-blob-tag-setUpdates the tags for the specified Blob. The command can replace the entire tags of the Blob and can be used to remove tags. Required permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/write.
-
azure-storage-container-blob-createDeprecatedCreates a new Blob under the specified Container. Deprecated. Use the azure-storage-blob-create command instead. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write.
-
azure-storage-container-blob-getDeprecatedRetrieves a Blob from a Container. Deprecated. Use the azure-storage-blob-get command instead. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read.
-
azure-storage-container-blob-property-getDeprecatedRetrieves Blob properties. Deprecated. Use the azure-storage-blob-property-get command instead. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read.
-
azure-storage-container-blob-property-setDeprecatedSets Blob properties. Deprecated. Use the azure-storage-blob-property-set command instead. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write.
-
azure-storage-container-blob-tag-getDeprecatedRetrieves the tags of a specific Blob. Deprecated. Use the azure-storage-blob-tag-get command instead. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/read.
-
azure-storage-container-blob-tag-setDeprecatedUpdates the tags for a specific Blob. Replaces all existing tags or removes them if none are provided. Deprecated. Use the azure-storage-blob-tag-set command instead. Required permissions: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/read, Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/write.
-
azure-storage-container-createCreates a new Container under the specified account. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/write.
-
azure-storage-container-deleteMarks a specific Container for deletion. The Container and any Blobs contained within it will be deleted during garbage collection. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/delete.
-
azure-storage-container-property-getRetrieves properties for a specific Container. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/read.
-
azure-storage-container-public-access-blockBlocks public access to a container. Required permission: Microsoft.Storage/storageAccounts/blobServices/containers/setAcl/action.
-
azure-storage-disable-cross-tenant-replication-quick-actionDisables cross-tenant object replication for the storage account, preventing data from being copied to other Azure AD tenants. Required permissions: Microsoft.Storage/storageAccounts/read, Microsoft.Storage/storageAccounts/write.
-
azure-storage-disable-storage-account-public-access-quick-actionDisables public access to blobs for the storage account, blocking anonymous/public read access to containers and blobs. Required permissions: Microsoft.Storage/storageAccounts/read, Microsoft.Storage/storageAccounts/write.
-
azure-vm-instance-details-getDeprecatedRetrieves the properties of a specific virtual machine. Deprecated. Use the azure-compute-vm-get command instead. Required permission: Microsoft.Compute/virtualMachines/read.
-
azure-vm-instance-power-offDeprecatedPowers off a specific virtual machine. Deprecated. Use the azure-compute-vm-power-off command instead. Required permissions: Microsoft.Compute/virtualMachines/read, Microsoft.Compute/virtualMachines/poweroff/action.
-
azure-vm-instance-startDeprecatedPowers on a specific virtual machine. Deprecated. Use the azure-compute-vm-start command instead. Required permissions: Microsoft.Compute/virtualMachines/read, Microsoft.Compute/virtualMachines/start/action.
-
azure-vm-network-interface-details-getDeprecatedRetrieves the properties of a specific network interface. Deprecated. Use the azure-vn-network-interface-get command instead. Required permission: Microsoft.Network/networkInterfaces/read.
-
azure-vm-public-ip-details-getDeprecatedRetrieves the properties of a specific public IP address. Deprecated. Use the azure-vn-public-ip-address-get command instead. Required permission: Microsoft.Network/publicIPAddresses/read.
-
azure-vn-network-interface-getGets the properties of a given network interface. Required permissions: Microsoft.Network/networkInterfaces/read.
-
azure-vn-network-interface-updateUpdates a network interface. Required Permissions: Microsoft.Network/networkInterfaces/read, Microsoft.Network/networkInterfaces/write, Microsoft.Network/virtualNetworks/subnets/join/action, Microsoft.Network/publicIPAddresses/join/action, Microsoft.Network/networkSecurityGroups/join/action, Microsoft.Network/loadBalancers/backendAddressPools/join/action.
-
azure-vn-network-interfaces-listGets network interfaces in a resource group. Required permissions: Microsoft.Network/networkInterfaces/read.
-
azure-vn-public-ip-address-getGets the properties of a given public IP address. Permissions required: Microsoft.Network/publicIPAddresses/read.
-
azure-vn-public-ip-addresses-listGets public IP addresses in a resource group. Required permissions: Microsoft.Network/publicIPAddresses/read.
-
azure-vn-security-group-createCreates a network security group. Required Permissions: Microsoft.Network/networkSecurityGroups/write.
-
azure-vn-security-groups-listList all network security groups. Required permissions: Microsoft.Network/networkSecurityGroups/read.
-
azure-vn-security-rule-createCreate a security rule. Required permissions: Microsoft.Network/networkSecurityGroups/securityRules/read, Microsoft.Network/networkSecurityGroups/securityRules/write.
-
azure-vn-security-rule-deleteDelete a security rule. Required permissions: Microsoft.Network/networkSecurityGroups/securityRules/delete.
-
azure-vn-security-rule-getGet a specific rule. Required permissions: Microsoft.Network/networkSecurityGroups/securityRules/read.
-
azure-vn-security-rule-updateUpdate a security rule. If one does not exist, it will be created. Required permissions: Microsoft.Network/networkSecurityGroups/securityRules/read, Microsoft.Network/networkSecurityGroups/securityRules/write.
-
azure-vn-security-rules-listGets all security rules in a network security group. Required permissions: Microsoft.Network/networkSecurityGroups/securityRules/read.
-
azure-webapp-assign-managed-identity-quick-actionDeprecatedAssigns a system managed identity to the web app, enabling secure access to other Azure services without managing credentials. Deprecated. Use Assign Web App Managed Identity instead. Required permission: Microsoft.Web/sites/read, Microsoft.Web/sites/write.
-
azure-webapp-auth-updateDeprecatedUpdates the authentication and authorization settings of an existing Azure Web App. Deprecated. Use the azure-appservice-webapp-auth-settings-update command instead. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-webapp-auth-update-quick-actionDeprecatedEnables App Service Authentication for the web app. Deprecated. Use Enable Azure App Service Authentication instead. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-webapp-config-setDeprecatedUpdates the configuration settings of an existing Azure Web App. Deprecated. Use the azure-appservice-webapp-config-update command instead. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-webapp-disable-remote-debugging-quick-actionDeprecatedDisables remote debugging for the web app to reduce the risk of unauthorized code access. Deprecated. Use Disable Remote Debugging on Web App instead. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-webapp-enable-client-cert-quick-actionEnables client certificate authentication for the App Service to secure incoming requests. Only clients that have a valid certificate will be able to reach the app.
-
azure-webapp-set-http2-quick-actionDeprecatedEnables HTTP 2.0 for the web app. Deprecated. Use Set Web App HTTP Version to 2.0 instead. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-webapp-set-min-tls-version-quick-actionDeprecatedSets the web app's minimum accepted TLS version to 1.2 to enhance security. Deprecated. Use Set Web App Minimum TLS Version instead. Required permissions: Microsoft.Web/sites/config/read, Microsoft.Web/sites/config/write.
-
azure-webapp-set-webapp-to-https-only-quick-actionEnforces HTTPS-only traffic for the App Service.
-
azure-webapp-updateDeprecatedUpdates an Azure Web App. Deprecated. Use the azure-appservice-webapp-update command instead. Required permissions: Microsoft.Web/sites/read, Microsoft.Web/sites/write.
-
azure-webapp-update-assign-managed-identity-quick-actionDeprecatedAssigns a system-managed identity to the identified Function App, enabling secure access to Azure services without manual credential management. Deprecated. Use Assign Web App Managed Identity instead. Required permissions: Microsoft.Web/sites/read, Microsoft.Web/sites/write.
import demistomock as demisto import urllib3 from CommonServerPython import * from CommonServerUserPython import * # noqa from MicrosoftApiModule import * # noqa: E402 from COOCApiModule import * from requests.exceptions import ConnectionError, Timeout import datetime as dt import defusedxml.ElementTree as defused_ET import urllib.parse from urllib.parse import parse_qs, urlparse, urlencode, urlunparse from datetime import UTC # Disable insecure warnings urllib3.disable_warnings() """ CONSTANTS """ BLOB_SERVICE_PREFIX = "blob.core.windows.net" DEFAULT_LIMIT = "50" DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ" STORAGE_DATE_FORMAT = "%a, %d %b %Y %H:%M:%S GMT" API_VERSION = "2022-09-01" NEW_API_VERSION_PARAMS = {"api-version": "2024-05-01"} GRANT_BY_CONNECTION = { "Device Code": DEVICE_CODE, "Authorization Code": AUTHORIZATION_CODE, "Client Credentials": CLIENT_CREDENTIALS, } SCOPE_BY_CONNECTION = { "Device Code": "https://management.azure.com/user_impersonation offline_access user.read", "Authorization Code": "https://management.azure.com/.default", "Client Credentials": "https://management.azure.com/.default", } DEFAULT_SCOPE = "https://management.azure.com/.default" DEFAULT_RESOURCE = "https://management.azure.com/" STORAGE_SCOPE = "https://storage.azure.com/.default" STORAGE_RESOURCE = "https://storage.azure.com/" DEFAULT_AZURE_AD_ENDPOINT = "https://login.microsoftonline.com" PERMISSIONS_TO_COMMANDS = { "Microsoft.Network/networkSecurityGroups/read": ["azure-nsg-security-groups-list", "azure-vn-security-groups-list"], "Microsoft.Network/networkSecurityGroups/securityRules/read": [ "azure-nsg-security-rule-update", "azure-nsg-security-rule-create", "azure-nsg-security-rules-list", "azure-nsg-security-rule-get", "azure-vn-security-rule-create", "azure-vn-security-rule-get", "azure-vn-security-rule-update", "azure-vn-security-rules-list", ], "Microsoft.Network/networkSecurityGroups/securityRules/write": [ "azure-nsg-security-rule-update", "azure-nsg-security-rule-create", "azure-vn-security-rule-create", "azure-vn-security-rule-update", ], "Microsoft.Network/networkSecurityGroups/securityRules/delete": [ "azure-nsg-security-rule-delete", "azure-nsg-security-rule-delete-quick-action", "azure-vn-security-rule-delete", ], "Microsoft.Storage/storageAccounts/read": [ "azure-storage-account-update", "azure-storage-allow-access-quick-action", "azure-storage-disable-cross-tenant-replication-quick-action", "azure-storage-disable-storage-account-public-access-quick-action", "azure-network-disable-storage-account-access-quick-action", "azure-set-storage-account-https-only-quick-action", ], "Microsoft.Storage/storageAccounts/write": [ "azure-storage-account-update", "azure-storage-allow-access-quick-action", "azure-storage-disable-cross-tenant-replication-quick-action", "azure-storage-disable-storage-account-public-access-quick-action", "azure-network-disable-storage-account-access-quick-action", "azure-set-storage-account-https-only-quick-action", ], "Microsoft.Network/networkInterfaces/read": [ "azure-nsg-network-interfaces-list", "azure-vm-network-interface-details-get", "azure-vn-network-interface-update", "azure-vn-network-interfaces-list", "azure-vn-network-interface-get", ], "Microsoft.Network/networkInterfaces/write": ["azure-vn-network-interface-update"], "Microsoft.Network/publicIPAddresses/read": [ "azure-nsg-public-ip-addresses-list", "azure-vm-public-ip-details-get", "azure-vn-public-ip-addresses-list", "azure-vn-public-ip-address-get", ], "Microsoft.Storage/storageAccounts/blobServices/containers/write": [ "azure-storage-blob-containers-update", "azure-storage-blob-container-update", "azure-storage-container-create", ], "Microsoft.Storage/storageAccounts/blobServices/containers/setAcl/action": ["azure-storage-container-public-access-block"], "Microsoft.Storage/storageAccounts/blobServices/containers/read": ["azure-storage-container-property-get"], "Microsoft.Storage/storageAccounts/blobServices/containers/delete": ["azure-storage-container-delete"], "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write": [ "azure-storage-container-blob-create", "azure-storage-blob-create", "azure-storage-container-blob-property-set", "azure-storage-blob-property-set", ], "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read": [ "azure-storage-container-blob-get", "azure-storage-blob-get", "azure-storage-container-blob-property-get", "azure-storage-blob-property-get", ], "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/read": [ "azure-storage-container-blob-tag-get", "azure-storage-blob-tag-get", "azure-storage-container-blob-tag-set", ], "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/write": [ "azure-storage-container-blob-tag-set", "azure-storage-blob-tag-set", ], "Microsoft.Storage/storageAccounts/blobServices/read": [ "azure-storage-blob-service-properties-set", "azure-storage-blob-service-properties-get", "azure-storage-blob-enable-soft-delete-quick-action", "azure-storage-blob-service-property-get", "azure-storage-blob-service-property-set", "azure-storage-blob-soft-deletion-enable-quick-action", ], "Microsoft.Storage/storageAccounts/blobServices/write": [ "azure-storage-blob-service-properties-set", "azure-storage-blob-service-properties-get", "azure-storage-blob-enable-soft-delete-quick-action", "azure-storage-blob-service-property-set", "azure-storage-blob-soft-deletion-enable-quick-action", ], "Microsoft.Authorization/policyAssignments/read": [ "azure-policy-assignment-create", "azure-policy-assignment-create-quick-action", ], "Microsoft.Authorization/policyAssignments/write": [ "azure-policy-assignment-create", "azure-policy-assignment-create-quick-action", ], "Microsoft.DBforPostgreSQL/servers/read": [ "azure-postgres-server-update", "azure-postgres-server-update-ssl-enforcement-quick-action", ], "Microsoft.DBforPostgreSQL/servers/write": [ "azure-postgres-server-update", "azure-postgres-server-update-ssl-enforcement-quick-action", ], "Microsoft.DBforPostgreSQL/servers/configurations/read": [ "azure-postgres-config-set", "azure-postgres-config-set-disconnection-logging-quick-action", "azure-postgres-config-set-checkpoint-logging-quick-action", "azure-postgres-config-set-connection-throttling-quick-action", "azure-postgres-config-set-session-connection-logging-quick-action", "azure-postgres-config-set-log-retention-period-quick-action", "azure-postgres-config-set-statement-logging-quick-action", ], "Microsoft.DBforPostgreSQL/servers/configurations/write": [ "azure-postgres-config-set", "azure-postgres-config-set-disconnection-logging-quick-action", "azure-postgres-config-set-checkpoint-logging-quick-action", "azure-postgres-config-set-connection-throttling-quick-action", "azure-postgres-config-set-session-connection-logging-quick-action", "azure-postgres-config-set-log-retention-period-quick-action", "azure-postgres-config-set-statement-logging-quick-action", ], "Microsoft.Web/sites/config/read": [ "azure-webapp-config-set", "azure-webapp-auth-update", "azure-webapp-set-http2-quick-action", "azure-set-function-app-http-version2-0-quick-action", "azure-webapp-disable-remote-debugging-quick-action", "azure-webapp-auth-update-quick-action", "azure-webapp-set-min-tls-version-quick-action", "azure-function-app-set-min-tls-version-quick-action", "azure-appservice-webapp-auth-settings-update", "azure-appservice-webapp-auth-settings-update-quick-action", "azure-appservice-webapp-config-update", "azure-appservice-webapp-config-update-http2-quick-action", "azure-appservice-webapp-config-disable-remote-debugging-quick-action", "azure-appservice-webapp-config-update-min-tls-version-quick-action", ], "Microsoft.Web/sites/config/write": [ "azure-webapp-config-set", "azure-webapp-auth-update", "azure-webapp-set-http2-quick-action", "azure-set-function-app-http-version2-0-quick-action", "azure-webapp-disable-remote-debugging-quick-action", "azure-webapp-auth-update-quick-action", "azure-webapp-set-min-tls-version-quick-action", "azure-function-app-set-min-tls-version-quick-action", "azure-appservice-webapp-auth-settings-update", "azure-appservice-webapp-auth-settings-update-quick-action", "azure-appservice-webapp-config-update", "azure-appservice-webapp-config-update-http2-quick-action", "azure-appservice-webapp-config-disable-remote-debugging-quick-action", "azure-appservice-webapp-config-update-min-tls-version-quick-action", ], "Microsoft.Web/sites/read": [ "azure-webapp-update", "azure-webapp-assign-managed-identity-quick-action", "azure-webapp-update-assign-managed-identity-quick-action", "azure-webapp-set-webapp-to-https-only-quick-action", "azure-webapp-enable-client-cert-quick-action", "azure-appservice-webapp-update", "azure-appservice-webapp-update-quick-action", ], "Microsoft.Web/sites/write": [ "azure-webapp-update", "azure-webapp-assign-managed-identity-quick-action", "azure-webapp-update-assign-managed-identity-quick-action", "azure-webapp-set-webapp-to-https-only-quick-action", "azure-webapp-enable-client-cert-quick-action", "azure-appservice-webapp-update", "azure-appservice-webapp-update-quick-action", ], "Microsoft.DBforMySQL/flexibleServers/configurations/read": [ "azure-mysql-flexible-server-param-set", "azure-mysql-set-secure-transport-quick-action", ], "Microsoft.DBforMySQL/flexibleServers/configurations/write": [ "azure-mysql-flexible-server-param-set", "azure-mysql-set-secure-transport-quick-action", ], "Microsoft.Insights/logprofiles/read": [ "azure-monitor-log-profile-update", "azure-monitor-log-retention-period-quick-action", ], "Microsoft.Insights/logprofiles/write": [ "azure-monitor-log-profile-update", "azure-monitor-log-retention-period-quick-action", ], "Microsoft.Compute/disks/read": [ "azure-disk-update", "azure-disable-public-private-access-vm-disk-quick-action", "azure-disk-set-data-access-ad-quick-action", "azure-compute-disk-update", "azure-disable-public-n-private-access-vm-disk-quick-action", "azure-compute-disk-update-data-access-ad-quick-action", ], "Microsoft.Compute/disks/write": [ "azure-disk-update", "azure-disable-public-private-access-vm-disk-quick-action", "azure-disk-set-data-access-ad-quick-action", "azure-compute-disk-update", "azure-disable-public-n-private-access-vm-disk-quick-action", "azure-compute-disk-update-data-access-ad-quick-action", ], "Microsoft.Compute/virtualMachines/read": [ "azure-vm-instance-details-get", "azure-vm-instance-start", "azure-vm-instance-power-off", "azure-compute-vm-get", ], "Microsoft.Compute/virtualMachines/start/action": ["azure-vm-instance-start", "azure-compute-vm-start"], "Microsoft.Compute/virtualMachines/poweroff/action": ["azure-vm-instance-power-off", "azure-compute-vm-power-off"], "Microsoft.ContainerRegistry/registries/read": [ "azure-acr-update", "azure-acr-disable-public-private-access-quick-action", "azure-acr-disable-authentication-as-arm-quick-action", "azure-acr-disable-anonymous-pull-quick-action", "azure-cr-registry-update", "azure-cr-disable-authentication-as-arm-quick-action", "azure-cr-disable-public-private-access-quick-action", "azure-cr-disable-anonymous-pull-quick-action", ], "Microsoft.ContainerRegistry/registries/write": [ "azure-acr-update", "azure-acr-disable-public-private-access-quick-action", "azure-acr-disable-authentication-as-arm-quick-action", "azure-acr-disable-anonymous-pull-quick-action", "azure-cr-registry-update", "azure-cr-disable-authentication-as-arm-quick-action", "azure-cr-disable-public-private-access-quick-action", "azure-cr-disable-anonymous-pull-quick-action", ], "Microsoft.KeyVault/vaults/read": [ "azure-key-vault-update", "azure-key-vault-purge-and-soft-delete-enable-quick-action", "azure-keyvault-vault-update", ], "Microsoft.KeyVault/vaults/write": [ "azure-key-vault-update", "azure-key-vault-purge-and-soft-delete-enable-quick-action", "azure-keyvault-vault-update", ], "Microsoft.Sql/servers/databases/securityAlertPolicies/read": [ "azure-sql-db-threat-policy-update", "azure-sql-db-threat-policy-update-quick-action", "azure-sqldb-security-alert-policy-update", ], "Microsoft.Sql/servers/databases/securityAlertPolicies/write": [ "azure-sql-db-threat-policy-update", "azure-sql-db-threat-policy-update-quick-action", "azure-sqldb-security-alert-policy-update", ], "Microsoft.DocumentDB/databaseAccounts/read": [ "azure-cosmos-db-update", "azure-cosmos-db-disable-key-quick-action", "azure-cosmosdb-db-account-update", ], "Microsoft.DocumentDB/databaseAccounts/write": [ "azure-cosmos-db-update", "azure-cosmos-db-disable-key-quick-action", "azure-cosmosdb-db-account-update", ], "Microsoft.Sql/servers/databases/transparentDataEncryption/read": [ "azure-sql-db-transparent-data-encryption-set", "azure-sql-db-transparent-data-encryption-enable-tde-quick-action", ], "Microsoft.Sql/servers/databases/transparentDataEncryption/write": [ "azure-sql-db-transparent-data-encryption-set", "azure-sql-db-transparent-data-encryption-enable-tde-quick-action", ], "Microsoft.Consumption/usageDetails/read": ["azure-billing-usage-list"], "Microsoft.Consumption/budgets/read": ["azure-billing-budgets-list"], "Microsoft.CostManagement/forecast/read": ["azure-billing-forecast-list"], "Microsoft.Network/networkSecurityGroups/write": ["create_network_security_group"], "Microsoft.Network/virtualNetworks/subnets/join/action": ["azure-vn-network-interface-update"], "Microsoft.Network/publicIPAddresses/join/action": ["azure-vn-network-interface-update"], "Microsoft.Network/networkSecurityGroups/join/action": ["azure-vn-network-interface-update"], "Microsoft.Network/loadBalancers/backendAddressPools/join/action": ["azure-vn-network-interface-update"], "Microsoft.Resources/subscriptions/resourceGroups/read": ["azure-nsg-resource-group-list", "azure-rm-resource-groups-list"], } API_FUNCTION_TO_PERMISSIONS = { "create_network_security_group": ["Microsoft.Network/networkSecurityGroups/write"], "acr_update": ["Microsoft.ContainerRegistry/registries/read", "Microsoft.ContainerRegistry/registries/write"], "cosmos_db_update": ["Microsoft.DocumentDB/databaseAccounts/read", "Microsoft.DocumentDB/databaseAccounts/write"], "disk-update": ["Microsoft.Compute/disks/read", "Microsoft.Compute/disks/write"], "update_key_vault_request": ["Microsoft.KeyVault/vaults/read", "Microsoft.KeyVault/vaults/write"], "monitor_log_profile_update": ["Microsoft.Insights/logprofiles/read", "Microsoft.Insights/logprofiles/write"], "flexible_server_param_set": [ "Microsoft.DBforMySQL/flexibleServers/configurations/read", "Microsoft.DBforMySQL/flexibleServers/configurations/write", ], "list_networks_interfaces_request": ["Microsoft.Network/networkInterfaces/read"], "list_public_ip_addresses_request": ["Microsoft.Network/publicIPAddresses/read"], "list_resource_groups_request": ["Microsoft.Resources/subscriptions/resourceGroups/read"], "list_network_security_groups": ["Microsoft.Network/networkSecurityGroups/read"], "create_or_update_rule": [ "Microsoft.Network/networkSecurityGroups/securityRules/read", "Microsoft.Network/networkSecurityGroups/securityRules/write", ], "delete_rule": ["Microsoft.Network/networkSecurityGroups/securityRules/delete"], "create_policy_assignment": [ "Microsoft.Authorization/policyAssignments/read", "Microsoft.Authorization/policyAssignments/write", ], "set_postgres_config": [ "Microsoft.DBforPostgreSQL/servers/configurations/read", "Microsoft.DBforPostgreSQL/servers/configurations/write", ], "postgres_server_update": ["Microsoft.DBforPostgreSQL/servers/read", "Microsoft.DBforPostgreSQL/servers/write"], "sql_db_threat_policy_update": [ "Microsoft.Sql/servers/databases/securityAlertPolicies/read", "Microsoft.Sql/servers/databases/securityAlertPolicies/write", ], "sql_db_tde_set": [ "Microsoft.Sql/servers/databases/transparentDataEncryption/read", "Microsoft.Sql/servers/databases/transparentDataEncryption/write", ], "storage_account_update_request": ["Microsoft.Storage/storageAccounts/read", "Microsoft.Storage/storageAccounts/write"], "storage_blob_service_properties_set_request": [ "Microsoft.Storage/storageAccounts/blobServices/read", "Microsoft.Storage/storageAccounts/blobServices/write", ], "storage_container_create_blob_request": ["Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write"], "get_storage_container_properties_request": ["Microsoft.Storage/storageAccounts/blobServices/containers/read"], "create_storage_container_request": ["Microsoft.Storage/storageAccounts/blobServices/containers/write"], "delete_storage_container_request": ["Microsoft.Storage/storageAccounts/blobServices/containers/delete"], "storage_container_blob_get_request": ["Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read"], "storage_container_blob_tag_get_request": ["Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/read"], "storage_container_blob_tags_set_request": [ "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/read", "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/write", ], "storage_container_blob_property_get_request": ["Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read"], "storage_container_blob_properties_set_request": ["Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write"], "storage_container_block_public_access_request": ["Microsoft.Storage/storageAccounts/blobServices/containers/setAcl/action"], "get_rule": ["Microsoft.Network/networkSecurityGroups/securityRules/read"], "update_webapp_auth": ["Microsoft.Web/sites/config/read", "Microsoft.Web/sites/config/write"], "set_webapp_config": ["Microsoft.Web/sites/config/read", "Microsoft.Web/sites/config/write"], "webapp_update": ["Microsoft.Web/sites/read", "Microsoft.Web/sites/write"], "start_vm_request": ["Microsoft.Compute/virtualMachines/read", "Microsoft.Compute/virtualMachines/start/action"], "poweroff_vm_request": ["Microsoft.Compute/virtualMachines/read", "Microsoft.Compute/virtualMachines/poweroff/action"], "get_vm_request": ["Microsoft.Compute/virtualMachines/read"], "list_vm_request": ["Microsoft.Compute/virtualMachines/read"], "get_network_interface_request": ["Microsoft.Network/networkInterfaces/read"], "update_network_interface_request": [ "Microsoft.Network/networkInterfaces/read", "Microsoft.Network/networkInterfaces/write", "Microsoft.Network/virtualNetworks/subnets/join/action", "Microsoft.Network/publicIPAddresses/join/action", "Microsoft.Network/networkSecurityGroups/join/action", "Microsoft.Network/loadBalancers/backendAddressPools/join/action", ], "get_public_ip_details_request": ["Microsoft.Network/publicIPAddresses/read"], "get_all_public_ip_details_request": ["Microsoft.Network/publicIPAddresses/read"], "list_security_rules": ["Microsoft.Network/networkSecurityGroups/securityRules/read"], } REQUIRED_ROLE_PERMISSIONS = [ "Microsoft.Network/networkSecurityGroups/read", "Microsoft.Network/networkSecurityGroups/securityRules/read", "Microsoft.Network/networkSecurityGroups/securityRules/write", "Microsoft.Network/networkSecurityGroups/securityRules/delete", "Microsoft.Network/networkInterfaces/read", "Microsoft.Network/publicIPAddresses/read", "Microsoft.Storage/storageAccounts/read", "Microsoft.Storage/storageAccounts/write", "Microsoft.Storage/storageAccounts/blobServices/read", "Microsoft.Storage/storageAccounts/blobServices/write", "Microsoft.Storage/storageAccounts/blobServices/containers/write", "Microsoft.Storage/storageAccounts/blobServices/containers/read", "Microsoft.Storage/storageAccounts/blobServices/containers/delete", "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read", "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/read", "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/write", "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write", "Microsoft.Storage/storageAccounts/blobServices/containers/setAcl/action", "Microsoft.Authorization/policyAssignments/read", "Microsoft.Authorization/policyAssignments/write", "Microsoft.DBforPostgreSQL/servers/read", "Microsoft.DBforPostgreSQL/servers/write", "Microsoft.DBforPostgreSQL/servers/configurations/read", "Microsoft.DBforPostgreSQL/servers/configurations/write", "Microsoft.Web/sites/config/read", "Microsoft.Web/sites/config/write", "Microsoft.Web/sites/read", "Microsoft.Web/sites/write", "Microsoft.DBforMySQL/flexibleServers/configurations/read", "Microsoft.DBforMySQL/flexibleServers/configurations/write", "Microsoft.Insights/logprofiles/read", "Microsoft.Insights/logprofiles/write", "Microsoft.Compute/disks/read", "Microsoft.Compute/disks/write", "Microsoft.Compute/virtualMachines/read", "Microsoft.Compute/virtualMachines/start/action", "Microsoft.Compute/virtualMachines/poweroff/action", "Microsoft.ContainerRegistry/registries/read", "Microsoft.ContainerRegistry/registries/write", "Microsoft.KeyVault/vaults/read", "Microsoft.KeyVault/vaults/write", "Microsoft.Sql/servers/databases/securityAlertPolicies/read", "Microsoft.Sql/servers/databases/securityAlertPolicies/write", "Microsoft.DocumentDB/databaseAccounts/read", "Microsoft.DocumentDB/databaseAccounts/write", "Microsoft.Sql/servers/databases/transparentDataEncryption/read", "Microsoft.Sql/servers/databases/transparentDataEncryption/write", "Microsoft.Resources/subscriptions/read", "Microsoft.Resources/subscriptions/resourceGroups/read", "Microsoft.Consumption/usageDetails/read", "Microsoft.Consumption/budgets/read", "Microsoft.CostManagement/forecast/read", ] REQUIRED_API_PERMISSIONS = ["GroupMember.ReadWrite.All", "RoleManagement.ReadWrite.Directory"] PREFIX_URL_AZURE = "https://management.azure.com/subscriptions/" PREFIX_URL_MS_GRAPH = "https://graph.microsoft.com/v1.0" POLICY_ASSIGNMENT_API_VERSION = "2024-05-01" POSTGRES_API_VERSION = "2017-12-01" WEBAPP_API_VERSION = "2024-04-01" FLEXIBLE_API_VERSION = "2023-12-30" MONITOR_API_VERSION = "2016-03-01" DISKS_API_VERSION = "2024-03-02" ACR_API_VERSION = "2023-07-01" KEY_VAULT_API_VERSION = "2022-07-01" SQL_DB_API_VERSION = "2021-11-01" COSMOS_DB_API_VERSION = "2024-11-15" PERMISSIONS_VERSION = "2022-04-01" VM_API_VERSION = "2023-03-01" NSG_API_VERSION = "2025-01-01" # The following commands required a scope, token and resource update as part of the functions get_command_resource and # get_command_and_token_scopes. STORAGE_BLOB_SPECIAL_COMMANDS = [ "azure-storage-blob-property-get", "azure-storage-blob-property-set", "azure-storage-blob-tag-get", "azure-storage-blob-create", "azure-storage-blob-get", "azure-storage-blob-tag-set", ] COMMANDS_TO_OUTPUTS_PREFIX = { "azure-storage-container-blob-property-get": "Azure.StorageContainer", "azure-storage-blob-property-get": "Azure.Storage.Blob", "azure-storage-container-blob-tag-get": "Azure.StorageContainer", "azure-storage-blob-tag-get": "Azure.Storage.Blob", "azure-vm-instance-details-get": "Azure.Compute", "azure-compute-vm-get": "Azure.Compute.VirtualMachines", "azure-vm-instance-power-off": "Azure.Compute", "azure-compute-vm-power-off": "Azure.Compute.VirtualMachines", "azure-vm-instance-start": "Azure.Compute", "azure-compute-vm-start": "Azure.Compute.VirtualMachines", "azure-cosmos-db-update": "Azure.CosmosDB", "azure-cosmosdb-db-account-update": "Azure.CosmosDB.DBAccounts", "azure-key-vault-update": "Azure.KeyVault", "azure-keyvault-vault-update": "Azure.KeyVault.Vault", "azure-nsg-resource-group-list": "Azure.NSGResourceGroup", "azure-rm-resource-groups-list": "Azure.ResourceManagement.ResourceGroups", "azure-sql-db-threat-policy-update": "Azure.SqlDBThreatPolicy", "azure-sqldb-security-alert-policy-update": "Azure.SqlDB.SecurityAlertPolicies", "azure-storage-blob-containers-update": "Azure.StorageBlobContainer", "azure-storage-blob-container-update": "Azure.Storage.BlobContainers", "azure-nsg-network-interfaces-list": "Azure.NSGNetworkInterfaces", "azure-vn-network-interfaces-list": "Azure.VirtualNetworks.NetworkInterfaces", "azure-nsg-public-ip-addresses-list": "Azure.NSGPublicIPAddress", "azure-vn-public-ip-addresses-list": "Azure.VirtualNetworks.PublicIPAddresses", "azure-nsg-security-groups-list": "Azure.NSGSecurityGroup", "azure-vn-security-groups-list": "Azure.VirtualNetworks.SecurityGroups", "azure-nsg-security-rule-create": "Azure.NSGRule", "azure-vn-security-rule-create": "Azure.VirtualNetworks.SecurityRules", "azure-nsg-security-rule-get": "Azure.NSGRule", "azure-vn-security-rule-get": "Azure.VirtualNetworks.SecurityRules", "azure-nsg-security-rule-update": "Azure.NSGRule", "azure-vn-security-rule-update": "Azure.VirtualNetworks.SecurityRules", "azure-nsg-security-rules-list": "Azure.NSGRule", "azure-vn-security-rules-list": "Azure.VirtualNetworks.SecurityRules", "azure-vm-network-interface-details-get": "Azure.Network.Interfaces", "azure-vn-network-interface-get": "Azure.VirtualNetworks.NetworkInterfaces", "azure-vm-public-ip-details-get": "Azure.Network.IPConfigurations", "azure-vn-public-ip-address-get": "Azure.VirtualNetworks.PublicIPAddresses", "azure-webapp-config-set": "Azure.WebAppConfig", "azure-webapp-set-http2-quick-action": "Azure.WebAppConfig", "azure-set-function-app-http-version2-0-quick-action": "Azure.WebAppConfig", "azure-webapp-disable-remote-debugging-quick-action": "Azure.WebAppConfig", "azure-webapp-set-min-tls-version-quick-action": "Azure.WebAppConfig", "azure-function-app-set-min-tls-version-quick-action": "Azure.WebAppConfig", "azure-appservice-webapp-config-update": "Azure.AppService.WebAppConfiguration", "azure-webapp-auth-update": "Azure.WebAppAuth", "azure-appservice-webapp-auth-settings-update": "Azure.AppService.WebAppAuthSettings", "azure-webapp-auth-update-quick-action": "Azure.WebAppAuth", "azure-disk-update": "Azure.Disk", "azure-disk-set-data-access-ad-quick-action": "Azure.Disk", "azure-disable-public-private-access-vm-disk-quick-action": "Azure.Disk", "azure-compute-disk-update": "Azure.Compute.Disks", "azure-webapp-update": "Azure.WebApp", "azure-appservice-webapp-update": "Azure.AppService.WebApp", "azure-webapp-assign-managed-identity-quick-action": "Azure.WebApp", "azure-webapp-update-assign-managed-identity-quick-action": "Azure.WebApp", "azure-acr-update": "Azure.ACR", "azure-cr-registry-update": "Azure.ContainerRegistry.Registries", "azure-acr-disable-public-private-access-quick-action": "Azure.ACR", "azure-acr-disable-authentication-as-arm-quick-action": "Azure.ACR", "azure-acr-disable-anonymous-pull-quick-action": "Azure.ACR", "azure-storage-blob-service-properties-get": "Azure.StorageBlobServiceProperties", "azure-storage-blob-service-property-get": "Azure.Storage.BlobServices", "azure-storage-blob-service-properties-set": "Azure.StorageAccountBlobServiceProperties", "azure-storage-blob-service-property-set": "Azure.Storage.BlobServices", "azure-storage-blob-enable-soft-delete-quick-action": "Azure.StorageAccountBlobServiceProperties", } class TokenScope: STORAGE = "STORAGE" GRAPH = "GRAPH" NETWORK = "NETWORK" COMPUTE = "COMPUTE" VAULT = "VAULT" CONTAINER_REGISTRY = "CONTAINER_REGISTRY" DATABASE = "DATABASE" COSMOS = "COSMOS" DATA_LAKE_1 = "DATA_LAKE_1" DATA_LAKE_2 = "DATA_LAKE_2" SIGNALR = "SIGNALR" EVENT_HUBS = "EVENT_HUBS" SERVICE_BUS = "SERVICE_BUS" MONITOR = "MONITOR" DIGITAL_TWINS = "DIGITAL_TWINS" COGNITIVE_SERVICES = "COGNITIVE_SERVICES" SYNAPSE_ANALYTICS = "SYNAPSE_ANALYTICS" ML = "ML" NONE = "NONE" DEFAULT = "DEFAULT" SEARCH = "SEARCH" WORKSPACE_MEMBERSHIP = "WORKSPACE_MEMBERSHIP" WORKSPACE_GROUP = "WORKSPACE_GROUP" WORKSPACE_USER = "WORKSPACE_USER" WORKSPACE_DOMAIN = "WORKSPACE_DOMAIN" WORKSPACE_CUSTOMER = "WORKSPACE_CUSTOMER" """ CLIENT CLASS """ class AzureClient: def __init__( self, app_id: str = "", subscription_id: str = "", resource_group_name: str = "", verify: bool = False, proxy: bool = False, tenant_id: str | None = None, enc_key: str | None = None, resource: str | None = None, scope: str | None = None, headers: dict | None = {}, connection_type: str = "Client Credentials", azure_ad_endpoint: str = "https://login.microsoftonline.com", auth_code: str | None = None, redirect_uri: str | None = None, managed_identities_client_id: str | None = None, ): self.connection_type = connection_type if not headers: is_device_code = "Device Code" in connection_type # Managed Identities authenticate against the IMDS endpoint, not an AAD token endpoint, # so they must not receive a token_retrieval_url. is_managed_identities = "Managed Identities" in connection_type token_retrieval_url: str | None ms_scope: str | None ms_resource: str | None if is_device_code: # Use the configured tenant when available so single-tenant apps get a tenant-scoped # authority. Fall back to the "organizations" endpoint only for multi-tenant apps with # no configured tenant; otherwise Microsoft returns "No tenant-identifying information # found in either the request or implied by any provided credentials". tenant_segment = tenant_id or "organizations" token_retrieval_url = urllib.parse.urljoin(azure_ad_endpoint, f"{tenant_segment}/oauth2/v2.0/token") # Use the per-command resource (management or storage) as the single source of truth, # then derive the matching Device Code delegated scope from it (space-delimited form, # unlike the `.default` form used by the other flows). This keeps storage-container # commands storage-scoped under Device Code auth instead of always management-scoped. ms_resource = (resource or DEFAULT_RESOURCE).rstrip("/") ms_scope = f"{ms_resource}/user_impersonation offline_access user.read" else: # Build the token authority from the configured Azure AD endpoint so that Client Credentials # and Authorization Code flows target the correct cloud (e.g. US Gov login.microsoftonline.us). # Without this, MicrosoftClient falls back to the commercial login.microsoftonline.com authority # while the scope/resource point to a national cloud, which Microsoft rejects with # "Confidential Client is not supported in Cross Cloud request". token_retrieval_url = ( None if is_managed_identities else urllib.parse.urljoin(azure_ad_endpoint, f"{tenant_id or ''}/oauth2/v2.0/token") ) ms_scope = scope # The Client Credentials and Authorization Code flows use the v2.0 token endpoint, which # authorizes via the `.default` scope and rejects the v1.0 `resource` parameter. Sending both # results in "invalid_target: The resource parameter provided in the request doesn't match with # the requested scopes". Only Device Code (v1.0-style) uses `resource`. ms_resource = None ms_client_args = assign_params( self_deployed=True, auth_id=app_id, token_retrieval_url=token_retrieval_url, grant_type=GRANT_BY_CONNECTION.get(connection_type), base_url=f"{PREFIX_URL_AZURE}", verify=verify, proxy=proxy, resource=ms_resource, scope=ms_scope, azure_ad_endpoint=azure_ad_endpoint, tenant_id=tenant_id, enc_key=enc_key, auth_code=auth_code, redirect_uri=redirect_uri, managed_identities_client_id=managed_identities_client_id, managed_identities_resource_uri=(resource or DEFAULT_RESOURCE).rstrip("/") if is_managed_identities else (ms_resource or Resources.management_azure), command_prefix="azure", ok_codes=(200, 201, 202, 204), ) self.ms_client = MicrosoftClient(**ms_client_args) else: base_client_args = assign_params( base_url=f"{PREFIX_URL_AZURE}", verify=os.environ.get("EGRESSPROXY_CA_PATH"), proxy=proxy, headers=headers ) self.base_client = BaseClient(**base_client_args) self.subscription_id = subscription_id self.resource_group_name = resource_group_name self.headers = headers def http_request( self, method: str, url_suffix: str | None = None, full_url: str | None = None, params: dict[str, Any] = {}, resp_type: str = "json", json_data: dict | None = None, data: dict | bytes | None = None, ) -> requests.Response | dict[str, Any]: if not params: params = {} if not self.headers: self.headers = {} if not params.get("api-version") and "x-ms-version" not in self.headers: params["api-version"] = API_VERSION proxies = {"http": os.environ.get("CRTX_HTTP_PROXY"), "https": os.environ.get("CRTX_HTTP_PROXY")} if self.headers: self.headers |= {"x-caller-id": get_proxydome_token()} return self.base_client._http_request( # type: ignore[misc] method=method, url_suffix=url_suffix, full_url=full_url, json_data=json_data, params=params, resp_type=resp_type, headers=self.headers, ok_codes=(200, 201, 202, 204, 206), proxies=proxies, data=data, ) return self.ms_client.http_request( method=method, url_suffix=url_suffix, full_url=full_url, json_data=json_data, params=params, resp_type=resp_type ) def handle_azure_error( self, e: Exception, resource_name: str, resource_type: str, api_function_name: str, subscription_id: str = None, resource_group_name: str = None, ) -> None: """ Standardized error handling for Azure API calls Args: e: The exception that was raised resource_name: Name of the resource that caused the error resource_type: Type of the resource (e.g., 'Security Rule', 'Storage Account') api_function_name: The api function name, used when need to know the permissions. subscription_id: Azure subscription ID (optional, for better error messages) resource_group_name: Resource group name (optional, for better error messages) Raises: ValueError: For 404 (not found) errors DemistoException: For permission errors and other API errors """ error_msg = str(e).lower() demisto.debug(f"Azure API error for {resource_type} '{resource_name}': {type(e).__name__}") if "404" in error_msg or "not found" in error_msg: error_details = f'{resource_type} "{resource_name}"' if subscription_id and resource_group_name: error_details += f' under subscription ID "{subscription_id}" and resource group "{resource_group_name}"' elif subscription_id: error_details += f' under subscription ID "{subscription_id}"' raise ValueError(f"{error_details} was not found. {str(e)}") elif ("403" in error_msg or "forbidden" in error_msg) or ("401" in error_msg or "unauthorized" in error_msg): demisto.debug("Permission error, trying to find the missing permission.") found_permission = [] # If we have api_function_name, use the reverse mapping for O(1) lookup if api_function_name in API_FUNCTION_TO_PERMISSIONS: found_permission = get_permissions_from_api_function_name(api_function_name, error_msg) if not found_permission: found_permission = get_permissions_from_required_role_permissions_list(error_msg) error_entries = [{"account_id": subscription_id, "message": error_msg, "name": perm} for perm in found_permission] demisto.debug(f"Calling return_multiple_permissions_error function with {error_entries=}") return_multiple_permissions_error(error_entries) elif "400" in error_msg or "bad request" in error_msg: if "intercepted by proxydome" in error_msg: raise DemistoException(f'Request for {resource_type} "{resource_name}" was intercepted by proxydome.') raise DemistoException(f'Invalid request for {resource_type} "{resource_name}". {str(e)}') else: # Re-raise the original exception for any other errors raise DemistoException(f'Failed to access {resource_type} "{resource_name}": {str(e)}') def create_or_update_rule( self, security_group: str, rule_name: str, properties: dict, subscription_id: str, resource_group_name: str ): """ Create or update a security rule in an Azure Network Security Group. Args: security_group: Name of the network security group rule_name: Name of the security rule to retrieve subscription_id: Azure subscription ID resource_group_name: Resource group name properties: Properties of the security rule Returns: The response from the Azure API after creating the security rule Raises: ValueError: If the rule is not found DemistoException: If there are permission or other API errors """ try: return self.http_request( "PUT", full_url=( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Network/networkSecurityGroups/{security_group}/securityRules/{rule_name}?" ), json_data={"properties": properties}, ) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{security_group}/{rule_name}", resource_type="Security Rule", api_function_name="create_or_update_rule", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def get_rule(self, security_group: str, rule_name: str, subscription_id: str, resource_group_name: str): """ Get a network security group rule. Args: security_group: Name of the network security group rule_name: Name of the security rule to retrieve subscription_id: Azure subscription ID resource_group_name: Resource group name Returns: Dictionary containing the security rule information Raises: ValueError: If the rule is not found DemistoException: If there are permission or other API errors """ try: demisto.debug("Retrieving security rule details.") return self.http_request( "GET", full_url=f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Network/networkSecurityGroups/{security_group}/securityRules/{rule_name}", ) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{security_group}/{rule_name}", resource_type="Security Rule", api_function_name="get_rule", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def list_security_rules(self, subscription_id: str, resource_group_name: str, network_security_group_name: str): """ Gets all security rules in a network security group. Args: subscription_id(str) : Azure subscription ID resource_group_name(str) : Resource group name network_security_group_name(str): The name of the network security group Returns: A dict containing a list of dictionary with the security rules information Raises: DemistoException: If there are permission or other API errors """ try: demisto.debug("Retrieving security rules list.") return self.http_request( "GET", full_url=f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Network/networkSecurityGroups/{network_security_group_name}/securityRules?{NSG_API_VERSION}", ) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{network_security_group_name}/security-rules-list", resource_type="Security Rules", api_function_name="list_security_rules", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def storage_account_update_request(self, subscription_id: str, resource_group_name: str, args: dict): """ Send the user arguments for the create/update account in the request body to the API. Args: subscription_id: The subscription id. resource_group_name: The resource group name. args: The user arguments. Returns: The json response from the API call. """ account_name = args.get("account_name", "") json_data_args: dict = { "sku": {"name": args.get("sku")}, "kind": args.get("kind"), "location": args.get("location"), "properties": {}, } if "tags" in args: args_tags_list = args["tags"].split(",") tags_obj = {f"tag{i + 1!s}": args_tags_list[i] for i in range(len(args_tags_list))} json_data_args["tags"] = tags_obj json_data_args.update( { "properties": { "customDomain": { "name": args.get("custom_domain_name"), "useSubDomainName": args.get("use_sub_domain_name") == "true" if "use_sub_domain_name" in args else None, }, "encryption": { "keySource": args.get("enc_key_source"), "keyvaultproperties": { "keyname": args.get("enc_keyvault_key_name"), "keyversion": args.get("enc_keyvault_key_version"), "keyvaulturi": args.get("enc_keyvault_uri"), }, "requireInfrastructureEncryption": args.get("enc_requireInfrastructureEncryption"), }, "networkAcls": { "bypass": args.get("network_ruleset_bypass"), "defaultAction": args.get("network_ruleset_default_action"), "ipRules": json.loads(args["network_ruleset_ipRules"]) if "network_ruleset_ipRules" in args else None, "virtualNetworkRules": json.loads(args["virtual_network_rules"]) if "virtual_network_rules" in args else None, }, "accessTier": args.get("access_tier"), "supportsHttpsTrafficOnly": args.get("supports_https_traffic_only"), "isHnsEnabled": args.get("is_hns_enabled"), "largeFileSharesState": args.get("large_file_shares_state"), "allowCrossTenantReplication": args.get("allow_cross_tenant_replication"), "allowBlobPublicAccess": args.get("allow_blob_public_access"), "minimumTlsVersion": args.get("minimum_tls_version"), } } ) json_data_args = remove_empty_elements(json_data_args) demisto.debug(f'Updating storage account "{account_name}".') try: response = self.http_request( method="PATCH", full_url=( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Storage/storageAccounts/{account_name}" ), params={ "api-version": API_VERSION, }, json_data=json_data_args, resp_type="response", ) return response except Exception as e: self.handle_azure_error( e=e, resource_name=account_name, resource_type="Storage Account", api_function_name="storage_account_update_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def storage_blob_service_properties_set_request( self, subscription_id: str, resource_group_name: str, account_name: str, delete_rentention_policy_enabled: str | None, delete_rentention_policy_days: str | None, ): """ Set properties of Blob service of a given Azure Storage account. Args: subscription_id (str): Azure subscription ID containing the storage account. resource_group_name (str): Name of the resource group that contains the storage account. account_name (str): Name of the Azure Storage account. delete_rentention_policy_enabled (str): Whether delete retention is enabled ('true' or 'false'). delete_rentention_policy_days (str): Number of days to retain deleted blobs. Returns: dict: The full JSON response from the Azure REST API after applying the update. Raises: ValueError: If the storage account is not found or required parameters are missing DemistoException: If there are permission or other API errors """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Storage/storageAccounts/{account_name}/blobServices/default" ) data = { "properties": { "deleteRetentionPolicy": {"enabled": delete_rentention_policy_enabled, "days": delete_rentention_policy_days} } } params = {"api-version": API_VERSION} data = remove_empty_elements(data) try: return self.http_request(method="PUT", full_url=full_url, params=params, json_data=data) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{account_name}/blobServices", resource_type="Storage Blob Service", api_function_name="storage_blob_service_properties_set_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def storage_blob_service_properties_get_request(self, account_name: str, resource_group_name: str, subscription_id: str): """ Send the get blob service properties request to the API. Args: account_name: The storage account name. resource_group_name: The resource group name. subscription_id: The subscription id. Returns: The json response from the API call. Docs: https://learn.microsoft.com/en-us/rest/api/storagerp/blob-services/get-service-properties?view=rest-storagerp-2024-01-01&utm_source=chatgpt.com&tabs=HTTP """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Storage/storageAccounts/{account_name}/blobServices/default" ) try: return self.http_request(method="GET", full_url=full_url) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{account_name}/blobServices", resource_type="Storage Blob Service", api_function_name="storage_blob_service_properties_get_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def storage_blob_containers_create_update_request( self, subscription_id: str, resource_group_name: str, args: Dict, method: str ): """ Create or update a blob container in an Azure Storage account. This function constructs the request body from user-provided arguments and sends an HTTP request to the Azure REST API to create or update a blob container under the specified storage account. Args: subscription_id (str): The Azure subscription ID. resource_group_name (str): The name of the resource group containing the storage account. args (Dict): User-provided arguments, which can include: - container_name (str): Name of the blob container. - account_name (str): Name of the storage account. - default_encryption_scope (str, optional): Default encryption scope for the container. - deny_encryption_scope_override (bool, optional): Whether to deny overriding the encryption scope. - public_access (str, optional): Public access level for the container (e.g., "None", "Blob", "Container"). method (str): HTTP method to use for the request (e.g., "PUT" or "PATCH"). Returns: dict: The JSON response from the Azure API. """ container_name = args.get("container_name", "") account_name = args.get("account_name", "") try: properties = {} if "default_encryption_scope" in args: properties["defaultEncryptionScope"] = args.get("default_encryption_scope") if "deny_encryption_scope_override" in args: properties["denyEncryptionScopeOverride"] = argToBoolean(args.get("deny_encryption_scope_override")) if "public_access" in args: properties["publicAccess"] = args.get("public_access") full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/providers/" f"Microsoft.Storage/storageAccounts/{account_name}/blobServices/default/containers/{container_name}" ) return self.http_request( method=method, full_url=full_url, json_data={"properties": properties}, ) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{account_name}/{container_name}", resource_type="Storage Blob Service", api_function_name="storage_blob_containers_create_update_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def storage_container_set_headers(self, custom_headers: dict = {}): """ Set the headers for the storage container request. Args: custom_headers (dict, optional): Custom headers to be added to the request. """ request_headers = { "x-ms-version": "2023-11-03", "x-ms-date": dt.datetime.utcnow().strftime(STORAGE_DATE_FORMAT), } if self.headers: self.headers |= request_headers else: self.headers = request_headers if custom_headers: self.headers |= custom_headers demisto.debug(f"Request headers: {self.headers}") def get_storage_container_properties_request(self, account_name: str, container_name: str) -> requests.Response: """ Retrieve properties for the specified Container. Args: account_name (str): The storage account name. container_name (str): Container name. Returns: Response: API response from Azure. """ params = assign_params(restype="container") full_url = f"https://{account_name}.{BLOB_SERVICE_PREFIX}/{container_name}" self.storage_container_set_headers() response = self.http_request(method="GET", full_url=full_url, params=params, resp_type="response") return response # type: ignore[return-value] def create_storage_container_request(self, container_name: str, account_name: str) -> requests.Response: """ Create a new Container under the specified account. Args: container_name (str): Container name. account_name (str): Storage account name. Returns: Response: API response from Azure. """ params = assign_params(restype="container") full_url = f"https://{account_name}.{BLOB_SERVICE_PREFIX}/{container_name}" self.storage_container_set_headers() response = self.http_request(method="PUT", full_url=full_url, params=params, resp_type="response") return response # type: ignore[return-value] def delete_storage_container_request(self, container_name: str, account_name: str) -> None: """ Delete Container under the specified account. Args: container_name (str): Container name. account_name (str): Storage account name. Returns: Response: API response from Azure. """ params = assign_params(restype="container") full_url = f"https://{account_name}.{BLOB_SERVICE_PREFIX}/{container_name}" self.storage_container_set_headers() self.http_request(method="DELETE", full_url=full_url, params=params, resp_type="response") def storage_container_create_blob_request( self, container_name: str, account_name: str, file_entry_id: str, blob_name: str, system_file_path: str ) -> None: # noqa: E501 """ Create or update Blob under the specified Container. Args: container_name (str): Container name. account_name (str): Storage account name. file_entry_id (str): File War room Entry ID. blob_name (str): File name. system_file_path (str): File system path. Returns: Response: API response from Azure. """ full_url = f"https://{account_name}.{BLOB_SERVICE_PREFIX}/{container_name}/{blob_name}" try: with open(system_file_path, "rb") as file_data: file_size = os.path.getsize(system_file_path) headers = { "x-ms-blob-type": "BlockBlob", # for standard blob upload "Content-Length": str(file_size), } self.storage_container_set_headers(headers) self.http_request(method="PUT", full_url=full_url, data=file_data, resp_type="response") # type: ignore except Exception as e: raise DemistoException(f"Unable to read file with id {file_entry_id}", e) def storage_container_blob_get_request( self, container_name: str, blob_name: str, account_name: str ) -> requests.Response | dict[str, Any]: # noqa: E501 """ Get a blob from a storage container. Args: account_name (str): Name of the storage account. container_name (str): Name of the container. blob_name (str): Name of the blob. Returns: dict: The JSON response from the Azure API. """ full_url = f"https://{account_name}.{BLOB_SERVICE_PREFIX}/{container_name}/{blob_name}" self.storage_container_set_headers() response = self.http_request(method="GET", full_url=full_url, resp_type="response") return response def storage_container_blob_tag_get_request( self, container_name: str, blob_name: str, account_name: str ) -> requests.Response | dict[str, Any] | str: # noqa: E501 """ Get the tags of a blob from a storage container. Args: account_name (str): Name of the storage account. container_name (str): Name of the container. blob_name (str): Name of the blob. Returns: dict: The JSON response from the Azure API. """ full_url = f"https://{account_name}.{BLOB_SERVICE_PREFIX}/{container_name}/{blob_name}" params = assign_params(comp="tags") self.storage_container_set_headers() response = self.http_request(method="GET", full_url=full_url, params=params, resp_type="text") return response def storage_container_blob_tags_set_request( self, container_name: str, blob_name: str, tags: bytes, account_name: str, ) -> requests.Response | dict[str, Any]: """ Set the tags for a blob in a storage container. Args: container_name (str): Name of the container. blob_name (str): Name of the blob. tags (str): XML data containing the tags to set. account_name (str): Name of the storage account. Returns: dict: The JSON response from the Azure API. """ full_url = f"https://{account_name}.{BLOB_SERVICE_PREFIX}/{container_name}/{blob_name}" params = assign_params(comp="tags") headers = { "Content-Type": "application/xml; charset=utf-8", "Content-Length": str(len(tags)), } self.storage_container_set_headers(headers) response = self.http_request(method="PUT", full_url=full_url, params=params, data=tags, resp_type="response") return response def storage_container_blob_property_get_request( self, container_name: str, blob_name: str, account_name: str ) -> requests.Response | dict[str, Any]: """ Retrieve Blob properties. Args: container_name (str): Container name. blob_name (str): Blob name. account_name (str): Name of the storage account. Returns: Response: API response from Azure. """ full_url = f"https://{account_name}.{BLOB_SERVICE_PREFIX}/{container_name}/{blob_name}" self.storage_container_set_headers() response = self.http_request(method="HEAD", full_url=full_url, resp_type="response") return response def storage_container_blob_properties_set_request( self, container_name: str, blob_name: str, account_name: str, headers: dict ) -> requests.Response | dict[str, Any]: """ Set Blob properties. Args: container_name (str): Container name. blob_name (str): Blob name. account_name (str): Name of the storage account. headers (dict): Request Headers. Returns: Response: API response from Azure. """ full_url = f"https://{account_name}.{BLOB_SERVICE_PREFIX}/{container_name}/{blob_name}" params = assign_params(comp="properties") self.storage_container_set_headers(custom_headers=headers) response = self.http_request(method="PUT", full_url=full_url, params=params, resp_type="response") return response def storage_container_block_public_access_request(self, account_name: str, container_name: str): """ Block public access to a container. Args: account_name (str): Name of the storage account. container_name (str): Name of the container. Returns: Response: API response from Azure. """ full_url = f"https://{account_name}.{BLOB_SERVICE_PREFIX}/{container_name}" params = assign_params(restype="container", comp="acl") self.storage_container_set_headers() response = self.http_request(method="PUT", full_url=full_url, params=params, resp_type="response") return response def create_policy_assignment( self, name: str, policy_definition_id: str, display_name: str, parameters: str, description: str, scope: str ): """ Create a policy assignment in Azure. Args: name (str): Name of the policy assignment. policy_definition_id (str): ID of the policy definition to assign. display_name (str): Display name for the policy assignment. parameters (str): Parameters for the policy assignment. description (str): Description of the policy assignment. scope (str): Scope of the policy assignment (e.g., subscription or resource group). Returns: dict: The full response from the Azure policy assignment creation API. """ # subscription_id is required as argument for token creation. full_url = f"{DEFAULT_RESOURCE}{scope}/providers/Microsoft.Authorization/policyAssignments/{name}" params = {"api-version": POLICY_ASSIGNMENT_API_VERSION} data = { "properties": { "policyDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/" + policy_definition_id, "displayName": display_name, "parameters": parameters, "description": description, } } try: return self.http_request(method="PUT", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{name}", resource_type="Policy Assignment", api_function_name="create_policy_assignment", subscription_id=self.subscription_id, resource_group_name=self.resource_group_name, ) def set_postgres_config( self, server_name: str, subscription_id: str, resource_group_name: str, configuration_name: str, source: str, value: str ): """ Updates the configuration of a specific PostgreSQL server parameter. Args: server_name (str): Name of the PostgreSQL server. subscription_id (str): Azure subscription ID. resource_group_name (str): Name of the resource group containing the server. configuration_name (str): Name of the configuration parameter to update. source (str): The source of the configuration value. value (str): The new value to set for the configuration parameter. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If required parameters are missing or PostgreSQL server not found DemistoException: If there are permission or other API errors """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.DBforPostgreSQL/servers/{server_name}/configurations/{configuration_name}" ) params = {"api-version": POSTGRES_API_VERSION} data = {"properties": {"source": source, "value": value}} data = remove_empty_elements(data) demisto.debug(f'Updating configuration of PostgreSQL server "{server_name}".') try: return self.http_request(method="PUT", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{server_name}/{configuration_name}", resource_type="PostgreSQL Configuration", api_function_name="set_postgres_config", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def set_webapp_config( self, name: str, subscription_id: str, resource_group_name: str, http20_enabled: str, remote_debugging_enabled: str, min_tls_version: str, ): """ Updates the web app configuration settings. Args: name (str): Name of the web app. subscription_id (str): Azure subscription ID. resource_group_name (str): Name of the resource group containing the web app. http20_enabled (str): Whether HTTP/2.0 is enabled for the web app. remote_debugging_enabled (str): Whether remote debugging is enabled. min_tls_version (str): Minimum TLS version required. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If required parameters are missing or webapp not found DemistoException: If there are permission or other API errors """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Web/sites/{name}/config/web" ) params = {"api-version": WEBAPP_API_VERSION} data = { "properties": { "http20Enabled": http20_enabled, "remoteDebuggingEnabled": remote_debugging_enabled, "minTlsVersion": min_tls_version, } } data = remove_empty_elements(data) demisto.debug(f"Setting WebApp configuration for {name}.") try: return self.http_request(method="PATCH", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=name, resource_type="Web App", subscription_id=subscription_id, api_function_name="set_webapp_config", resource_group_name=resource_group_name, ) def get_webapp_auth(self, name: str, subscription_id: str, resource_group_name: str): """ Gets the authentication settings of a web app. Args: name (str): Name of the web app. subscription_id (str): Azure subscription ID. resource_group_name (str): Name of the resource group containing the web app. Returns: dict: The authentication settings of the web app. Raises: ValueError: If required parameters are missing or webapp not found DemistoException: If there are permission or other API errors """ try: full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Web/sites/{name}/config/authsettings/list" ) params = {"api-version": WEBAPP_API_VERSION} return self.http_request(method="GET", full_url=full_url, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=name, resource_type="Web App", api_function_name="get_webapp_auth", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def update_webapp_auth(self, name: str, subscription_id: str, resource_group_name: str, enabled: str): """ Updates the authentication settings of a web app. Args: name (str): Name of the web app. subscription_id (str): Azure subscription ID. resource_group_name (str): Name of the resource group containing the web app. current (dict): Current authentication settings dictionary to be updated. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If required parameters are missing or webapp not found DemistoException: If there are permission or other API errors """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Web/sites/{name}/config/authsettings" ) params = {"api-version": WEBAPP_API_VERSION} data = {"properties": {"enabled": enabled}} demisto.debug(f"Updating WebApp auth of {name}.") try: return self.http_request(method="PUT", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=name, resource_type="Web App", api_function_name="update_webapp_auth", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def flexible_server_param_set( self, server_name: str, configuration_name: str, subscription_id: str, resource_group_name: str, source: str, value: str ): """ Updates a parameter of a MySQL flexible server. Args: server_name (str): Name of the MySQL flexible server. configuration_name (str): Name of the configuration parameter to update. subscription_id (str): Azure subscription ID. resource_group_name (str): Name of the resource group containing the server. source (str): The source of the configuration value. value (str): The new value to set for the configuration parameter. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If the MySQL flexible server or configuration parameter is not found DemistoException: If there are permission or other API errors """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.DBforMySQL/flexibleServers/{server_name}/configurations/{configuration_name}" ) params = {"api-version": FLEXIBLE_API_VERSION} data = {"properties": {"source": source, "value": value}} try: return self.http_request(method="PUT", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{server_name}/{configuration_name}", resource_type="MySQL Flexible Server Configuration", api_function_name="flexible_server_param_set", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def get_monitor_log_profile(self, subscription_id: str, log_profile_name: str): """ Gets a monitor log profile. Args: subscription_id (str): Azure subscription ID. log_profile_name (str): Name of the log profile. Returns: dict: The log profile configuration from Azure API. Raises: ValueError: If the log profile is not found DemistoException: If there are permission or other API errors """ try: full_url = f"{PREFIX_URL_AZURE}{subscription_id}/providers/Microsoft.Insights/logprofiles/{log_profile_name}" params = {"api-version": MONITOR_API_VERSION} demisto.debug(f'Getting log profile "{log_profile_name}".') return self.http_request(method="GET", full_url=full_url, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=log_profile_name, resource_type="Monitor Log Profile", api_function_name="get_monitor_log_profile", subscription_id=subscription_id, resource_group_name=None, ) def monitor_log_profile_update(self, subscription_id: str, log_profile_name: str, current_log_profile: dict): """ Updates a monitor log profile. Args: subscription_id (str): Azure subscription ID. log_profile_name (str): Name of the log profile. current_log_profile (dict): The current log profile to update. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If the log profile is not found DemistoException: If there are permission or other API errors """ full_url = f"{PREFIX_URL_AZURE}{subscription_id}/providers/Microsoft.Insights/logprofiles/{log_profile_name}" params = {"api-version": MONITOR_API_VERSION} data = current_log_profile data = remove_empty_elements(data) try: demisto.debug(f'Updating log profile "{log_profile_name}".') return self.http_request(method="PUT", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=log_profile_name, resource_type="Monitor Log Profile", api_function_name="monitor_log_profile_update", subscription_id=subscription_id, resource_group_name=None, ) def disk_update( self, subscription_id: str, resource_group_name: str, disk_name: str, public_network_access: str | None, network_access_policy: str | None, data_access_auth_mode: str | None, ): """ Updates a disk. Args: subscription_id (str): Azure subscription ID. resource_group_name (str): Name of the resource group containing the disk. disk_name (str): Name of the disk. public_network_access (str): The public network access state. network_access_policy (str): The network access policy. data_access_auth_mode (str): The data access authentication mode. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If the disk is not found DemistoException: If there are permission or other API errors """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Compute/disks/{disk_name}" ) params = {"api-version": DISKS_API_VERSION} data = { "properties": { "publicNetworkAccess": public_network_access, "networkAccessPolicy": network_access_policy, "dataAccessAuthMode": data_access_auth_mode, } } data = remove_empty_elements(data) try: demisto.debug(f'Updating disk "{disk_name}."') return self.http_request(method="PATCH", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=disk_name, resource_type="Disk", api_function_name="disk_update", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def webapp_update( self, subscription_id: str, resource_group_name: str, name: str, identity_type: str | None, https_only: str | None, client_cert_enabled: str | None, ): """ Updates a web app. Args: subscription_id (str): Azure subscription ID. resource_group_name (str): Name of the resource group containing the web app. name (str): Name of the web app. identity_type (str): Type of identity to assign to the web app. https_only (str): Whether the web app requires HTTPS only. client_cert_enabled (str): Whether client certificates are enabled. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If the web app is not found DemistoException: If there are permission or other API errors """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Web/sites/{name}" ) params = {"api-version": WEBAPP_API_VERSION} data = { "identity": { "type": identity_type, }, "properties": { "clientCertEnabled": client_cert_enabled, "httpsOnly": https_only, }, } data = remove_empty_elements(data) demisto.debug(f'Updating WebApp "{name}".') try: return self.http_request(method="PATCH", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=name, resource_type="Web App", api_function_name="webapp_update", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def acr_update( self, subscription_id: str, resource_group_name: str, registry_name: str, allow_exports: str | None, public_network_access: str | None, anonymous_pull_enabled: str | None, authentication_as_arm_policy: str | None, ): """ Updates an Azure Container Registry. Args: subscription_id (str): Azure subscription ID. resource_group_name (str): Name of the resource group containing the registry. registry_name (str): Name of the container registry. allow_exports (str): Whether exports are allowed. public_network_access (str): The public network access state. anonymous_pull_enabled (str): Whether anonymous pulls are enabled. authentication_as_arm_policy (str): The authentication as ARM policy status. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If the container registry is not found DemistoException: If there are permission or other API errors """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.ContainerRegistry/registries/{registry_name}" ) params = {"api-version": ACR_API_VERSION} data = { "properties": { "publicNetworkAccess": public_network_access, "anonymousPullEnabled": anonymous_pull_enabled, "policies": { "azureADAuthenticationAsArmPolicy": {"status": authentication_as_arm_policy}, "exportPolicy": {"status": allow_exports}, }, }, } data = remove_empty_elements(data) demisto.debug(f'Updating ACR "{registry_name}".') try: return self.http_request(method="PATCH", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=registry_name, resource_type="Container Registry", api_function_name="acr_update", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def postgres_server_update(self, subscription_id: str, resource_group_name: str, server_name: str, ssl_enforcement: str): """ Updates a PostgreSQL server. Args: subscription_id (str): Azure subscription ID. resource_group_name (str): Name of the resource group containing the server. server_name (str): Name of the PostgreSQL server. ssl_enforcement (str): The SSL enforcement status. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If the PostgreSQL server is not found DemistoException: If there are permission or other API errors """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.DBforPostgreSQL/servers/{server_name}" ) params = {"api-version": POSTGRES_API_VERSION} data = { "properties": {"sslEnforcement": ssl_enforcement}, } data = remove_empty_elements(data) try: demisto.debug(f'Updating postgres server "{server_name}".') return self.http_request(method="PATCH", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=server_name, resource_type="PostgreSQL Server", api_function_name="postgres_server_update", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def update_key_vault_request( self, subscription_id: str, resource_group_name: str, vault_name: str, enable_soft_delete: str, enable_purge_protection: str, ): """ Updates a Key Vault. Args: subscription_id (str): Azure subscription ID. resource_group_name (str): Name of the resource group containing the key vault. vault_name (str): Name of the key vault. enable_soft_delete (str): Whether soft delete is enabled. enable_purge_protection (str): Whether purge protection is enabled. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If the key vault is not found DemistoException: If there are permission or other API errors """ data = {"properties": {"enableSoftDelete": enable_soft_delete, "enablePurgeProtection": enable_purge_protection}} params = {"api-version": KEY_VAULT_API_VERSION} full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.KeyVault/vaults/{vault_name}" ) try: demisto.debug(f'Updating key vault "{vault_name}".') return self.http_request("PATCH", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=vault_name, resource_type="Key Vault", api_function_name="update_key_vault_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def sql_db_threat_policy_get(self, server_name: str, db_name: str, subscription_id: str, resource_group_name: str): """ Gets the threat policy of a SQL database. Args: server_name (str): Name of the SQL server. db_name (str): Name of the database. subscription_id (str): Azure subscription ID. resource_group_name (str): Name of the resource group containing the database. Returns: dict: The threat policy of the SQL database. Raises: ValueError: If the SQL database or server is not found DemistoException: If there are permission or other API errors """ params = {"api-version": SQL_DB_API_VERSION} full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Sql/servers/{server_name}/databases/{db_name}/securityAlertPolicies/default" ) try: demisto.debug("Getting SQL DB threat policy.") return self.http_request("GET", full_url=full_url, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{server_name}/{db_name}", resource_type="SQL Database Threat Policy", api_function_name="sql_db_threat_policy_get", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def sql_db_threat_policy_update( self, server_name: str, db_name: str, subscription_id: str, current: dict, resource_group_name: str ): """ Updates the threat policy of a SQL database. Args: server_name (str): Name of the SQL server. db_name (str): Name of the database. subscription_id (str): Azure subscription ID. current (dict): The current threat policy configuration to update. resource_group_name (str): Name of the resource group containing the database. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If the SQL database or server is not found DemistoException: If there are permission or other API errors """ data = current params = {"api-version": SQL_DB_API_VERSION} full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Sql/servers/{server_name}/databases/{db_name}/securityAlertPolicies/default" ) try: demisto.debug("Updating SQL DB threat policy.") return self.http_request("PUT", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{server_name}/{db_name}", resource_type="SQL Database Threat Policy", api_function_name="sql_db_threat_policy_update", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def sql_db_tde_set(self, server_name: str, db_name: str, subscription_id: str, state: str, resource_group_name: str): """ Sets the transparent data encryption state of a SQL database. Args: server_name (str): Name of the SQL server. db_name (str): Name of the database. subscription_id (str): Azure subscription ID. state (str): The TDE state to set. resource_group_name (str): Name of the resource group containing the database. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If the SQL database or server is not found DemistoException: If there are permission or other API errors """ data = {"properties": {"state": state}} params = {"api-version": SQL_DB_API_VERSION} full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Sql/servers/{server_name}/databases/{db_name}/transparentDataEncryption/current" ) demisto.debug("Setting SQL DB Transparent Data Encryption state.") try: return self.http_request("PUT", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{server_name}/{db_name}", resource_type="SQL Database Transparent Data Encryption", api_function_name="sql_db_tde_set", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def cosmos_db_update( self, subscription_id: str, resource_group_name: str, account_name: str, disable_key_based_metadata_write_access: str | None, ): """ Updates a Cosmos DB account. Args: subscription_id (str): Azure subscription ID. resource_group_name (str): Name of the resource group containing the account. account_name (str): Name of the Cosmos DB account. disable_key_based_metadata_write_access (str): Whether to disable key-based metadata write access. Returns: dict: The response from the Azure REST API after applying the update. Raises: ValueError: If the Cosmos DB account is not found DemistoException: If there are permission or other API errors """ data = {"properties": {"disableKeyBasedMetadataWriteAccess": disable_key_based_metadata_write_access}} data = remove_empty_elements(data) params = {"api-version": COSMOS_DB_API_VERSION} full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.DocumentDB/databaseAccounts/{account_name}" ) demisto.debug("Updating Cosmos DB.") try: return self.http_request("PATCH", full_url=full_url, json_data=data, params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=account_name, resource_type="Cosmos DB Account", api_function_name="cosmos_db_update", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def remove_member_from_role(self, role_object_id: str, user_id: str): """Currently not supported in the integration - token scope issues. Removing a member from a specific role. Args: role_object_id: A role to remove the user from. user_id: The user to remove from the role. Return: True if succeeded. Raises: Error on failed removal (as long with requests errors). Docs: https://docs.microsoft.com/en-us/graph/api/directoryrole-delete-member?view=graph-rest-1.0&tabs=http """ full_url = f"{PREFIX_URL_MS_GRAPH}/directoryRoles/{role_object_id}/members/{user_id}/$ref" self.http_request("DELETE", full_url=full_url) def remove_member_from_group(self, group_id: str, user_id: str): """Currently not supported in the integration - token scope issues. Remove a single member to a group by sending a DELETE request. Args: group_id: the group id to add the member to. user_id: the user id to remove. """ # If successful, this method returns 204 No Content response code. # It does not return anything in the response body. # Using resp_type="text" to avoid parsing error in the calling method. self.http_request( method="DELETE", full_url=f"{PREFIX_URL_MS_GRAPH}/groups/{group_id}/members/{user_id}/$ref", resp_type="text" ) def create_network_security_group( self, subscription_id: str, resource_group_name: str, security_group_name: str, location: str ): """ Create or update a network security group. Args: subscription_id: The Azure subscription ID. resource_group_name: The resource group name. security_group_name: The name of the network security group. location: The location of the network security group. Return: A dictionary containing the network security group information. Docs: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/network-security-groups/create-or-update?view=rest-virtualnetwork-2024-05-01 """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Network/networkSecurityGroups/{security_group_name}" ) json_data = { "location": location, } params = {"api-version": "2025-05-01"} try: return self.http_request(method="PUT", full_url=full_url, json_data=remove_empty_elements(json_data), params=params) except Exception as e: self.handle_azure_error( e=e, resource_name=security_group_name, resource_type="Security Group", api_function_name="create_network_security_group", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def list_network_security_groups(self, subscription_id: str, resource_group_name: str): """ List all network security groups in a specific resource group. Args: subscription_id: The Azure subscription ID. resource_group_name: The resource group containing the network security groups. Return: A dictionary containing the list of network security groups. Docs: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/network-security-groups/list?view=rest-virtualnetwork-2024-05-01 """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Network/networkSecurityGroups" ) try: return self.http_request(method="GET", full_url=full_url) except Exception as e: self.handle_azure_error( e=e, resource_name=resource_group_name, resource_type="Security Group", api_function_name="list_network_security_groups", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def delete_rule(self, security_group_name: str, security_rule_name: str, subscription_id: str, resource_group_name: str): """ Delete a specific security rule from a network security group. Args: security_group_name: The name of the network security group. security_rule_name: The name of the security rule to delete. subscription_id: The Azure subscription ID. resource_group_name: The resource group containing the network security group. Return: The HTTP response object from the delete operation. Docs: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/security-rules/delete?view=rest-virtualnetwork-2024-05-01 """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}" f"/providers/Microsoft.Network/networkSecurityGroups/{security_group_name}" f"/securityRules/{security_rule_name}" ) try: response = self.http_request(method="DELETE", full_url=full_url, resp_type="response") if response.status_code in (200, 202, 204): # type: ignore[union-attr] return response else: demisto.debug("Failed to delete security rule.") response.raise_for_status() # type: ignore[union-attr] except Exception as e: self.handle_azure_error( e=e, resource_name=f"{security_group_name}/{security_rule_name}", resource_type="Security Group", api_function_name="delete_rule", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def list_resource_groups_request(self, subscription_id: str, filter_by_tag: str, limit: str): """ List resource groups in a subscription, optionally filtered by tag and limited in number. Args: subscription_id: The Azure subscription ID. filter_by_tag: An OData filter expression to filter resource groups by tag. limit: Maximum number of resource groups to return. Return: A dictionary containing the list of resource groups. Docs: https://learn.microsoft.com/en-us/rest/api/resources/resource-groups/list?view=rest-resources-2021-04-01 """ full_url = f"{PREFIX_URL_AZURE}{subscription_id}/resourcegroups" try: return self.http_request(method="GET", full_url=full_url, params={"$filter": filter_by_tag, "$top": limit}) except Exception as e: self.handle_azure_error( e=e, resource_name=subscription_id, resource_type="Resource Group", api_function_name="list_resource_groups_request", subscription_id=subscription_id, resource_group_name=None, ) def list_networks_interfaces_request(self, subscription_id: str, resource_group_name: str): """ List all network interfaces in a specific resource group. Args: subscription_id: The Azure subscription ID. resource_group_name: The resource group containing the network interfaces. Return: A dictionary containing the list of network interfaces. Docs: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/network-interfaces/list?view=rest-virtualnetwork-2024-05-01 """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/" f"providers/Microsoft.Network/networkInterfaces" ) try: return self.http_request(method="GET", full_url=full_url, params=NEW_API_VERSION_PARAMS) except Exception as e: self.handle_azure_error( e=e, resource_name=resource_group_name, resource_type="Network Interface", api_function_name="list_networks_interfaces_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def list_public_ip_addresses_request(self, subscription_id: str, resource_group_name: str): """ List all public IP addresses in a specific resource group. Args: subscription_id: The Azure subscription ID. resource_group_name: The resource group containing the public IP addresses. Return: A dictionary containing the list of public IP addresses. Docs: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/public-ip-addresses/list?view=rest-virtualnetwork-2024-05-01 """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/" f"providers/Microsoft.Network/publicIPAddresses" ) try: return self.http_request(method="GET", full_url=full_url) except Exception as e: self.handle_azure_error( e=e, resource_name=resource_group_name, resource_type="Public IP Addresses", api_function_name="list_public_ip_addresses_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def start_vm_request(self, subscription_id: str, resource_group_name: str, vm_name: str): """ Starts the specified virtual machine in a given resource group. Args: subscription_id (str): The ID of the Azure subscription. resource_group_name (str): The name of the resource group containing the virtual machine. vm_name (str): The name of the virtual machine to start. Returns: The HTTP response object of the start request. Docs: https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/start?view=rest-azure-2024-04-01 """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Compute/" f"virtualMachines/{vm_name}/start" ) try: response = self.http_request( method="POST", full_url=full_url, params={"api-version": VM_API_VERSION}, resp_type="response" ) if response.status_code in (200, 202, 204): # type: ignore[union-attr] return response else: demisto.debug(f"Failed to start vm {vm_name}.") response.raise_for_status() # type: ignore[union-attr] except Exception as e: self.handle_azure_error( e=e, resource_name=f"{resource_group_name}/{vm_name}", resource_type="Virtual Machines", api_function_name="start_vm_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def poweroff_vm_request(self, subscription_id: str, resource_group_name: str, vm_name: str, skip_shutdown: bool): """ Powers off the specified virtual machine in a given resource group. Args: subscription_id (str): The ID of the Azure subscription. resource_group_name (str): The name of the resource group containing the virtual machine. vm_name (str): The name of the virtual machine to power off. skip_shutdown (str): Whether to skip the OS shutdown before powering off. Expected values are "true" or "false". Returns: The HTTP response object of the power-off request. Docs: https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/power-off?view=rest-azure-2024-04-01 """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Compute/" f"virtualMachines/{vm_name}/powerOff" ) parameters = {"skipShutdown": skip_shutdown} | {"api-version": VM_API_VERSION} try: response = self.http_request(method="POST", full_url=full_url, params=parameters, resp_type="response") if response.status_code in (200, 202, 204): # type: ignore[union-attr] return response else: demisto.debug(f"Failed to power off vm {vm_name}.") response.raise_for_status() # type: ignore[union-attr] except Exception as e: self.handle_azure_error( e=e, resource_name=f"{resource_group_name}/{vm_name}", resource_type="Virtual Machines", api_function_name="poweroff_vm_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def get_vm_request(self, subscription_id: str, resource_group_name: str, vm_name: str, expand: str = "instanceView"): """ Gets the specified virtual machine in a given resource group. Args: subscription_id (str): The ID of the Azure subscription. resource_group_name (str): The name of the resource group containing the virtual machine. vm_name (str): The name of the virtual machine. expand (str, optional): Additional properties to include in the response. Defaults to "instanceView". Returns: The detailed virtual machine object, including optional expanded properties. Docs: https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/get?view=rest-azure-2024-04-01 """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Compute/" f"virtualMachines/{vm_name}" ) parameters = {"$expand": expand, "api-version": VM_API_VERSION} try: return self.http_request(method="GET", full_url=full_url, params=parameters) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{resource_group_name}/{vm_name}", resource_type="Virtual Machines", api_function_name="get_vm_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def list_vm_request(self, subscription_id: str, resource_group_name: str, next_token: str): """ Lists all the virtual machines in the specified resource group. Args: subscription_id (str): The ID of the Azure subscription. resource_group_name (str): The name of the resource group containing the virtual machine. next_token (str): The URI to fetch the next page of results. Returns: The list of virtual machines. Docs: https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/list?view=rest-compute-2025-04-01&tabs=HTTP """ if not next_token: full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Compute/" f"virtualMachines" ) parameters = { "api-version": "2025-04-01", } else: demisto.debug(f"using {next_token=} for retrieving the next page of results.") full_url = next_token parameters = {} try: demisto.debug(f"[Azure] {parameters=}") return self.http_request(method="GET", full_url=full_url, params=parameters) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{resource_group_name}", resource_type="Virtual Machines", api_function_name="list_vm_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def validate_provisioning_state(self, subscription_id, resource_group, vm_name): """ Ensure that the provisioning state of a VM is 'Succeeded' For all provisioning states other than 'Succeeded', this method will raise an exception with an informative error message. parameter: (dict) args The command arguments passed to either the `azure-compute-vm-start` (azure-vm-instance-start) or `azure-compute-vm-power-off` (azure-vm-instance-power-off) commands returns: None """ creating_or_updating_err = ( "Please wait for the VM to finish being" " {} before executing this command. To retrieve the " "last known state of the VM, execute the " "`azure-compute-vm-get` command. " ) deleting_err = "You cannot execute this command because the VM is being deleted." failed_err = ( "Unable to power-off or power-on '{}' virtual machine " "because the following provisioning failure occurred during " 'the vm\'s creation.\ncode: "{}"\nmessage: "{}"\nVisit the ' "Azure Web Portal to take care of this issue." ) provisioning_state_to_errors = { "creating": creating_or_updating_err.format("created"), "updating": creating_or_updating_err.format("updated"), "deleting": deleting_err, "failed": failed_err, } response = self.get_vm_request(subscription_id=subscription_id, resource_group_name=resource_group, vm_name=vm_name) properties = response.get("properties") provisioning_state = properties.get("provisioningState") statuses = properties.get("instanceView", {}).get("statuses") # Check if the current ProvisioningState of the VM allows for executing this command if provisioning_state.lower() == "failed": for status in statuses: status_code = status.get("code") if "provisioningstate/failed" in status_code.lower(): message = status.get("message") err_msg = provisioning_state_to_errors.get("failed") raise Exception(err_msg.format(vm_name, status_code, message)) # type: ignore # If the Microsoft API changes and the status code is no longer # relevant, preventing the above exception with its detailed error message from # being raised, then raise the below exception with a more general error message err_msg = "Cannot execute this command because the ProvisioningState of the VM is 'Failed'." raise Exception(err_msg) elif provisioning_state.lower() in provisioning_state_to_errors: err_msg = provisioning_state_to_errors.get(provisioning_state.lower()) raise Exception(err_msg) def get_network_interface_request(self, subscription_id: str, resource_group_name: str, interface_name: str): """ Gets the specified network interface in a given resource group. Args: subscription_id (str): The ID of the Azure subscription. resource_group_name (str): The name of the resource group containing the network interface. interface_name (str): The name of the network interface. Returns: The detailed network interface object. Docs: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/network-interfaces/get?view=rest-virtualnetwork-2023-05-01 """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Network/" f"networkInterfaces/{interface_name}" ) try: return self.http_request(method="GET", full_url=full_url, params={"api-version": "2023-05-01"}) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{resource_group_name}/{interface_name}", resource_type="Network Interfaces", api_function_name="get_network_interface_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def update_network_interface_request( self, subscription_id: str, resource_group_name: str, interface_name: str, network_interface_data: dict, ): """ Creates or updates a network interface. This method uses PUT to update the network interface. The caller should first retrieve the current network interface using get_network_interface_request, modify the desired properties, and then pass the full object to this method. Args: subscription_id (str): The ID of the Azure subscription. resource_group_name (str): The name of the resource group containing the network interface. interface_name (str): The name of the network interface. network_interface_data (dict): The full network interface object with updated properties. Returns: The updated network interface object. Docs: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/network-interfaces/create-or-update """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Network/" f"networkInterfaces/{interface_name}" ) try: return self.http_request( method="PUT", full_url=full_url, params={"api-version": "2023-05-01"}, json_data=network_interface_data, ) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{resource_group_name}/{interface_name}", resource_type="Network Interfaces", api_function_name="update_network_interface_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def get_public_ip_details_request(self, subscription_id: str, resource_group_name: str, address_name: str): """ Gets the specified public IP address in a given resource group. Args: subscription_id (str): The ID of the Azure subscription. resource_group_name (str): The name of the resource group containing the public IP. address_name (str): The name of the public IP address. Returns: The detailed public IP address object. Docs: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/public-ip-addresses/get?view=rest-virtualnetwork-2024-10-01 """ full_url = ( f"{PREFIX_URL_AZURE}{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Network/" f"publicIPAddresses/{address_name}" ) try: return self.http_request(method="GET", full_url=full_url, params={"api-version": "2023-05-01"}) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{resource_group_name}/{address_name}", resource_type="Public IP Addresses", api_function_name="get_public_ip_details_request", subscription_id=subscription_id, resource_group_name=resource_group_name, ) def get_all_public_ip_details_request(self, subscription_id: str): """ Lists all public IP addresses in the specified Azure subscription. Args: subscription_id (str): The ID of the Azure subscription. Returns: List of PublicIPAddressListResult objects. Docs: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/public-ip-addresses/list-all?tabs=HTTP """ full_url = f"{PREFIX_URL_AZURE}{subscription_id}/providers/Microsoft.Network/publicIPAddresses" try: return self.http_request(method="GET", full_url=full_url) except Exception as e: self.handle_azure_error( e=e, resource_name=f"{subscription_id}", resource_type="Public IP Addresses", api_function_name="get_all_public_ip_details_request", subscription_id=subscription_id, resource_group_name=None, ) def billing_usage_list( self, subscription_id: str, expand: str = "", filter_: str = "", metric: str = "", max_results: int = 50, next_page_token: str = "", ): """ Retrieves actual usage and cost details from Azure Consumption API. Args: subscription_id (str): Azure subscription ID. expand (str): Expand usage details with additional properties. filter_ (str): OData filter expression for filtering results. metric (str): Specific metric to retrieve (e.g., ActualCost, UsageQuantity). max_results (int): Maximum number of results to return (default: 50). next_page_token (str): Token for pagination. Returns: dict: The response from the Azure Consumption API. Raises: DemistoException: If Azure API call fails, subscription not found, or invalid parameters provided """ scope = f"/{subscription_id}" url = f"{scope}/providers/Microsoft.Consumption/usageDetails" api_version = "2024-08-01" params_ = { "$expand": expand, "$filter": filter_, "metric": metric.lower().replace(" ", ""), "api-version": api_version, "$top": max_results, } remove_nulls_from_dictionary(params_) try: if next_page_token: new_url = remove_query_param_from_url(next_page_token, "api-version") demisto.debug(f"Azure billing usage request (pagination): {new_url}") return self.http_request("GET", full_url=new_url, params={"api-version": api_version}) else: demisto.debug(f"Azure billing usage request: {url}, params: {params_}") return self.http_request("GET", url_suffix=url, params=params_) except Exception as e: self.handle_azure_error( e=e, resource_name=subscription_id, resource_type="Usage Details", subscription_id=subscription_id, api_function_name="billing_usage_list", ) def billing_forecast_list( self, subscription_id: str, forecast_type: str, aggregation_function_name: str, aggregation_function_type: str = "Sum", granularity: str = "Daily", start_date: str = "", end_date: str = "", filter_param: str = "", include_actual_cost: bool = False, include_fresh_partial_cost: bool = False, ): """ Returns cost forecast for a subscription over a given time range. Args: subscription_id (str): Azure subscription ID. forecast_type (str): Forecast type (Usage, ActualCost, AmortizedCost). aggregation_function_name (str): Aggregation function name. aggregation_function_type (str): Aggregation function type (default: "Sum"). granularity (str): Data granularity (default: "Daily"). start_date (str): Start date for the forecast. end_date (str): End date for the forecast. filter_param (str): URL parameter to filter forecasts. include_actual_cost (bool): Include actual cost data (default: False). include_fresh_partial_cost (bool): Include fresh partial cost data (default: False). Returns: dict: The response from the Azure Cost Management API. Raises: DemistoException: If Azure API call fails, subscription not found, or invalid parameters provided """ start_datetime = arg_to_datetime(start_date) or datetime.now(UTC) end_datetime = arg_to_datetime(end_date) or (datetime.now(UTC) + timedelta(days=7)) url = f"{subscription_id}/providers/Microsoft.CostManagement/forecast" api_version = "2025-03-01" body: dict[str, Any] = { "type": forecast_type, "timeframe": "Custom", "timePeriod": { "from": start_datetime.strftime("%Y-%m-%dT00:00:00Z"), "to": end_datetime.strftime("%Y-%m-%dT00:00:00Z"), }, "dataset": { "granularity": granularity, "aggregation": { "totalCost": { "function": aggregation_function_type, "name": aggregation_function_name, } }, }, } if include_actual_cost: body["includeActualCost"] = include_actual_cost if include_fresh_partial_cost: body["includeFreshPartialCost"] = include_fresh_partial_cost if filter_param: body["dataset"]["filter"] = filter_param # type: ignore[index] demisto.debug(f"Azure billing forecast \nrequest body: \n{body}") params_ = {"api-version": api_version} try: return self.http_request("POST", url_suffix=url, params=params_, json_data=body) except Exception as e: self.handle_azure_error( e=e, resource_name=subscription_id, resource_type="Cost Forecast", subscription_id=subscription_id, api_function_name="billing_forecast_list", ) def billing_budgets_list( self, subscription_id: str, budget_name: str = "", ): """ Retrieves budget information from Azure Consumption API. Args: subscription_id (str): Azure subscription ID. budget_name (str): Optional specific budget name to retrieve. Returns: dict: The response from the Azure Consumption API. Raises: DemistoException: If Azure API call fails, subscription not found, or invalid parameters provided """ scope = f"/{subscription_id}" if budget_name: url = f"{scope}/providers/Microsoft.Consumption/budgets/{budget_name}" else: url = f"{scope}/providers/Microsoft.Consumption/budgets" api_version = "2024-08-01" params_ = {"api-version": api_version} demisto.debug(f"Azure billing budgets request: {url}, params: {params_}") try: return self.http_request("GET", url_suffix=url, params=params_) except Exception as e: self.handle_azure_error( e=e, resource_name=budget_name or subscription_id, resource_type="Budget", subscription_id=subscription_id, api_function_name="billing_budgets_list", ) """ HELPER FUNCTIONS """ def get_permissions_from_api_function_name(api_function_name: str, error_msg: str) -> list: """ Extract the relevant missing permission by checking command-to-permissions mapping against an error message. Iterates over the permissions mapped to a specific API function and returns the relevant permissions that appear in the given error message. Args: api_function_name (str): The name of the API function used for permission lookup. error_msg (str): The error message string to check for missing permissions. Returns: list: The matching permission names if found, otherwise an empty list. """ permission_names = [] for permission in API_FUNCTION_TO_PERMISSIONS[api_function_name]: if permission.lower() in error_msg.lower(): demisto.debug(f"Found missing permission via command mapping: {permission}") permission_names.append(permission) return permission_names def get_permissions_from_required_role_permissions_list(error_msg: str) -> list: """ Extract the relevant missing permission by searching the required role permissions list against an error message. Iterates over the predefined required role permissions and returns the relevant permissions that appear in the given error message. Args: error_msg (str): The error message string to check for missing permissions. Returns: list: The matching permission names if found, otherwise an empty list. """ permission_names = [] permissions_to_check = set(REQUIRED_ROLE_PERMISSIONS) for permission in permissions_to_check: if permission.lower() in error_msg.lower(): demisto.debug(f"Found missing permission via fallback search: {permission}") permission_names.append(permission) if not permission_names: permission_names.append("N/A") return permission_names def format_rule(rule_json: dict | list, security_rule_name: str): """ Format the rule and create the commandResult object with it Args: rule_json: the json returned from the http_request security_rule_name: the name of the rule Returns: CommandResults for the rule """ # We want to flatten the rules `properties` key as this is the more important key, and we'd like # to be able to display it nicely if isinstance(rule_json, dict): rule_json.update(rule_json.pop("properties", {})) if isinstance(rule_json, list): for rule in rule_json: rule.update(rule.pop("properties", {})) hr = tableToMarkdown(f"Rules {security_rule_name}", rule_json, removeNull=True) return CommandResults(outputs_prefix="Azure.NSGRule", outputs_key_field="id", outputs=rule_json, readable_output=hr) def extract_azure_resource_info(resource_id: str) -> tuple[str | None, str | None, str | None]: """Extract subscription ID, resource group, and account name from Azure resource ID. Args: resource_id: Azure resource ID string Returns: Tuple of (subscription_id, resource_group, account_name) """ patterns = { "subscription_id": r"subscriptions/(.+?)/resourceGroups", "resource_group": r"resourceGroups/(.+?)/providers", "account_name": r"storageAccounts/(.+?)/blobServices", } results = {} for key, pattern in patterns.items(): match = re.search(pattern, resource_id) results[key] = match.group(1) if match else None return results["subscription_id"], results["resource_group"], results["account_name"] def remove_query_param_from_url(url: str, param: str) -> str: """ Remove a specific query parameter from a given URL and return the updated URL. Args: url (str): The full URL that may contain a query string. param (str): The name of the query parameter to remove. Returns: str: The URL with the specified query parameter removed. If the parameter is not present, the original URL is returned unchanged. """ parsed = urlparse(url) qs = parse_qs(parsed.query) qs.pop(param, None) new_query = urlencode(qs, doseq=True) return urlunparse(parsed._replace(query=new_query)) def update_nic_properties(args: dict, params: dict, properties: dict): """ Updates the properties dictionary of a Network Interface Card (NIC) based on the provided arguments. Args: args (dict): The arguments provided to the command. params (dict): The integration parameters. properties (dict): The current properties of the NIC to be updated. """ subscription_id = get_from_args_or_params(args=args, params=params, key="subscription_id") resource_group_name = get_from_args_or_params(args=args, params=params, key="resource_group_name") remove_network_security_group = arg_to_bool_or_none(args.get("remove_network_security_group")) properties["enableIPForwarding"] = ( argToBoolean(args.get("enable_ip_forwarding")) if args.get("enable_ip_forwarding") is not None else properties.get("enableIPForwarding") ) properties["enableAcceleratedNetworking"] = ( argToBoolean(args.get("enable_accelerate_networking")) if args.get("enable_accelerate_networking") is not None else properties.get("enableAcceleratedNetworking") ) properties["auxiliaryMode"] = args.get("auxiliary_mode") or properties.get("auxiliaryMode") properties["auxiliarySku"] = args.get("auxiliary_sku") or properties.get("auxiliarySku") properties["nicType"] = args.get("nic_type") or properties.get("nicType") nsg_prefix = ( f"/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Network" f"/networkSecurityGroups/" ) properties["networkSecurityGroup"] = { "id": f'{nsg_prefix}{args.get("network_security_group_name")}' if args.get("network_security_group_name") else properties.get("networkSecurityGroup", {}).get("id") } internal_dns_name_label = args.get("internal_dns_name_label") dns_servers = args.get("dns_servers") dns_arr = [internal_dns_name_label, dns_servers] if "dnsSettings" not in properties and any(x is not None for x in dns_arr): properties["dnsSettings"] = {} if internal_dns_name_label: properties["dnsSettings"]["internalDnsNameLabel"] = internal_dns_name_label if dns_servers: properties["dnsSettings"]["dnsServers"] = argToList(dns_servers) if remove_network_security_group: demisto.debug(f"Removing the network security group {properties.get('networkSecurityGroup')}") properties.pop("networkSecurityGroup", None) """ COMMAND FUNCTIONS """ def update_security_rule_command(client: AzureClient, params: dict, args: dict) -> CommandResults: """ Update an existing rule. As I couldn't find a way to just update specific fields, the command gets the existing rule, then updates the wanted fields and sends that as a "new" rule. This will update the rule and not create a new rule. Args: client: The MS Client params: configuration parameters args: args dictionary. Returns: an updated rule """ security_group_name = args.get("security_group_name", "") security_rule_name = args.get("security_rule_name", "") direction = args.get("direction", "") action = args.get("action", "") protocol = args.get("protocol", "") source = args.get("source", "") source_ports = args.get("source_ports", "") destination = args.get("destination", "") destination_ports = args.get("destination_ports", "") priority = args.get("priority", "") description = args.get("description", "") access = args.get("access", "") subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") rule = client.get_rule( security_group=security_group_name, rule_name=security_rule_name, subscription_id=subscription_id, resource_group_name=resource_group_name, ) properties = rule.get("properties") updated_properties = assign_params( protocol="*" if protocol == "Any" else protocol, access=access or action, priority=priority, direction=direction, description=description, ) if source_ports: source_ports_list = argToList(source_ports) if len(source_ports_list) > 1: properties.pop("sourcePortRange", None) # Can't supply both sourcePortRange and sourcePortRanges updated_properties["sourcePortRanges"] = source_ports_list else: properties.pop("sourcePortRanges", None) # Can't supply both sourcePortRange and sourcePortRanges updated_properties["sourcePortRange"] = source_ports if destination_ports: dest_ports_list = argToList(destination_ports) if len(dest_ports_list) > 1: properties.pop("destinationPortRange", None) # Can't supply both destinationPortRange,destinationPortRanges updated_properties["destinationPortRanges"] = dest_ports_list else: properties.pop("destinationPortRanges", None) # Can't supply destinationPortRange and destinationPortRanges updated_properties["destinationPortRange"] = destination_ports if destination: dest_list = argToList(destination) if len(dest_list) > 1: properties.pop("destinationAddressPrefix", None) # Can't supply both destinationAddressPrefix and # destinationAddressPrefix updated_properties["destinationAddressPrefixes"] = dest_list else: properties.pop("destinationAddressPrefixes", None) # Can't supply both # destinationAddressPrefixes, destinationAddressPrefixes updated_properties["destinationAddressPrefix"] = "*" if destination == "Any" else destination if source: source_list = argToList(source) if len(source_list) > 1: properties.pop("sourceAddressPrefix", None) # Can't supply both sourceAddressPrefixes, sourceAddressPrefix updated_properties["sourceAddressPrefixes"] = source_list else: properties.pop("sourceAddressPrefixes", None) # Can't supply both sourceAddressPrefixes,sourceAddressPrefix updated_properties["sourceAddressPrefix"] = "*" if source == "Any" else source properties.update(updated_properties) rule = client.create_or_update_rule( security_group=security_group_name, rule_name=security_rule_name, properties=properties, subscription_id=subscription_id, resource_group_name=resource_group_name, ) outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(demisto.command(), "Azure.VirtualNetworks.SecurityRules") if outputs_prefix != "Azure.VirtualNetworks.SecurityRules": return format_rule(rule, security_rule_name) hr = tableToMarkdown(f"Rule {security_rule_name} updated successfully", rule, removeNull=True) return CommandResults(outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=rule, readable_output=hr) def storage_account_update_command(client: AzureClient, params: dict, args: dict) -> CommandResults | str: """ Creates or updates a given storage account. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments, (like account name). Returns: CommandResults: The command results in MD table and context data. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") # subscription_id = args.get("subscription_id") # resource_group_name = args.get("resource_group_name") response = client.storage_account_update_request( subscription_id=subscription_id, resource_group_name=resource_group_name, args=args ) if not response.text: return f"The request was accepted - the account {args.get('account_name')} will be created shortly." response = response.json() readable_output = { "Account Name": response.get("name"), "Subscription ID": subscription_id, "Resource Group": resource_group_name, "Network Ruleset Bypass": response.get("properties", {}).get("networkAcls", {}).get("bypass") if args.get("network_ruleset_bypass") else None, "Default Action": response.get("properties", {}).get("networkAcls", {}).get("defaultAction") if args.get("network_ruleset_default_action") else None, "Allow Cross Tenant Replication": response.get("properties", {}).get("allowCrossTenantReplication") if args.get("allow_cross_tenant_replication") else None, "Supports Https Traffic Only": response.get("properties", {}).get("supportsHttpsTrafficOnly") if args.get("supports_https_traffic_only") else None, } return CommandResults( outputs_prefix="Azure.Storage.StorageAccounts", outputs_key_field="id", outputs=response, readable_output=tableToMarkdown( "Azure Storage Account", readable_output, [ "Account Name", "Subscription ID", "Resource Group", "Network Ruleset Bypass", "Default Action", "Allow Cross Tenant Replication", "Supports Https Traffic Only", ], removeNull=True, ), raw_response=response, ) def storage_blob_service_properties_set_command(client: AzureClient, params: dict, args: dict): """ Sets the blob service properties for the storage account. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments, (like account name). Returns: CommandResults: The command results in MD table and context data. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") delete_retention_policy_enabled = args.get("delete_retention_policy_enabled", args.get("delete_rentention_policy_enabled")) delete_retention_policy_days = args.get("delete_retention_policy_days", args.get("delete_rentention_policy_days")) account_name = args.get("account_name", "") response = client.storage_blob_service_properties_set_request( subscription_id, resource_group_name, account_name, delete_retention_policy_enabled, delete_retention_policy_days ) readable_output = { "Name": response.get("name"), "ID": response.get("id"), "Delete Retention Policy": response.get("properties", {}).get("deleteRetentionPolicy") if delete_retention_policy_enabled is not None or delete_retention_policy_days is not None else None, } command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.Storage.BlobServices") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=response, readable_output=tableToMarkdown( "Updated Azure Storage Blob Service Properties", readable_output, ["Name", "ID", "Delete Retention Policy"], removeNull=True, ), raw_response=response, ) def storage_blob_containers_update_command(client: AzureClient, params: dict, args: dict): """ Updates a given blob container. Args: client: The Microsoft client. params: The configuration parameters. args: User-provided arguments, such as the account name and container name. Returns: CommandResults: The command results, including the Markdown table and context data. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") response = client.storage_blob_containers_create_update_request( subscription_id=subscription_id, resource_group_name=resource_group_name, args=args, method="PATCH" ) subscription_id, resource_group, account_name = extract_azure_resource_info(response.get("id", "")) readable_output = { "Name": response.get("name", ""), "Account Name": account_name, "Subscription ID": subscription_id, "Resource Group": resource_group, "Public Access": response.get("properties", {}).get("publicAccess"), } command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.Storage.BlobContainers") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=response, raw_response=response, readable_output=tableToMarkdown( name="Azure Storage Blob Containers Properties", t=readable_output, headers=["Name", "Account Name", "Subscription ID", "Resource Group", "Public Access"], removeNull=True, ), ) def storage_blob_service_properties_get_command(client: AzureClient, params: dict, args: dict): """ Gets the blob service properties for the storage account. Args: client: The AzureClient client. params: The configuration parameters. args: User-provided arguments, such as the account name and container name. Returns: CommandResults: The command results, including the Markdown table and context data. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") account_name = args.get("account_name", "") response = client.storage_blob_service_properties_get_request( account_name=account_name, resource_group_name=resource_group_name, subscription_id=subscription_id ) subscription_id, resource_group, account_name = extract_azure_resource_info(response.get("id", "")) readable_output = { "Name": response.get("name", ""), "Account Name": account_name, "Subscription ID": subscription_id, "Resource Group": resource_group, "Change Feed": response.get("properties", {}).get("changeFeed", {}).get("enabled", ""), "Delete Retention Policy": response.get("properties", {}).get("deleteRetentionPolicy", {}).get("enabled", ""), "Versioning": response.get("properties", {}).get("isVersioningEnabled"), } command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.Storage.BlobServices") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=response, raw_response=response, readable_output=tableToMarkdown( name="Azure Storage Blob Service Properties", t=readable_output, headers=[ "Name", "Account Name", "Subscription ID", "Resource Group", "Change Feed", "Delete Retention Policy", "Versioning", ], removeNull=True, ), ) def storage_container_property_get_command(client: AzureClient, params: dict, args: dict) -> CommandResults: """ Gets the properties of a storage container. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments. Returns: CommandResults: The command results in MD table and context data. """ container_name = args["container_name"] account_name = args.get("account_name", "") response = client.get_storage_container_properties_request(account_name, container_name) raw_response = response.headers raw_response = dict(raw_response) # Convert raw_response from 'CaseInsensitiveDict' to 'dict' outputs = {} outputs["ContainerName"] = container_name outputs["Property"] = raw_response readable_output = tableToMarkdown( f"Container {container_name} Properties:", outputs.get("Property"), headerTransform=string_to_table_header, removeNull=True, ) return CommandResults( readable_output=readable_output, outputs_prefix="Azure.Storage.Container", outputs_key_field="ContainerName", outputs=outputs, raw_response=raw_response, ) def storage_container_create_command(client: AzureClient, params: dict, args: dict) -> CommandResults: """ Create a new Container under the specified account. Args: client (Client): Azure Blob Storage API client. args (dict): Command arguments. Returns: CommandResults: outputs, readable outputs and raw response. """ container_name = args["container_name"] account_name = args.get("account_name", "") container_name_regex = "^[a-z0-9](?!.*--)[a-z0-9-]{1,61}[a-z0-9]$" # Rules for naming containers can be found here: # https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata if not re.search(container_name_regex, container_name): raise Exception("The specified container name is invalid.") client.create_storage_container_request(container_name, account_name) return CommandResults( readable_output=f"Container {container_name} successfully created.", ) def storage_container_delete_command(client: AzureClient, params: dict, args: dict) -> CommandResults: """ Delete Container under the specified account. Args: client (Client): Azure Blob Storage API client. args (dict): Command arguments Returns: CommandResults: outputs, readable outputs and raw response. """ container_name = args["container_name"] account_name = args.get("account_name", "") client.delete_storage_container_request(container_name, account_name) return CommandResults( readable_output=f"Container {container_name} successfully deleted.", ) def storage_container_blob_create_command(client: AzureClient, params: dict, args: Dict[str, Any]) -> CommandResults: """ Create a new Blob under the specified Container. Args: client (Client): Azure Blob Storage API client. args (dict): Command arguments. Returns: CommandResults: outputs, readable outputs and raw response. """ container_name = args["container_name"] account_name = args.get("account_name", "") file_entry_id = args["file_entry_id"] blob_name = args.get("blob_name", "") file_data = demisto.getFilePath(file_entry_id) # Retrieve system file path and name, given file entry ID. system_file_path = file_data["path"] file_name = blob_name if blob_name else file_data["name"] client.storage_container_create_blob_request(container_name, account_name, file_entry_id, file_name, system_file_path) # noqa: E501 command_results = CommandResults(readable_output=f"Blob {file_name} successfully created.") return command_results def storage_container_blob_get_command(client: AzureClient, params: dict, args: dict) -> Any: """ Retrieve Blob from Container. Args: client (Client): Azure Blob Storage API client. args (dict): Command arguments. Returns: fileResult: File Result. """ container_name = args["container_name"] blob_name = args["blob_name"] account_name = args.get("account_name", "") response = client.storage_container_blob_get_request(container_name, blob_name, account_name) if hasattr(response, "content"): return fileResult(filename=blob_name, data=response.content) # type: ignore[attr-defined] else: raise DemistoException(f"Failed to get content from response for blob {blob_name}") def storage_container_blob_tag_get_command(client: AzureClient, params: dict, args: dict): """ Gets the tags of a blob from the storage container. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments. Returns: CommandResults: The command results in MD table and context data. """ container_name = args["container_name"] blob_name = args["blob_name"] account_name = args.get("account_name", "") response = client.storage_container_blob_tag_get_request(container_name, blob_name, account_name) tree = ET.ElementTree(defused_ET.fromstring(response)) root = tree.getroot() raw_response = [] outputs = {"name": container_name, "Blob": {"name": blob_name}} for element in root.iter("Tag"): tag = {"Key": element.findtext("Key"), "Value": element.findtext("Value")} raw_response.append(dict(tag)) outputs["Blob"]["Tag"] = raw_response readable_output = tableToMarkdown( f"Blob {blob_name} Tags:", outputs["Blob"]["Tag"], headers=["Key", "Value"], headerTransform=pascalToSpace ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.Storage.Blob") if command != "azure-storage-container-blob-tag-get": outputs["Blob"]["ContainerName"] = outputs.pop("name") outputs = outputs.get("Blob", {}) demisto.debug(f"The {command=} name was used, updated the outputs accordingly.") return CommandResults( readable_output=readable_output, outputs_prefix=outputs_prefix, outputs_key_field="name", outputs=outputs, raw_response=raw_response, ) def create_set_tags_request_body(tags: dict) -> bytes: """ Create XML request body for set blob tags. Args: tags (dict): Tags data. Key represents tag name , and value represents tag Value. Returns: str: Set tags request body. """ tags_element = ET.Element("Tags") tag_set_element = ET.SubElement(tags_element, "TagSet") for key, value in tags.items(): tag_element = ET.SubElement(tag_set_element, "Tag") ET.SubElement(tag_element, "Key").text = key ET.SubElement(tag_element, "Value").text = value return ET.tostring(tags_element, encoding="utf-8", xml_declaration=True) def storage_container_blob_tag_set_command(client: AzureClient, params: dict, args: dict): """ Sets the tags for the specified Blob. Args: client (Client): Azure Blob Storage API client. args (dict): Command arguments. Returns: CommandResults: outputs, readable outputs and raw response """ account_name = args.get("account_name", "") container_name = args["container_name"] blob_name = args["blob_name"] tags = args["tags"] append_tags = argToBoolean(args.get("append", False)) try: tags = json.loads(tags) demisto.debug(f"{tags=}") except ValueError: raise ValueError("Failed to parse tags argument. Please provide valid JSON format tags data.") if append_tags: results = storage_container_blob_tag_get_command(client, params, args) original_tags = results.outputs["Tag"] demisto.debug(f"Appending the new tags to {original_tags=}") dict_original_tags = {tag["Key"]: tag["Value"] for tag in original_tags} dict_original_tags.update(tags) tags = dict_original_tags demisto.debug(f"After the append {tags=}") xml_data = create_set_tags_request_body(tags) client.storage_container_blob_tags_set_request(container_name, blob_name, xml_data, account_name) command_results = CommandResults( readable_output=f"{blob_name} Tags successfully updated.", ) return command_results def convert_dict_time_format(data: dict, keys: list, date_format=DATE_FORMAT): """ Convert dictionary data values time format. Args: data (dict): Data. keys (list): Keys list to convert """ for key in keys: if data.get(key): time_value = datetime.strptime(data.get(key), date_format) # type: ignore iso_time = FormatIso8601(time_value) data[key] = iso_time def storage_container_blob_property_get_command(client: AzureClient, params: dict, args: dict) -> CommandResults: """ Retrieve Blob properties. Args: client (Client): Azure Blob Storage API client. args (dict): Command arguments. Returns: CommandResults: outputs, readable outputs and raw response. """ container_name = args["container_name"] blob_name = args["blob_name"] account_name = args.get("account_name", "") response = client.storage_container_blob_property_get_request(container_name, blob_name, account_name) if not hasattr(response, "headers"): raise DemistoException(f"Failed to get headers from response for blob {blob_name}") raw_response = response.headers # type: ignore[attr-defined] raw_response = dict(raw_response) # Convert raw_response from 'CaseInsensitiveDict' to 'dict' outputs = {} outputs["name"] = container_name outputs["Blob"] = {"name": blob_name, "Property": raw_response} readable_output = tableToMarkdown( f"Blob {blob_name} Properties:", outputs.get("Blob").get("Property"), # type: ignore headerTransform=string_to_table_header, removeNull=True, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.Storage.Blob") if command != "azure-storage-container-blob-property-get": outputs["Blob"]["ContainerName"] = outputs.pop("name") outputs = outputs.get("Blob", {}) demisto.debug(f"The new {command=} name was used, updated the outputs accordingly.") return CommandResults( readable_output=readable_output, outputs_prefix=outputs_prefix, outputs_key_field="name", outputs=outputs, raw_response=raw_response, ) def storage_container_blob_property_set_command(client: AzureClient, params: dict, args: dict): """ Set Blob properties. Args: client (Client): Azure Blob Storage API client. args (dict): Command arguments. Returns: CommandResults: outputs, readable outputs and raw response. """ container_name = args["container_name"] blob_name = args["blob_name"] content_type = args.get("content_type", "") content_md5 = args.get("content_md5", "") content_encoding = args.get("content_encoding", "") content_language = args.get("content_language", "") content_disposition = args.get("content_disposition", "") cache_control = args.get("cache_control", "") request_id = args.get("request_id", "") lease_id = args.get("lease_id", "") account_name = args.get("account_name", "") headers = remove_empty_elements( { "x-ms-blob-cache-control": cache_control, "x-ms-blob-content-type": content_type, "x-ms-blob-content-md5": content_md5, "x-ms-blob-content-encoding": content_encoding, "x-ms-blob-content-language": content_language, "x-ms-blob-content-disposition": content_disposition, "x-ms-client-request-id": request_id, "x-ms-lease-id": lease_id, "Content-Length": "0", } ) client.storage_container_blob_properties_set_request(container_name, blob_name, account_name, headers) command_results = CommandResults( readable_output=f"Blob {blob_name} properties successfully updated.", ) return command_results def storage_container_block_public_access_command(client: AzureClient, params: dict, args: dict): """ Block container's public access. Args: client (Client): Azure Blob Storage API client. args (dict): Command arguments Returns: CommandResults: outputs and raw response. """ account_name = args.get("account_name", "") container_name = args.get("container_name", "") response = client.storage_container_block_public_access_request(account_name, container_name) demisto.debug(f"Response from block public access API:- {response}") command_results = CommandResults( readable_output=f"Public access to container '{container_name}' has been successfully blocked", ) return command_results def create_policy_assignment_command(client: AzureClient, params: dict, args: dict): """ Creates a policy assignment. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments. Returns: CommandResults: The command results in MD table and context data. """ name = args.get("name", "") scope = args.get("scope", "") policy_definition_id: str = args.get("policy_definition_id", "") display_name = args.get("display_name", "") parameters = json.loads(args.get("parameters", "{}")) description = args.get("description", "") response = client.create_policy_assignment(name, policy_definition_id, display_name, parameters, description, scope) outputs = [ { "Name": response.get("name"), "Policy Definition ID": response.get("properties", {}).get("policyDefinitionId", ""), "Display Name": response.get("properties", {}).get("displayName", ""), "Description": response.get("properties", {}).get("description", ""), "ID": response.get("id"), "Parameters": response.get("properties", {}).get("parameters") if parameters else None, } ] md = tableToMarkdown( f"Azure policy assignment {name} was successfully created.", outputs, ["ID", "Name", "Policy Definition ID", "Display Name", "Description", "Parameters"], removeNull=True, ) return CommandResults( outputs_prefix="Azure.Policy.PolicyAssignments", outputs_key_field="id", outputs=response, readable_output=md, raw_response=response, ) def set_postgres_config_command(client: AzureClient, params: dict, args: dict): """ Updates a configuration of PostgreSQL server. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments. Returns: CommandResults: The command results in MD table and context data. """ server_name = args.get("server_name", "") subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") configuration_name = args.get("configuration_name", "") source = args.get("source", "") value = args.get("value", "") client.set_postgres_config(server_name, subscription_id, resource_group_name, configuration_name, source, value) return CommandResults(readable_output=f"Updated the configuration {configuration_name} of the server {server_name}.") def set_webapp_config_command(client: AzureClient, params: dict, args: dict): """ Sets WebApp configurations. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments. Returns: CommandResults: The command results in MD table and context data. """ name = args.get("name", "") subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") http20_enabled = args.get("http20_enabled", "") remote_debugging_enabled = args.get("remote_debugging_enabled", "") min_tls_version = args.get("min_tls_version", "") response = client.set_webapp_config( name, subscription_id, resource_group_name, http20_enabled, remote_debugging_enabled, min_tls_version ) outputs = [ { "Name": response.get("name"), "Http20 Enabled": response.get("properties", {}).get("http20Enabled", "") if http20_enabled else None, "Remote Debugging Enabled": response.get("properties", {}).get("remoteDebuggingEnabled", "") if remote_debugging_enabled else None, "Min Tls Version": response.get("properties", {}).get("minTlsVersion", "") if min_tls_version else None, "ID": response.get("id"), } ] md = tableToMarkdown( f"Web App configuration for {name} was updated successfully.", outputs, ["Name", "Http20 Enabled", "Remote Debugging Enabled", "Min Tls Version", "ID"], removeNull=True, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.AppService.WebAppConfiguration") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=response, readable_output=md, raw_response=response, ) def update_webapp_auth_command(client: AzureClient, params: dict, args: dict): """ Sets WebApp authentication. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments. Returns: CommandResults: The command results in MD table and context data. """ name = args.get("name", "") subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") enabled = args.get("enabled", "") response = client.update_webapp_auth(name, subscription_id, resource_group_name, enabled) demisto.debug("Updated webapp auth settings.") outputs = [ { "Name": name, "Enabled": response.get("properties", {}).get("enabled", "") if enabled else None, "ID": response.get("id"), } ] md = tableToMarkdown( f"Authentication settings for Web App {name} updated successfully.", outputs, ["Name", "Enabled", "ID"], removeNull=True, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.AppService.WebAppAuthSettings") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=response, readable_output=md, raw_response=response, ) def mysql_flexible_server_param_set_command(client: AzureClient, params: dict, args: dict): """ Updates a configuration of MySQL flexible server. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments. Returns: CommandResults: The command results in MD table and context data. """ configuration_name = args.get("configuration_name", "") server_name = args.get("server_name", "") subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") source = args.get("source", "") value = args.get("value", "") client.flexible_server_param_set(server_name, configuration_name, subscription_id, resource_group_name, source, value) return CommandResults(readable_output=f"Updated the configuration {configuration_name} of the server {server_name}.") def monitor_log_profile_update_command(client: AzureClient, params: dict, args: dict): """ Updates a monitor log profile. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments. Returns: CommandResults: The command results in MD table and context data. """ log_profile_name = args.get("log_profile_name", "") location = args.get("location") subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") retention_policy_days = arg_to_number(args.get("retention_policy_days")) retention_policy_enabled = args.get("retention_policy_enabled") current_log_profile = client.get_monitor_log_profile(subscription_id, log_profile_name) current_log_profile["properties"]["retentionPolicy"]["enabled"] = ( retention_policy_enabled if retention_policy_enabled is not None else current_log_profile.get("properties", {}).get("retentionPolicy", {}).get("enabled") ) current_log_profile["properties"]["retentionPolicy"]["days"] = ( retention_policy_days if retention_policy_days else current_log_profile.get("properties", {}).get("retentionPolicy", {}).get("days") ) current_log_profile["location"] = location if location else current_log_profile.get("location") response = client.monitor_log_profile_update(subscription_id, log_profile_name, current_log_profile) outputs = [ { "Name": response.get("name"), "ID": response.get("id"), "Location": response.get("location", "") if location else None, "Retention Policy": response.get("properties", {}).get("retentionPolicy") if (retention_policy_enabled or retention_policy_days) else None, } ] md = tableToMarkdown( f"Log profile {log_profile_name} updated successfully.", outputs, ["Name", "ID", "Location", "Retention Policy"], removeNull=True, ) return CommandResults( outputs_prefix="Azure.Monitor.LogProfiles", outputs_key_field="id", outputs=response, readable_output=md, raw_response=response, ) def disk_update_command(client: AzureClient, params: dict, args: dict): """ Updates a disk. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments. Returns: CommandResults: The command results in MD table and context data. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") disk_name = args.get("disk_name", "") public_network_access = args.get("public_network_access") network_access_policy = args.get("network_access_policy") data_access_auth_mode = args.get("data_access_auth_mode") response = client.disk_update( subscription_id, resource_group_name, disk_name, public_network_access, network_access_policy, data_access_auth_mode ) outputs = [ { "Name": response.get("name"), "ID": response.get("id"), "Public Network Access": response.get("properties", {}).get("publicNetworkAccess") if public_network_access else None, "Network Access Policy": response.get("properties", {}).get("networkAccessPolicy") if network_access_policy else None, "Data Access Auth Mode": response.get("properties", {}).get("dataAccessAuthMode") if data_access_auth_mode else None, } ] md = tableToMarkdown( f"Disk {disk_name} updated successfully.", outputs, ["Name", "ID", "Public Network Access", "Network Access Policy", "Data Access Auth Mode"], removeNull=True, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.Compute.Disks") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=response, readable_output=md, raw_response=response, ) def webapp_update_command(client: AzureClient, params: dict, args: dict): """ Updates an Azure web application with specified settings. Args: client (AzureClient): The Azure client instance. params (dict): Configuration parameters. args (dict): Command arguments including web app name, identity type, HTTPS settings, etc. Returns: CommandResults: The updated web app configuration formatted for display. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") name = args.get("name", "") identity_type = args.get("identity_type") https_only = args.get("https_only") client_cert_enabled = args.get("client_cert_enabled") response = client.webapp_update(subscription_id, resource_group_name, name, identity_type, https_only, client_cert_enabled) outputs = [ { "Name": response.get("name"), "ID": response.get("id"), "Identity": response.get("identity", {}) if identity_type else None, "Https Only": response.get("properties", {}).get("httpsOnly") if https_only else None, "Client Cert Enabled": response.get("properties", {}).get("clientCertEnabled") if client_cert_enabled else None, } ] md = tableToMarkdown( f"Updated the Web App {name}.", outputs, ["Name", "ID", "Identity", "Https Only", "Client Cert Enabled"], removeNull=True, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.AppService.WebApp") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=response, readable_output=md, raw_response=response, ) def acr_update_command(client: AzureClient, params: dict, args: dict): """ Updates an Azure Container Registry with specified settings. Args: client (AzureClient): The Azure client instance. params (dict): Configuration parameters. args (dict): Command arguments including registry name, access settings, etc. Returns: CommandResults: The updated container registry configuration formatted for display. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") registry_name = args.get("registry_name", "") allow_exports = args.get("allow_exports") public_network_access = args.get("public_network_access") anonymous_pull_enabled = args.get("anonymous_pull_enabled") authentication_as_arm_policy = args.get("authentication_as_arm_policy") response = client.acr_update( subscription_id, resource_group_name, registry_name, allow_exports, public_network_access, anonymous_pull_enabled, authentication_as_arm_policy, ) outputs = [ { "Name": response.get("name"), "ID": response.get("id"), "Public Network Access": response.get("properties", {}).get("publicNetworkAccess") if public_network_access else None, "Anonymous Pull Enabled": response.get("properties", {}).get("anonymousPullEnabled") if anonymous_pull_enabled else None, "Allow Exports": response.get("properties", {}).get("policies", {}).get("exportPolicy", {}).get("status") if allow_exports else None, "Authentication As Arm Policy": response.get("properties", {}) .get("policies", {}) .get("azureADAuthenticationAsArmPolicy", {}) .get("status") if authentication_as_arm_policy else None, } ] md = tableToMarkdown( f"Updated the container registry {registry_name}.", outputs, ["Name", "ID", "Public Network Access", "Anonymous Pull Enabled", "Allow Exports", "Authentication As Arm Policy"], removeNull=True, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.ContainerRegistry.Registries") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=response, readable_output=md, raw_response=response, ) def postgres_server_update_command(client: AzureClient, params: dict, args: dict): """ Updates a PostgreSQL server with specified SSL enforcement settings. Args: client (AzureClient): The Azure client instance. params (dict): Configuration parameters. args (dict): Command arguments including server name and SSL enforcement state. Returns: CommandResults: The updated PostgreSQL server configuration. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") server_name = args.get("server_name", "") ssl_enforcement = args.get("ssl_enforcement", "") client.postgres_server_update(subscription_id, resource_group_name, server_name, ssl_enforcement) return CommandResults(readable_output=f"Updated postgreSQL server {server_name}.") def update_key_vault_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]) -> CommandResults: """ updates a key vault. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments. Returns: CommandResults: The command results in MD table and context data. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") vault_name = args.get("vault_name", "") enable_soft_delete = args.get("enable_soft_delete", "") enable_purge_protection = args.get("enable_purge_protection", "") response = client.update_key_vault_request( subscription_id, resource_group_name, vault_name, enable_soft_delete, enable_purge_protection ) outputs = [ { "Name": response.get("name"), "ID": response.get("id"), "Enable Soft Delete": response.get("properties", {}).get("enableSoftDelete") if enable_soft_delete else None, "Enable Purge Protection": response.get("properties", {}).get("enablePurgeProtection") if enable_purge_protection else None, } ] readable_output = tableToMarkdown( f"Updated Key Vault {vault_name}.", outputs, ["ID", "Name", "Enable Soft Delete", "Enable Purge Protection"], removeNull=True, headerTransform=string_to_table_header, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.KeyVault.Vault") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=response, raw_response=response, readable_output=readable_output, ignore_auto_extract=True, ) def sql_db_threat_policy_update_command(client: AzureClient, params: dict[str, Any], args: Dict[str, Any]) -> CommandResults: """ Updates the threat detection policy for a SQL database. Args: client (AzureClient): The Azure client instance. params (dict): Configuration parameters. args (dict): Command arguments including server name, database name, and email settings. Returns: CommandResults: The updated threat detection policy configuration formatted for display. """ server_name = args.get("server_name", "") db_name = args.get("db_name", "") email_account_admins = args.get("email_account_admins_enabled", "") subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") current_db = client.sql_db_threat_policy_get( server_name=server_name, db_name=db_name, subscription_id=subscription_id, resource_group_name=resource_group_name ) current_db["properties"]["emailAccountAdmins"] = email_account_admins or current_db.get("properties", {}).get( "emailAccountAdmins" ) response = client.sql_db_threat_policy_update( server_name=server_name, db_name=db_name, subscription_id=subscription_id, current=current_db, resource_group_name=resource_group_name, ) outputs = [ { "Name": response.get("name"), "ID": response.get("id"), "Email Account Admins": response.get("properties", {}).get("emailAccountAdmins") if email_account_admins else None, } ] readable_output = tableToMarkdown( f"Updated Database Threat Detection Policies for {resource_group_name=}", outputs, ["ID", "Name", "Email Account Admins"], removeNull=True, headerTransform=string_to_table_header, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.SqlDB.SecurityAlertPolicies") return CommandResults( readable_output=readable_output, outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=response, raw_response=response, ) def sql_db_tde_set_command(client: AzureClient, params: dict[str, Any], args: Dict[str, Any]) -> CommandResults: """ Sets the transparent data encryption state for a SQL database. Args: client (AzureClient): The Azure client instance. params (dict): Configuration parameters. args (dict): Command arguments including server name, database name, and TDE state. Returns: CommandResults: A message indicating successful TDE state update. """ server_name = args.get("server_name", "") db_name = args.get("db_name", "") state = args.get("state", "") subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") client.sql_db_tde_set( server_name=server_name, db_name=db_name, subscription_id=subscription_id, state=state, resource_group_name=resource_group_name, ) # CommandResults don't contain the response because it takes time for the resource to be updated. return CommandResults( readable_output=f"Updated SQL database {db_name} of the server {server_name}.", ) def cosmosdb_update_command(client: AzureClient, params: dict[str, Any], args: Dict[str, Any]) -> CommandResults: """ Updates a Cosmos DB account with specified settings. Args: client: The microsoft client. params: The configuration parameters. args: The users arguments. Returns: CommandResults: The command results in MD table and context data. """ account_name = args.get("account_name", "") subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") disable_key_based_metadata_write_access = args.get("disable_key_based_metadata_write_access") response = client.cosmos_db_update( subscription_id, resource_group_name, account_name, disable_key_based_metadata_write_access ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.CosmosDB.DBAccounts") return CommandResults( readable_output=f"Updated Cosmos DB {account_name}.", outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=response, raw_response=response, ) def nsg_security_group_create_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]) -> CommandResults: """ This command will create a network security group. Args: client: The AzureClient params: configuration parameters args: args dictionary. Returns: CommandResults: The network security group that was created. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") security_group_name = args.get("security_group_name", "") location = args.get("location", "") response = client.create_network_security_group( subscription_id=subscription_id, resource_group_name=resource_group_name, security_group_name=security_group_name, location=location, ) demisto.debug(f"Created network security group {response=}") # cleans up the tag, remove the "W/\" prefix and the "\" suffix. response["etag"] = response.get("etag", "")[3:-1] hr = tableToMarkdown( name=f"The network security group {security_group_name} was created successfully", t=response, removeNull=True, headers=["name", "id", "location", "type"], headerTransform=pascalToSpace, ) return CommandResults( outputs_prefix="Azure.VirtualNetworks.SecurityGroups", outputs_key_field="id", outputs=response, readable_output=hr, raw_response=response, ) def nsg_security_groups_list_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]) -> CommandResults: """ List all network security groups. Args: client: The AzureClient params: configuration parameters args: args dictionary. Returns: A detailed list of all network security groups """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") response = client.list_network_security_groups(subscription_id=subscription_id, resource_group_name=resource_group_name) network_groups = response.get("value", []) # cleans up the tag, remove the "W/\" prefix and the "\" suffix. for group in network_groups: group["etag"] = group.get("etag", "")[3:-1] for rule in group.get("defaultSecurityRules", []): rule["etag"] = rule.get("etag", "")[3:-1] hr = tableToMarkdown( name="Network Security Groups", t=network_groups, headers=["name", "id", "type", "etag", "location"], headerTransform=string_to_table_header, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.VirtualNetworks.SecurityGroups") return CommandResults( raw_response=response, outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=network_groups, readable_output=hr, ) def nsg_security_rule_get_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]) -> CommandResults: """ This command will get a rule from a security group. Args: client: The AzureClient params: configuration parameters args: args dictionary. Returns: CommandResults: The rule that was requested """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") security_group_name = args.get("security_group_name", "") security_rule_name = args.get("security_rule_name", "") if not security_rule_name and not security_group_name: return_error("Please provide security_group_name and security_rule_name.") rule = client.get_rule( security_group=security_group_name, rule_name=security_rule_name, subscription_id=subscription_id, resource_group_name=resource_group_name, ) # cleans up the tag, remove the "W/\" prefix and the "\" suffix. rule["etag"] = rule.get("etag", "")[3:-1] hr = tableToMarkdown( name=f"Rule {security_rule_name}", t=rule, removeNull=True, headers=["name", "id", "etag", "type"], headerTransform=pascalToSpace, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.VirtualNetworks.SecurityRules") return CommandResults(outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=rule, readable_output=hr) def nsg_security_rules_list_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]) -> CommandResults: """ Gets all security rules in a network security group. Args: client: The AzureClient params: configuration parameters args: args dictionary (subscription_id, resource_group_name, network_security_group_name). Returns: CommandResults: The list of security rules. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") network_security_group_name = args.get("network_security_group_name", "") if not resource_group_name and not network_security_group_name: return_error("Please provide security_group_name and security_rule_name.") response = client.list_security_rules(subscription_id, resource_group_name, network_security_group_name) security_rules = response.get("value", []) demisto.debug(f"{security_rules=}") hr_data = [] for rule in security_rules: hr_data.append( { "name": rule.get("name"), "id": rule.get("id"), "direction": rule.get("properties", {}).get("direction"), } ) hr = tableToMarkdown( name="Security Groups List", t=hr_data, removeNull=True, headers=["name", "id", "direction"], headerTransform=pascalToSpace, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.VirtualNetworks.SecurityRules") return CommandResults( outputs=security_rules, readable_output=hr, raw_response=security_rules, outputs_prefix=outputs_prefix, outputs_key_field="id", ) def nsg_security_rule_create_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]) -> CommandResults: """ This command will create a rule in a security group. Args: client: The AzureClient params: configuration parameters args: args dictionary. Returns: CommandResults: The rule that was created. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") security_group_name = args.get("security_group_name", "") security_rule_name = args.get("security_rule_name", "") direction = args.get("direction", "") # required in API priority = args.get("priority", "") # required in API action = args.get("action", "Allow") # required in API, named as "access" in the API access = args.get("access") or action # required in API, named as "access" in the API protocol = args.get("protocol", "Any") # required in API source = args.get("source", "Any") source_ports = args.get("source_ports", "*") destination = args.get("destination", "Any") destination_ports = args.get("destination_ports", "*") description = args.get("description", "") if not security_rule_name and not security_group_name and not direction and not priority: return_error("Please provide security_group_name, security_rule_name, direction and priority.") # The reason for using 'Any' as default instead of '*' is to adhere to the standards in the UI. properties = { "protocol": "*" if protocol == "Any" else protocol, "access": access, "priority": priority, "direction": direction, } source_ports_list = argToList(source_ports) if len(source_ports_list) > 1: properties["sourcePortRanges"] = source_ports_list else: properties["sourcePortRange"] = source_ports dest_ports_list = argToList(destination_ports) if len(dest_ports_list) > 1: properties["destinationPortRanges"] = dest_ports_list else: properties["destinationPortRange"] = destination_ports source_list = argToList(source) if len(source_list) > 1: properties["sourceAddressPrefixes"] = source_list else: properties["sourceAddressPrefix"] = "*" if source == "Any" else source dest_list = argToList(destination) if len(dest_list) > 1: properties["destinationAddressPrefixes"] = dest_list else: properties["destinationAddressPrefix"] = "*" if destination == "Any" else destination if description: properties["description"] = description rule = client.create_or_update_rule( security_group=security_group_name, rule_name=security_rule_name, properties=properties, subscription_id=subscription_id, resource_group_name=resource_group_name, ) # cleans up the tag, remove the "W/\" prefix and the "\" suffix. rule["etag"] = rule.get("etag", "")[3:-1] hr = tableToMarkdown( name=f"The security rule {security_rule_name} was created successfully", t=rule, removeNull=True, headerTransform=pascalToSpace, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.VirtualNetworks.SecurityRules") return CommandResults(outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=rule, readable_output=hr) def nsg_security_rule_delete_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]) -> CommandResults: """ Deletes a rule from a security group Args: client: The AzureClient params: configuration parameters args: args dictionary. Returns: Message that the rule was deleted. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") security_group_name = args.get("security_group_name", "") security_rule_name = args.get("security_rule_name", "") if not security_rule_name and not security_group_name: return_error("Please provide security_group_name and security_rule_name.") rule_deleted = client.delete_rule( security_group_name=security_group_name, security_rule_name=security_rule_name, subscription_id=subscription_id, resource_group_name=resource_group_name, ) message = "" if rule_deleted.status_code == 204: message = ( f"Rule {security_rule_name} with resource_group_name " f"{resource_group_name} and subscription id {subscription_id} was not found." ) elif rule_deleted.status_code == 200: message = ( f"Rule {security_rule_name} with resource_group_name " f"{resource_group_name} and subscription id {subscription_id} " f"was successfully deleted." ) elif rule_deleted.status_code == 202: message = ( f"The delete request for rule {security_rule_name} with resource_group_name" f"{resource_group_name} and subscription id {subscription_id} " f"was accepted and the operation will complete asynchronously." ) return CommandResults(readable_output=message) def nsg_resource_group_list_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]) -> CommandResults: """ List all resource groups in the subscription. Args: client (AzureClient): Azure Client. args (Dict[str, Any]): command arguments. params (Dict[str, Any]): configuration parameters. Returns: Command results with raw response, outputs and readable outputs. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") filter_by_tag = azure_tag_formatter(args.get("tag")) if args.get("tag") else "" limit = args.get("limit", DEFAULT_LIMIT) response = client.list_resource_groups_request(subscription_id=subscription_id, filter_by_tag=filter_by_tag, limit=limit) data_from_response = response.get("value", []) readable_output = tableToMarkdown( name="Resource Groups List", t=data_from_response, headers=["name", "location", "tags", "provisioningState"], removeNull=True, headerTransform=string_to_table_header, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.ResourceManagement.ResourceGroups") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=data_from_response, raw_response=response, readable_output=readable_output, ) def nsg_network_interfaces_list_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]) -> CommandResults: """ List all network interfaces in a resource group. Args: client (AzureClient): Azure Client. args (Dict[str, Any]): command arguments. params (Dict[str, Any]): configuration parameters. Returns: Command results with raw response, outputs and readable outputs. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") all_results = argToBoolean(args.get("all_results", "false")) limit = arg_to_number(args.get("limit", DEFAULT_LIMIT)) response = client.list_networks_interfaces_request(subscription_id=subscription_id, resource_group_name=resource_group_name) data_from_response = response.get("value", []) if not all_results: data_from_response = data_from_response[:limit] # cleans up the tag, remove the "W/\" prefix and the "\" suffix. for data in data_from_response: data["etag"] = data.get("etag", "")[3:-1] readable_output = tableToMarkdown( name="Network Interfaces List", t=data_from_response, headers=["name", "id", "type", "etag", "location", "kind"], removeNull=True, headerTransform=pascalToSpace, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.VirtualNetworks.NetworkInterfaces") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=data_from_response, raw_response=response, readable_output=readable_output, ) def nsg_public_ip_addresses_list_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]) -> CommandResults: """ List all network interfaces in a resource group. Args: client (AzureClient): Azure client. args (Dict[str, Any]): command arguments. params (Dict[str, Any]): configuration parameters. Returns: Command results with raw response, outputs and readable outputs. """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") resource_group_name = get_from_args_or_params(params=params, args=args, key="resource_group_name") all_results = argToBoolean(args.get("all_results", "false")) limit = arg_to_number(args.get("limit", DEFAULT_LIMIT)) response = client.list_public_ip_addresses_request(subscription_id=subscription_id, resource_group_name=resource_group_name) data_from_response = response.get("value", []) if not all_results: data_from_response = data_from_response[:limit] # cleans up the tag, remove the "W/\" prefix and the "\" suffix. for output in data_from_response: output["etag"] = output.get("etag", "")[3:-1] readable_output = tableToMarkdown( name="Public IP Addresses List", t=data_from_response, headers=["name", "id", "etag", "provisioningState", "publicIPAddressVersion", "ipAddress", "domainNameLabel", "fqdn"], removeNull=True, headerTransform=pascalToSpace, ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.VirtualNetworks.PublicIPAddresses") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=data_from_response, raw_response=response, readable_output=readable_output, ) def remove_member_from_role(client: AzureClient, args: dict) -> CommandResults: """Currently not supported in the integration Remove a member from a group by group id and user id. Args: client: Client object with request args: Usually demisto.args() Returns: Outputs. """ role_object_id = str(args.get("role_id")) user_id = str(args.get("user_id")) client.remove_member_from_role(role_object_id, user_id) return CommandResults(readable_output=f"User ID {user_id} has been removed from role {role_object_id}") def remove_member_from_group_command(client: AzureClient, args: dict) -> CommandResults: """Currently not supported in the integration Remove a member from a group by group id and user id. Args: client: Client object with request args: Usually demisto.args() Returns: Outputs. """ group_id = str(args.get("group_id")) user_id = str(args.get("user_id")) client.remove_member_from_group(group_id, user_id) human_readable = f'User {user_id} was removed from the Group "{group_id}" successfully.' return CommandResults(readable_output=human_readable) def start_vm_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]): """ Initiates the power-on operation for a specific Azure Virtual Machine (VM). This function validates the VM's provisioning state and then requests Azure to start the VM. Args: client (AzureClient): The authenticated Azure client used to make API requests. params (dict): Integration or instance-level parameters containing default values. args (dict): Command arguments. Returns: CommandResults: A CommandResults object indicating that the power-on operation has been successfully initiated. """ subscription_id = get_from_args_or_params(args=args, params=params, key="subscription_id") resource_group_name = get_from_args_or_params(args=args, params=params, key="resource_group_name") vm_name = args.get("virtual_machine_name", "") client.validate_provisioning_state(subscription_id, resource_group_name, vm_name) client.start_vm_request(subscription_id, resource_group_name, vm_name) vm_name = vm_name.lower() # type: ignore vm = {"name": vm_name, "resourceGroup": resource_group_name, "powerState": "VM starting"} title = f'Power-on of Virtual Machine "{vm_name}" Successfully Initiated' human_readable = tableToMarkdown(title, vm, removeNull=True, headerTransform=pascalToSpace) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.Compute.VirtualMachines") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="name", outputs=vm, readable_output=human_readable, raw_response=vm, ) def poweroff_vm_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]): """ Initiates the power-off operation for a specific Azure Virtual Machine (VM). This function validates the VM's provisioning state and then requests Azure to stop the VM, optionally skipping the guest OS shutdown. Args: client (AzureClient): The authenticated Azure client used to make API requests. params (dict): Integration or instance-level parameters containing default values. args (dict): Command arguments. Returns: CommandResults: A CommandResults object indicating that the power-off operation has been successfully initiated. """ subscription_id = get_from_args_or_params(args=args, params=params, key="subscription_id") resource_group_name = get_from_args_or_params(args=args, params=params, key="resource_group_name") vm_name = args.get("virtual_machine_name", "") skip_shutdown = argToBoolean(args.get("skip_shutdown", False)) client.validate_provisioning_state(subscription_id, resource_group_name, vm_name) client.poweroff_vm_request(subscription_id, resource_group_name, vm_name, skip_shutdown) vm_name = vm_name.lower() # type: ignore vm = {"name": vm_name, "resourceGroup": resource_group_name, "powerState": "VM stopping"} title = f'Power-off of Virtual Machine "{vm_name}" Successfully Initiated' human_readable = tableToMarkdown(name=title, t=vm, removeNull=True, headerTransform=pascalToSpace) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.Compute.VirtualMachines") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="name", outputs=vm, readable_output=human_readable, raw_response=vm, ) def get_vm_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]): """ Retrieves details for a specific Azure Virtual Machine (VM). This function fetches configuration, storage, networking, and state information for a given virtual machine within a specified resource group. Args: client (AzureClient): The authenticated Azure client used to make API requests. params (dict): Integration or instance-level parameters containing default values. args (dict): Command arguments. Returns: CommandResults: A CommandResults object containing the Virtual Machine configuration details. """ subscription_id = get_from_args_or_params(args=args, params=params, key="subscription_id") resource_group_name = get_from_args_or_params(args=args, params=params, key="resource_group_name") vm_name = args.get("virtual_machine_name", "") response = client.get_vm_request(subscription_id, resource_group_name, vm_name, expand=args.get("expand", "")) properties = response.get("properties") os_disk = properties.get("storageProfile", {}).get("osDisk", {}) statuses = properties.get("instanceView", {}).get("statuses", []) power_state = None for status in statuses: status_code = status.get("code") status_code_prefix = status_code[: status_code.find("/")] if status_code_prefix == "PowerState": power_state = status.get("displayStatus") vm = { "Name": vm_name.lower(), # type: ignore "ID": properties.get("vmId"), "Size": os_disk.get("diskSizeGB", "NA"), "OS": os_disk.get("osType"), "ProvisioningState": properties.get("provisioningState"), "Location": response.get("location"), "PowerState": power_state, "ResourceGroup": resource_group_name, "NetworkInterfaces": properties.get("networkProfile", {}).get("networkInterfaces"), "UserData": properties.get("userData"), "Tags": response.get("tags"), } title = f'Properties of VM "{vm_name}"' table_headers = ["Name", "ID", "Size", "OS", "ProvisioningState", "Location", "PowerState"] human_readable = tableToMarkdown(title, vm, headers=table_headers, removeNull=True, headerTransform=pascalToSpace) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.Compute.VirtualMachines") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="name", outputs=response, readable_output=human_readable, raw_response=response, ) def list_vm_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]) -> CommandResults: """ Lists all virtual machines in a resource group. Args: client (AzureClient): The authenticated Azure client used to make API requests. params (dict): Integration or instance-level parameters containing default values. args (dict): Command arguments. Returns: CommandResults: A CommandResults object containing the list of Virtual Machines. """ subscription_id = get_from_args_or_params(args=args, params=params, key="subscription_id") resource_group_name = get_from_args_or_params(args=args, params=params, key="resource_group_name") next_token = args.get("next_token", "") demisto.debug(f"[Azure] args being sent to list_vm_request {subscription_id=} {resource_group_name=}") response = client.list_vm_request(subscription_id, resource_group_name, next_token) demisto.debug(f"[Azure] list_vm_request response={response} end response.") vms_list = response.get("value", []) if not vms_list: return CommandResults(readable_output="No Virtual Machines found.") outputs = { "Azure.Compute.VirtualMachines(val.id && val.id == obj.id)": vms_list, "Azure.Compute(true)": {"VirtualMachinesNextToken": response.get("nextLink")}, } title = "The list of Virtual Machines" headers = ["name", "id", "location"] human_readable = tableToMarkdown(title, vms_list, headers=headers, removeNull=True, headerTransform=pascalToSpace) demisto.debug(f"[Azure] list_vm_request {human_readable=}") return CommandResults( outputs=outputs, readable_output=human_readable, raw_response=response, ) def get_network_interface_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]): """ Retrieves details for a specific Azure Network Interface (NIC). This function fetches configuration, networking, and attachment properties for a given network interface within a specified resource group. Args: client (AzureClient): The authenticated Azure client used to make API requests. params (dict): Integration or instance-level parameters containing default values. args (dict): Command arguments. Returns: CommandResults: A CommandResults object containing the Network Interface configuration details. """ subscription_id = get_from_args_or_params(args=args, params=params, key="subscription_id") resource_group_name = get_from_args_or_params(args=args, params=params, key="resource_group_name") interface_name = args.get("network_interface_name", "") response = client.get_network_interface_request(subscription_id, resource_group_name, interface_name) properties = response.get("properties") ip_configurations = properties.get("ipConfigurations", []) ip_configs = [] for ip_configuration in ip_configurations: ip_configs.append( { "ConfigName": ip_configuration.get("name", "NA"), "ConfigID": ip_configuration.get("id", "NA"), "PrivateIPAddress": ip_configuration.get("properties", {}).get("privateIPAddress", "NA"), "PublicIPAddressID": ip_configuration.get("properties", {}).get("publicIPAddress", {}).get("id"), } ) human_readable_network_config = { "Name": interface_name.lower(), # type: ignore "ID": response.get("id"), "MACAddress": properties.get("macAddress", "NA"), "PrivateIPAddresses": [ip.get("PrivateIPAddress") for ip in ip_configs], "NetworkSecurityGroup": properties.get("networkSecurityGroup", "NA"), "Location": response.get("location"), "NICType": properties.get("nicType", "NA"), "AttachedVirtualMachine": properties.get("virtualMachine", {}).get("id", "NA"), } title = f'Properties of Network Interface "{interface_name.lower()}"' table_headers = [ "Name", "ID", "MACAddress", "PrivateIPAddresses", "NetworkSecurityGroup", "Location", "NICType", "AttachedVirtualMachine", ] human_readable = tableToMarkdown( name=title, t=human_readable_network_config, headers=table_headers, removeNull=True, headerTransform=pascalToSpace ) response["etag"] = response.get("etag", "")[3:-1] for ip_configuration in response.get("properties", {}).get("ipConfigurations", []): ip_configuration["etag"] = ip_configuration.get("etag", "")[3:-1] command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.VirtualNetworks.NetworkInterfaces") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="name", outputs=response, readable_output=human_readable, raw_response=response, ) def network_interface_update_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]) -> CommandResults: """ Updates a specific Azure Network Interface (NIC). This function retrieves the current network interface configuration, updates the specified properties based on user arguments, and sends the full updated object back to Azure. Args: client (AzureClient): The authenticated Azure client used to make API requests. params (dict): Integration or instance-level parameters containing default values. args (dict): Command arguments including: - network_interface_name: Name of the network interface to update (required) - subscription_id: Azure subscription ID - resource_group_name: Resource group containing the network interface - location: The location of the network security group. - enable_ip_forwarding: Enable or disable IP forwarding (true/false) - enable_accelerate_networking: If the network interface is configured for accelerated networking. - auxiliary_mode: Auxiliary mode of Network Interface resource. - auxiliary_sku: Auxiliary sku of Network Interface resource. - dns_servers: Comma-separated list of DNS server IP addresses - internal_dns_name_label: Internal DNS name label for the network interface - network_security_group_name: The name of the network security group. - remove_network_security_group: Whether to remove the property networkSecurityGroup from the network interface. - nic_type: Type of Network Interface resource. Returns: CommandResults: A CommandResults object containing the updated Network Interface configuration details. """ subscription_id = get_from_args_or_params(args=args, params=params, key="subscription_id") resource_group_name = get_from_args_or_params(args=args, params=params, key="resource_group_name") network_interface_name = args.get("network_interface_name", "") location = args.get("location", "") remove_network_security_group = arg_to_bool_or_none(args.get("remove_network_security_group")) if args.get("network_security_group_name") and remove_network_security_group: raise DemistoException("The remove_network_security_group option cannot be used with network_security_group_name.") demisto.debug(f"[Azure] Get the current state of the network interface {network_interface_name}") # Get the current network interface configuration nic = client.get_network_interface_request(subscription_id, resource_group_name, network_interface_name) demisto.debug(f"[Azure] Current network interface: {nic}") # Update properties based on user arguments properties = nic.get("properties", {}) update_nic_properties(args, params, properties) nic["properties"] = remove_empty_elements(properties) nic["location"] = location or nic["location"] demisto.debug(f"[Azure] Updating the network interface {network_interface_name}: {nic}") # Send the updated network interface response = client.update_network_interface_request( subscription_id=subscription_id, resource_group_name=resource_group_name, interface_name=network_interface_name, network_interface_data=nic, ) # Clean up etag format response["etag"] = response.get("etag", "")[3:-1] for ip_configuration in response.get("properties", {}).get("ipConfigurations", []): ip_configuration["etag"] = ip_configuration.get("etag", "")[3:-1] updated_properties = response.get("properties", {}) human_readable_output = { "Name": network_interface_name.lower(), "ID": response.get("id"), "Location": response.get("location"), "NetworkSecurityGroup": updated_properties.get("networkSecurityGroup", {}).get("name") if updated_properties.get("networkSecurityGroup") else None, } title = f'Successfully Updated Network Interface "{network_interface_name.lower()}"' table_headers = [ "Name", "ID", "Location", "NetworkSecurityGroup", ] human_readable = tableToMarkdown( name=title, t=human_readable_output, headers=table_headers, removeNull=True, headerTransform=pascalToSpace ) return CommandResults( outputs_prefix="Azure.VirtualNetworks.NetworkInterfaces", outputs_key_field="id", outputs=response, readable_output=human_readable, raw_response=response, ) def get_single_ip_details_from_list_of_ip_details(list_of_ip_details: list, ip_address): """Finds the associated details of target IP Address from a list of PublicIPAddressListResult objects. Args: list_of_ip_details (list): List of PublicIPAddressListResult objects. ip_address (list | dict): IP Address to search for in list of PublicIPAddressListResult objects. """ def search_entry_for_ip(data, key, value): if isinstance(data, list): for item in data: result = search_entry_for_ip(item, key, value) if result: return result elif isinstance(data, dict): if key in data and data[key] == value: return True for val in data.values(): result = search_entry_for_ip(val, key, value) if result: return result return None for entry in list_of_ip_details: result = search_entry_for_ip(entry, "ipAddress", ip_address) if result: return entry return None def get_public_ip_details_command(client: AzureClient, params: dict[str, Any], args: dict[str, Any]): """ Retrieves details for a specific Azure Public IP address. This function fetches configuration and networking properties for a given Public IP, either within a specified resource group or by searching all IPs under the subscription. Args: client (AzureClient): The authenticated Azure client used to make API requests. params (dict): Integration or instance-level parameters containing default values. args (Dict): Command arguments. Returns: CommandResults: An CommandResults object: Dictionary of the Public IP configuration details """ subscription_id = get_from_args_or_params(args=args, params=params, key="subscription_id") address_name = args.get("address_name", "") if resource_group_name := (args.get("resource_group_name") or params.get("resource_group_name")): response = client.get_public_ip_details_request(subscription_id, resource_group_name, address_name) else: response_for_all_ips = client.get_all_public_ip_details_request(subscription_id).get("value") response = get_single_ip_details_from_list_of_ip_details(response_for_all_ips, address_name) if not response: raise ValueError( f"'{address_name}' was not found. Please try specifying the resource group the IP would be associated with." ) address_id = response.get("id") resource_group_name = address_id.split("resourceGroups/")[1].split("/providers")[0] response["etag"] = response.get("etag", "")[3:-1] properties = response.get("properties") human_readable_ip_config = { "PublicConfigName": response.get("name"), "Location": response.get("location"), "PublicIPAddress": properties.get("ipAddress", "NA"), "PublicIPAddressVersion": properties.get("publicIPAddressVersion", "NA"), "PublicIPAddressAllocationMethod": properties.get("publicIPAllocationMethod", "NA"), "ResourceGroup": resource_group_name, } title = f'Properties of Public Address "{address_name}"' table_headers = [ "PublicConfigName", "Location", "PublicIPAddress", "PublicIPAddressVersion", "PublicIPAddressAllocationMethod", "ResourceGroup", ] human_readable = tableToMarkdown( name=title, t=human_readable_ip_config, headers=table_headers, removeNull=True, headerTransform=pascalToSpace ) command = demisto.command() outputs_prefix = COMMANDS_TO_OUTPUTS_PREFIX.get(command, "Azure.VirtualNetworks.PublicIPAddresses") return CommandResults( outputs_prefix=outputs_prefix, outputs_key_field="id", outputs=response, readable_output=human_readable, raw_response=response, ) def azure_billing_usage_list_command(client: AzureClient, params: dict, args: dict) -> CommandResults: """ Retrieves actual usage and cost details from Azure Consumption API. This command provides detailed billing usage information for Azure resources over a specified time period. It supports filtering by various criteria and includes pagination for large datasets. The command returns usage quantities, costs, and resource details for comprehensive billing analysis. Args: client (AzureClient): Azure client instance for API communication params (dict): Configuration parameters from integration settings args (dict): Command arguments containing: - subscription_id: Azure subscription ID (required) - expand_result: Expand usage details with additional properties - filter: OData filter expression for filtering results - metric: Specific metric to retrieve (e.g., ActualCost, UsageQuantity) - max_results: Maximum number of results to return (default: 50) - next_page_token: Token for pagination Returns: CommandResults: Contains usage data with costs, quantities, and time periods, including pagination support via next page tokens Raises: DemistoException: If Azure API call fails, subscription not found, or invalid parameters provided """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") expand = args.get("expand_result", "") filter_ = args.get("filter", "") metric = args.get("metric", "") max_results = int(args.get("max_results", 50)) next_page_token = args.get("next_page_token", "") res = client.billing_usage_list( subscription_id=subscription_id, expand=expand, filter_=filter_, metric=metric, max_results=max_results, next_page_token=next_page_token, ) items = res.get("value", []) next_token = res.get("nextLink", "") demisto.debug(f"Azure billing usage response - results count: {len(items)},\n nextLink: {bool(next_token)}") results = [] for item in items: start_date = item.get("properties", {}).get("billingPeriodStartDate") end_date = item.get("properties", {}).get("billingPeriodEndDate") results.append( { "Name": item.get("name"), "Product": item.get("properties", {}).get("product"), "PayGCostUSD": item.get("properties", {}).get("payGPrice"), "UsageQuantity": item.get("properties", {}).get("quantity"), "PeriodStartDate": datetime.strptime(start_date, "%Y-%m-%dT%H:%M:%S.%f0Z").strftime("%Y-%m-%d"), "PeriodEndDate": datetime.strptime(end_date, "%Y-%m-%dT%H:%M:%S.%f0Z").strftime("%Y-%m-%d"), } ) metadata = ( "Run the following command to retrieve the next batch of billings:\n" f"!azure-billing-usage-list subscription_id={subscription_id} next_page_token={next_token}" if next_token else None ) readable_output = tableToMarkdown( "Azure Billing Usage", results, headers=["Name", "Product", "PayGCostUSD", "UsageQuantity", "PeriodStartDate", "PeriodEndDate"], headerTransform=pascalToSpace, metadata=metadata, ) outputs = { "Azure.Billing.Usage(val.name && val.name == obj.name)": items, "Azure.Billing(true)": {"UsageNextToken": next_token}, } return CommandResults( readable_output=readable_output, outputs=outputs, raw_response=res, ) def azure_billing_forecast_list_command(client: AzureClient, params: dict, args: dict) -> CommandResults: """ Returns cost forecast for a subscription over a given time range. This command retrieves cost forecast data from Azure Cost Management API using the Forecasts - Usage endpoint. It provides forecasted cost information for Azure resources based on historical usage patterns. Args: client (AzureClient): Azure client instance for API communication params (dict): Configuration parameters from integration settings args (dict): Command arguments containing: - subscription_id: Azure subscription ID (required) - type: Forecast type (Usage, Actual Cost, Amortized Cost) (required) - aggregation_function_name: Aggregation function name (Pre Tax Cost USD, Cost, Cost USD, Pre Tax Cost) (required) - aggregation_function_type: Aggregation function type (default: "Sum") - granularity: Data granularity (default: "Daily") - start_date: Start date (default: 7 days ago) - end_date: End date (default: current time) - filter: URL parameter to filter forecasts - include_actual_cost: Include actual cost data (default: False) - include_fresh_partial_cost: Include fresh partial cost data (default: False) Returns: CommandResults: Contains forecast data with Name, Time Period, Charge, Currency, and Grain information Raises: DemistoException: If Azure API call fails, subscription not found, or invalid parameters provided """ subscription_id = args.get("subscription_id", "") forecast_type = args.get("type", "") aggregation_function_name = args.get("aggregation_function_name", "") aggregation_function_type = args.get("aggregation_function_type", "Sum") granularity = args.get("granularity", "Daily") include_actual_cost = argToBoolean(args.get("include_actual_cost", False)) include_fresh_partial_cost = argToBoolean(args.get("include_fresh_partial_cost", False)) filter_param = args.get("filter", "") start_date = args.get("start_date", "") end_date = args.get("end_date", "") response = client.billing_forecast_list( subscription_id=subscription_id, forecast_type=forecast_type, aggregation_function_name=aggregation_function_name, aggregation_function_type=aggregation_function_type, granularity=granularity, start_date=start_date, end_date=end_date, filter_param=filter_param, include_actual_cost=include_actual_cost, include_fresh_partial_cost=include_fresh_partial_cost, ) parsed_data = parse_forecast_table_to_dict(response) demisto.debug(f"Parsed data:\n {parsed_data}\n") results = [ { aggregation_function_name: obj.get(aggregation_function_name), "UsageDate": datetime.strptime(str(obj.get("UsageDate")), "%Y%m%d").strftime("%Y-%m-%d"), "CostStatus": obj.get("CostStatus"), "Currency": obj.get("Currency"), } for obj in parsed_data ] context = {"Azure.Billing.Forecast": results} readable = tableToMarkdown( "Azure Billing Forecast", results, headers=[aggregation_function_name, "UsageDate", "CostStatus", "Currency"], removeNull=True, ) return CommandResults( readable_output=readable, outputs=context, raw_response=response, ) def azure_billing_budgets_list_command(client: AzureClient, params: dict, args: dict) -> CommandResults: """ Retrieves budget information from Azure Consumption API. This command lists all configured budgets for a specified Azure subscription or resource group, providing detailed information about budget limits, current spending, and time periods. Supports retrieving either all budgets or a specific budget by name for targeted analysis. Args: client (AzureClient): Azure client instance for API communication params (dict): Configuration parameters from integration settings args (dict): Command arguments containing: - subscription_id: Azure subscription ID (required) - budget_name: Optional specific budget name to retrieve (if not provided, returns all budgets) Returns: CommandResults: Contains budget data including names, amounts, current spending, resource types, and time periods for budget monitoring Raises: DemistoException: If Azure API call fails, subscription not found, budget doesn't exist, or invalid parameters provided """ subscription_id = get_from_args_or_params(params=params, args=args, key="subscription_id") budget_name = args.get("budget_name", "") res = client.billing_budgets_list(subscription_id=subscription_id, budget_name=budget_name) response_data = res.json() if hasattr(res, "json") else res if budget_name: # Single budget response items = [response_data] demisto.debug(f"Azure billing budgets response - single budget: {response_data.get('name', '')}") else: # List of budgets response items = response_data.get("value", []) demisto.debug(f"Azure billing budgets response - budgets count: {len(items)}") results = [] for item in items: time_period = item.get("properties", {}).get("timePeriod", {}) start_raw = time_period.get("startDate") end_raw = time_period.get("endDate") start = datetime.fromisoformat(start_raw.replace("Z", "+00:00")).strftime("%Y-%m-%d") if start_raw else None end = datetime.fromisoformat(end_raw.replace("Z", "+00:00")).strftime("%Y-%m-%d") if end_raw else None results.append( { "BudgetName": item.get("name"), "ResourceType": item.get("type"), "TimePeriod": f"{start} - {end}", "Amount": item.get("properties", {}).get("amount"), "CurrentSpend": item.get("properties", {}).get("currentSpend", {}).get("amount"), } ) outputs = {"Azure.Billing.Budget": items} readable = tableToMarkdown( "Azure Budgets", results, headers=["BudgetName", "ResourceType", "TimePeriod", "Amount", "CurrentSpend"] ) return CommandResults( readable_output=readable, outputs=outputs, raw_response=res, ) def parse_forecast_table_to_dict(response: dict) -> list[dict]: """ Parses a generic Azure table-like API response and organizes the data into a list of dictionaries. Args: response (dict): The raw JSON response from the Azure API. Returns: list[dict]: A list of dictionaries, where each dictionary represents a row and maps column names to their corresponding values. Raises: DemistoException: If the response is not in the expected format. """ try: properties = response.get("properties", {}) columns = [column["name"] for column in properties.get("columns", [])] rows = properties.get("rows", []) parsed_data = [] for row in rows: if len(row) != len(columns): # This check ensures data integrity. demisto.debug(f"Mismatched data: Found {len(row)} values for {len(columns)} columns. Skipping row.") continue # Map column names to row values to create a dictionary for each row. row_dict = dict(zip(columns, row)) parsed_data.append(row_dict) return parsed_data except (KeyError, TypeError) as e: raise DemistoException(f"Failed to parse API response. Malformed data structure: {e}") def test_module(client: AzureClient) -> str: """Tests API connectivity and authentication. Returning 'ok' indicates that the integration works like it is supposed to. Raises exceptions if something goes wrong. :type AzureClient: ``Client`` :param Client: client to use :return: 'ok' if test passed. :rtype: ``str`` """ if "Device Code" in client.connection_type: raise DemistoException( "When using the Device Code authentication type, the Test button cannot validate the " "connection. Save the instance, run the `!azure-auth-start` and `!azure-auth-complete` " "commands to log in, and then run the `!azure-auth-test` command to validate the connection. " "For more details, see the Detailed Instructions (?) Help section in the integration configuration." ) try: if "Azure Managed Identities" in client.connection_type: # The roleAssignments call requires the Microsoft.Authorization/roleAssignments/read # permission, which a Managed Identity often lacks even when it can run other commands. # Validate the connection with a lightweight resource-groups list call, which only requires # the baseline Microsoft.Resources/subscriptions/resourceGroups/read permission. client.http_request( method="GET", full_url=f"{PREFIX_URL_AZURE}{client.subscription_id}/resourcegroups", params={"$top": "1"}, ) else: client.http_request( method="GET", full_url=f"{PREFIX_URL_AZURE}{client.subscription_id}/providers/Microsoft.Authorization/roleAssignments", params={"api-version": PERMISSIONS_VERSION}, ) except (ConnectionError, Timeout) as conn_err: raise Exception("Connectivity Error: Cannot reach Azure endpoint") from conn_err return "ok" def _get_ms_client(client: AzureClient) -> "MicrosoftClient": """Return the MicrosoftClient used for the marketplace auth flows. The MicrosoftClient only exists on the Cortex XSOAR / Cortex XSIAM (marketplace) path. On the Cortex Platform (COOC) path authentication is handled automatically via the cloud connector, so the auth helper commands are not applicable there. Raises: DemistoException: If called on the Cortex Platform path (no MicrosoftClient available). """ ms_client = getattr(client, "ms_client", None) if ms_client is None: raise DemistoException( "This command is supported only on Cortex XSOAR and Cortex XSIAM. On the Cortex Platform, " "authentication is handled automatically and does not require these auth commands." ) return ms_client def test_connection(client: AzureClient) -> str: """Validate the Azure connection by requesting an access token (marketplace flows). Args: client (AzureClient): The Azure client used to obtain the underlying Microsoft client. Returns: str: "Success!" if an access token was retrieved successfully. Raises: Exception: Propagated from MicrosoftApiModule if authentication fails. """ _get_ms_client(client).get_access_token() # If fails, MicrosoftApiModule raises an error return "Success!" def start_auth(client: AzureClient) -> CommandResults: """Start the interactive (Device Code) authorization process (marketplace flows). Args: client (AzureClient): The Azure client used to obtain the underlying Microsoft client. Returns: CommandResults: A result containing the device-code authorization instructions for the user, who must then run the `!azure-auth-complete` command to finish the flow. """ result = _get_ms_client(client).start_auth("!azure-auth-complete") return CommandResults(readable_output=result) def complete_auth(client: AzureClient) -> str: """Complete the interactive (Device Code) authorization process (marketplace flows). Args: client (AzureClient): The Azure client used to obtain the underlying Microsoft client. Returns: str: A confirmation message indicating the authorization completed successfully. Raises: Exception: Propagated from MicrosoftApiModule if the access token cannot be retrieved. """ _get_ms_client(client).get_access_token() return "Authorization completed successfully." def health_check(shared_creds: dict, subscription_id: str, connector_id: str) -> HealthCheckError | None: # pragma: no cover """ Tests connectivity to Azure and checks for required permissions. This function is specifically used for COOC (Connect on our Cloud) health checks to verify connectivity and permissions. Args: shared_creds (dict): Pre-fetched cloud credentials (format varies by provider). subscription_id (str): The Azure subscription ID to check against. connector_id (str): The connector ID for the Cloud integration. Returns: HealthCheckError or None: HealthCheckError if there's an issue, None if successful. """ if not subscription_id: return HealthCheckError( account_id=subscription_id, connector_id=connector_id, message="Missing Subscription ID for Azure integration", error_type=ErrorType.INTERNAL_ERROR, ) try: token = shared_creds.get("access_token") if not token: return HealthCheckError( account_id=subscription_id, connector_id=connector_id, message="Failed to authenticate with Azure", error_type=ErrorType.CONNECTIVITY_ERROR, ) demisto.debug("Using token-based credentials for health check") headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json", "Accept": "application/json"} client = AzureClient(subscription_id=subscription_id, headers=headers) test_module(client) except Exception as e: return HealthCheckError( account_id=subscription_id, connector_id=connector_id, message=f"Failed to connect to Azure: {str(e)}", error_type=ErrorType.CONNECTIVITY_ERROR, ) return None # Auth-helper commands establish or reset authentication and therefore must not require the # Authorization code, which is only obtained by first running azure-generate-login-url. Requiring # it here would create a chicken-and-egg block on the command whose purpose is to produce the code. AUTH_HELPER_COMMANDS = { "azure-generate-login-url", "azure-auth-start", "azure-auth-complete", "azure-auth-reset", "azure-auth-test", } def validate_auth_params(params: dict, connection_type: str, command: str = "") -> None: """Validate that all mandatory parameters for the selected authentication type are configured. This runs only on the Cortex XSOAR / Cortex XSIAM (marketplace) path. The mandatory parameters per authentication type are: - Client Credentials: Application ID, Tenant ID, Client Secret, Default Subscription ID - Device Code: Application ID, Default Subscription ID - Authorization Code: Application ID, Application redirect URI, Authorization code, Default Subscription ID - Azure Managed Identities: Azure Managed Identities Client ID, Default Subscription ID The Authorization code is not required for auth-helper commands (e.g. azure-generate-login-url), since those commands are used to obtain/establish authentication before a code exists. Raises: DemistoException: If one or more mandatory parameters for the selected auth type are missing. """ app_id = params.get("app_id") subscription_id = params.get("subscription_id") tenant_id = params.get("tenant_id") client_secret = (params.get("credentials") or {}).get("password") auth_code = (params.get("auth_code") or {}).get("password") redirect_uri = params.get("redirect_uri") managed_identities_client_id = get_azure_managed_identities_client_id(params) authorization_code_required: dict[str, Any] = { "Application ID": app_id, "Application redirect URI": redirect_uri, "Default Subscription ID": subscription_id, } # Only demand the Authorization code itself when the caller is an actual data command, not an # auth-helper command such as azure-generate-login-url that is run to obtain the code. if command not in AUTH_HELPER_COMMANDS: authorization_code_required["Authorization code"] = auth_code required_by_auth_type: dict[str, dict[str, Any]] = { "Client Credentials": { "Application ID": app_id, "Tenant ID": tenant_id, "Client Secret": client_secret, "Default Subscription ID": subscription_id, }, "Device Code": { "Application ID": app_id, "Default Subscription ID": subscription_id, }, "Authorization Code": authorization_code_required, "Azure Managed Identities": { "Azure Managed Identities Client ID": managed_identities_client_id, "Default Subscription ID": subscription_id, }, } required_params = required_by_auth_type.get(connection_type, {}) missing = [display_name for display_name, value in required_params.items() if not value] if missing: raise DemistoException( f"Missing required parameter(s) for the '{connection_type}' authentication type: " f"{', '.join(missing)}. Configure these in the integration instance and try again." ) def get_azure_client(params: dict, args: dict, command: str, azure_ad_endpoint: str = DEFAULT_AZURE_AD_ENDPOINT): headers = {} client_scope, token_scopes = get_command_and_token_scopes(command) resource = get_command_resource(command) connection_type = params.get("auth_type") or "Client Credentials" # The Cortex Platform (COOC) path is selected when a connector ID is present. There, the CTS # token flow (get_cloud_credentials -> demisto._platformAPICall) handles authentication. # On Cortex XSOAR / Cortex XSIAM (version < 3.0) there is no connector, so authentication is done # by MicrosoftClient using the configured auth_type. if get_connector_id(): credentials = get_cloud_credentials( CloudTypes.AZURE.value, get_from_args_or_params(params=params, args=args, key="subscription_id"), scopes=token_scopes, ) token = credentials.get("access_token") if not token: raise DemistoException("Failed to retrieve AZURE access token - token is missing from credentials") headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json", "Accept": "application/json"} demisto.debug("Using CTS.") else: # Marketplace path: ensure all mandatory parameters for the selected auth type are configured # before attempting any API call. validate_auth_params(params, connection_type, command) client = AzureClient( app_id=params.get("app_id", ""), subscription_id=params.get("subscription_id", ""), resource_group_name=params.get("resource_group_name", ""), verify=not params.get("insecure", False), proxy=params.get("proxy", False), tenant_id=params.get("tenant_id"), enc_key=(params.get("credentials") or {}).get("password"), resource=resource, scope=client_scope, headers=headers, connection_type=connection_type, azure_ad_endpoint=azure_ad_endpoint, auth_code=(params.get("auth_code", {}) or {}).get("password"), redirect_uri=params.get("redirect_uri"), managed_identities_client_id=get_azure_managed_identities_client_id(params), ) return client def get_command_and_token_scopes(command: str) -> tuple[str, list[str]]: """Get the command and token scopes for the command. Default is DEFAULT_SCOPE and [TokenScope.DEFAULT].""" # There are 'azure-storage-blob' commands (such as azure-storage-blob-service-properties-get) that don't need this update. if "storage-container" in command or command in STORAGE_BLOB_SPECIAL_COMMANDS: return STORAGE_SCOPE, [TokenScope.STORAGE] return DEFAULT_SCOPE, [TokenScope.DEFAULT] def get_command_resource(command: str) -> str: """Get the resource for the command. Default is management_azure.""" # There are 'azure-storage-blob' commands (such as azure-storage-blob-service-properties-get) that don't need this update. if "storage-container" in command or command in STORAGE_BLOB_SPECIAL_COMMANDS: return STORAGE_RESOURCE return DEFAULT_RESOURCE def switch_to_gov_account() -> None: global BLOB_SERVICE_PREFIX global SCOPE_BY_CONNECTION global DEFAULT_SCOPE global DEFAULT_RESOURCE global PREFIX_URL_AZURE global PREFIX_URL_MS_GRAPH BLOB_SERVICE_PREFIX = "blob.core.usgovcloudapi.net" SCOPE_BY_CONNECTION = { "Device Code": "https://management.usgovcloudapi.net/user_impersonation offline_access user.read", "Authorization Code": "https://management.usgovcloudapi.net/.default", "Client Credentials": "https://management.usgovcloudapi.net/.default", } DEFAULT_SCOPE = "https://management.usgovcloudapi.net/.default" DEFAULT_RESOURCE = "https://management.usgovcloudapi.net/" PREFIX_URL_AZURE = "https://management.usgovcloudapi.net/subscriptions/" PREFIX_URL_MS_GRAPH = "https://graph.microsoft.us/v1.0" def main(): # pragma: no cover params = demisto.params() command = demisto.command() args = demisto.args() demisto.debug(f"Command being called is {command}") connector_id = get_connector_id() demisto.debug(f"{connector_id=}") handle_proxy() try: commands_with_params_and_args = { "azure-nsg-security-rule-update": update_security_rule_command, "azure-vn-security-rule-update": update_security_rule_command, "azure-billing-usage-list": azure_billing_usage_list_command, "azure-billing-forecast-list": azure_billing_forecast_list_command, "azure-billing-budgets-list": azure_billing_budgets_list_command, "azure-storage-account-update": storage_account_update_command, "azure-storage-blob-service-properties-set": storage_blob_service_properties_set_command, "azure-storage-blob-service-property-set": storage_blob_service_properties_set_command, "azure-storage-blob-service-properties-get": storage_blob_service_properties_get_command, "azure-storage-blob-service-property-get": storage_blob_service_properties_get_command, "azure-storage-blob-containers-update": storage_blob_containers_update_command, "azure-storage-blob-container-update": storage_blob_containers_update_command, "azure-storage-container-property-get": storage_container_property_get_command, "azure-storage-container-create": storage_container_create_command, "azure-storage-container-delete": storage_container_delete_command, "azure-storage-container-blob-create": storage_container_blob_create_command, "azure-storage-blob-create": storage_container_blob_create_command, "azure-storage-container-blob-get": storage_container_blob_get_command, "azure-storage-blob-get": storage_container_blob_get_command, "azure-storage-container-blob-tag-get": storage_container_blob_tag_get_command, "azure-storage-blob-tag-get": storage_container_blob_tag_get_command, "azure-storage-container-blob-tag-set": storage_container_blob_tag_set_command, "azure-storage-blob-tag-set": storage_container_blob_tag_set_command, "azure-storage-container-blob-property-get": storage_container_blob_property_get_command, "azure-storage-blob-property-get": storage_container_blob_property_get_command, "azure-storage-container-blob-property-set": storage_container_blob_property_set_command, "azure-storage-blob-property-set": storage_container_blob_property_set_command, "azure-storage-container-public-access-block": storage_container_block_public_access_command, "azure-policy-assignment-create": create_policy_assignment_command, "azure-postgres-config-set": set_postgres_config_command, "azure-postgres-server-update": postgres_server_update_command, "azure-webapp-config-set": set_webapp_config_command, "azure-appservice-webapp-config-update": set_webapp_config_command, "azure-webapp-auth-update": update_webapp_auth_command, "azure-appservice-webapp-auth-settings-update": update_webapp_auth_command, "azure-mysql-flexible-server-param-set": mysql_flexible_server_param_set_command, "azure-monitor-log-profile-update": monitor_log_profile_update_command, "azure-disk-update": disk_update_command, "azure-compute-disk-update": disk_update_command, "azure-webapp-update": webapp_update_command, "azure-webapp-set-webapp-to-https-only-quick-action": webapp_update_command, "azure-webapp-enable-client-cert-quick-action": webapp_update_command, "azure-appservice-webapp-update": webapp_update_command, "azure-acr-update": acr_update_command, "azure-cr-registry-update": acr_update_command, "azure-key-vault-update": update_key_vault_command, "azure-key-vault-purge-and-soft-delete-enable-quick-action": update_key_vault_command, "azure-sql-db-threat-policy-update": sql_db_threat_policy_update_command, "azure-sql-db-threat-policy-update-quick-action": sql_db_threat_policy_update_command, "azure-keyvault-vault-update": update_key_vault_command, "azure-sqldb-security-alert-policy-update": sql_db_threat_policy_update_command, "azure-sql-db-transparent-data-encryption-set": sql_db_tde_set_command, "azure-sql-db-transparent-data-encryption-enable-tde-quick-action": sql_db_tde_set_command, "azure-cosmos-db-update": cosmosdb_update_command, "azure-cosmos-db-disable-key-quick-action": cosmosdb_update_command, "azure-cosmosdb-db-account-update": cosmosdb_update_command, "azure-nsg-security-groups-list": nsg_security_groups_list_command, "azure-vn-security-groups-list": nsg_security_groups_list_command, "azure-nsg-security-rule-get": nsg_security_rule_get_command, "azure-vn-security-group-create": nsg_security_group_create_command, "azure-vn-security-rule-get": nsg_security_rule_get_command, "azure-nsg-security-rules-list": nsg_security_rules_list_command, "azure-vn-security-rules-list": nsg_security_rules_list_command, "azure-nsg-security-rule-create": nsg_security_rule_create_command, "azure-vn-security-rule-create": nsg_security_rule_create_command, "azure-nsg-security-rule-delete": nsg_security_rule_delete_command, "azure-vn-security-rule-delete": nsg_security_rule_delete_command, "azure-nsg-resource-group-list": nsg_resource_group_list_command, "azure-rm-resource-groups-list": nsg_resource_group_list_command, "azure-nsg-network-interfaces-list": nsg_network_interfaces_list_command, "azure-vn-network-interfaces-list": nsg_network_interfaces_list_command, "azure-nsg-public-ip-addresses-list": nsg_public_ip_addresses_list_command, "azure-vn-public-ip-addresses-list": nsg_public_ip_addresses_list_command, "azure-vm-instance-start": start_vm_command, "azure-compute-vm-start": start_vm_command, "azure-vm-instance-power-off": poweroff_vm_command, "azure-compute-vm-power-off": poweroff_vm_command, "azure-vm-instance-details-get": get_vm_command, "azure-compute-vm-list": list_vm_command, "azure-vm-network-interface-details-get": get_network_interface_command, "azure-vn-network-interface-update": network_interface_update_command, "azure-compute-vm-get": get_vm_command, "azure-vn-network-interface-get": get_network_interface_command, "azure-vm-public-ip-details-get": get_public_ip_details_command, "azure-vn-public-ip-address-get": get_public_ip_details_command, "azure-webapp-assign-managed-identity-quick-action": webapp_update_command, "azure-appservice-webapp-update-quick-action": webapp_update_command, "azure-storage-allow-access-quick-action": storage_account_update_command, "azure-webapp-set-http2-quick-action": set_webapp_config_command, "azure-appservice-webapp-config-update-http2-quick-action": set_webapp_config_command, "azure-webapp-auth-update-quick-action": update_webapp_auth_command, "azure-appservice-webapp-auth-settings-update-quick-action": update_webapp_auth_command, "azure-storage-disable-cross-tenant-replication-quick-action": storage_account_update_command, "azure-set-function-app-http-version2-0-quick-action": set_webapp_config_command, "azure-storage-disable-storage-account-public-access-quick-action": storage_account_update_command, "azure-webapp-disable-remote-debugging-quick-action": set_webapp_config_command, "azure-appservice-webapp-config-disable-remote-debugging-quick-action": set_webapp_config_command, "azure-nsg-security-rule-delete-quick-action": nsg_security_rule_delete_command, "azure-webapp-set-min-tls-version-quick-action": set_webapp_config_command, "azure-appservice-webapp-config-update-min-tls-version-quick-action": set_webapp_config_command, "azure-function-app-set-min-tls-version-quick-action": set_webapp_config_command, "azure-mysql-set-secure-transport-quick-action": mysql_flexible_server_param_set_command, "azure-network-disable-storage-account-access-quick-action": storage_account_update_command, "azure-monitor-log-retention-period-quick-action": monitor_log_profile_update_command, "azure-set-storage-account-https-only-quick-action": storage_account_update_command, "azure-webapp-update-assign-managed-identity-quick-action": webapp_update_command, "azure-storage-blob-enable-soft-delete-quick-action": storage_blob_service_properties_set_command, "azure-storage-blob-soft-deletion-enable-quick-action": storage_blob_service_properties_set_command, "azure-disable-public-private-access-vm-disk-quick-action": disk_update_command, "azure-disable-public-n-private-access-vm-disk-quick-action": disk_update_command, "azure-disk-set-data-access-ad-quick-action": disk_update_command, "azure-compute-disk-update-data-access-ad-quick-action": disk_update_command, "azure-acr-disable-public-private-access-quick-action": acr_update_command, "azure-cr-disable-public-private-access-quick-action": acr_update_command, "azure-acr-disable-authentication-as-arm-quick-action": acr_update_command, "azure-cr-disable-anonymous-pull-quick-action": acr_update_command, "azure-cr-disable-authentication-as-arm-quick-action": acr_update_command, "azure-acr-disable-anonymous-pull-quick-action": acr_update_command, "azure-policy-assignment-create-quick-action": create_policy_assignment_command, "azure-postgres-config-set-disconnection-logging-quick-action": set_postgres_config_command, "azure-postgres-config-set-checkpoint-logging-quick-action": set_postgres_config_command, "azure-postgres-config-set-connection-throttling-quick-action": set_postgres_config_command, "azure-postgres-config-set-session-connection-logging-quick-action": set_postgres_config_command, "azure-postgres-config-set-log-retention-period-quick-action": set_postgres_config_command, "azure-postgres-config-set-statement-logging-quick-action": set_postgres_config_command, "azure-postgres-server-update-ssl-enforcement-quick-action": postgres_server_update_command, } azure_ad_endpoint = params.get("azure_ad_endpoint") or DEFAULT_AZURE_AD_ENDPOINT if connector_id: if command == "test-module": if is_gov_account(connector_id): # type: ignore switch_to_gov_account() demisto.debug(f"Running health check for connector ID: {connector_id}") return return_results(run_health_check_for_accounts(connector_id, CloudTypes.AZURE.value, health_check)) account_id = get_from_args_or_params(params=params, args=args, key="subscription_id") if is_gov_account(connector_id, account_id): # type: ignore switch_to_gov_account() else: if azure_ad_endpoint.rstrip("/") != DEFAULT_AZURE_AD_ENDPOINT: demisto.debug(f"Non-commercial Azure AD endpoint configured ({azure_ad_endpoint}); switching to Gov account.") switch_to_gov_account() if command == "azure-auth-reset": return return_results(reset_auth()) client = get_azure_client(params, args, command, azure_ad_endpoint) if command == "test-module": return_results(test_module(client)) elif command == "azure-auth-start": return_results(start_auth(client)) elif command == "azure-auth-complete": return_results(complete_auth(client)) elif command == "azure-auth-test": return_results(test_connection(client)) elif command == "azure-generate-login-url": return_results(generate_login_url(_get_ms_client(client), azure_ad_endpoint)) elif command in commands_with_params_and_args: return_results(commands_with_params_and_args[command](client=client, params=params, args=args)) else: raise NotImplementedError(f"Command {command} is not implemented") except Exception as e: demisto.error(traceback.format_exc()) # print the traceback return_error(f"Failed to execute {demisto.command()} command.\nError:\n{e!s}") if __name__ in ("__main__", "__builtin__", "builtins"): # pragma: no cover main()