Microsoft.Resources deploymentScripts
The deploymentScripts resource type can be deployed to: Resource groups.
To learn about resource group deployments, see Bicep or ARM template.
For a list of changed properties in each API version, see change log.
Remarks
To learn about executing scripts during deployment, see Use deployment scripts in Bicep or Use deployment scripts in ARM templates.
Template format
To create a Microsoft.Resources/deploymentScripts resource, add the following Bicep or JSON to your template.
resource symbolicname 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
name: 'string'
location: 'string'
tags: {
tagName1: 'tagValue1'
tagName2: 'tagValue2'
}
kind: 'string'
identity: {
type: 'UserAssigned'
userAssignedIdentities: {}
}
// For remaining properties, see deploymentScripts objects
}
deploymentScripts objects
Set the kind property to specify the type of object.
For AzureCLI, use:
kind: 'AzureCLI'
properties: {
arguments: 'string'
azCliVersion: 'string'
cleanupPreference: 'string'
containerSettings: {
containerGroupName: 'string'
}
environmentVariables: [
{
name: 'string'
secureValue: 'string'
value: 'string'
}
]
forceUpdateTag: 'string'
primaryScriptUri: 'string'
retentionInterval: 'string'
scriptContent: 'string'
storageAccountSettings: {
storageAccountKey: 'string'
storageAccountName: 'string'
}
supportingScriptUris: [
'string'
]
timeout: 'string'
}
For AzurePowerShell, use:
kind: 'AzurePowerShell'
properties: {
arguments: 'string'
azPowerShellVersion: 'string'
cleanupPreference: 'string'
containerSettings: {
containerGroupName: 'string'
}
environmentVariables: [
{
name: 'string'
secureValue: 'string'
value: 'string'
}
]
forceUpdateTag: 'string'
primaryScriptUri: 'string'
retentionInterval: 'string'
scriptContent: 'string'
storageAccountSettings: {
storageAccountKey: 'string'
storageAccountName: 'string'
}
supportingScriptUris: [
'string'
]
timeout: 'string'
}
Property values
deploymentScripts
| Name | Description | Value |
|---|---|---|
| type | The resource type For Bicep, set this value in the resource declaration. |
'Microsoft.Resources/deploymentScripts' |
| apiVersion | The resource api version For Bicep, set this value in the resource declaration. |
'2020-10-01' |
| name | The resource name | string (required) |
| location | The location of the ACI and the storage account for the deployment script. | string (required) |
| tags | Resource tags. | Dictionary of tag names and values. See Tags in templates |
| kind | Set the object type | AzureCLI AzurePowerShell |
| identity | Optional property. Managed identity to be used for this deployment script. Currently, only user-assigned MSI is supported. | ManagedServiceIdentity |
AzureCliScript
| Name | Description | Value |
|---|---|---|
| kind | Type of the script. | 'AzureCLI' |
| properties | Properties of the Azure CLI script object. | AzureCliScriptProperties (required) |
AzureCliScriptProperties
| Name | Description | Value |
|---|---|---|
| arguments | Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -Location 'West US 2' | string |
| azCliVersion | Azure CLI module version to be used. | string (required) |
| cleanupPreference | The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. | 'Always' 'OnExpiration' 'OnSuccess' |
| containerSettings | Container settings. | ContainerConfiguration |
| environmentVariables | The environment variables to pass over to the script. | EnvironmentVariable[] |
| forceUpdateTag | Gets or sets how the deployment script should be forced to execute even if the script resource has not changed. Can be current time stamp or a GUID. | string |
| primaryScriptUri | Uri for the script. This is the entry point for the external script. | string |
| retentionInterval | Interval for which the service retains the script resource after it reaches a terminal state. Resource will be deleted when this duration expires. Duration is based on ISO 8601 pattern (for example P1D means one day). | string (required) |
| scriptContent | Script body. | string |
| storageAccountSettings | Storage Account settings. | StorageAccountConfiguration |
| supportingScriptUris | Supporting files for the external script. | string[] |
| timeout | Maximum allowed script execution time specified in ISO 8601 format. Default value is P1D | string |
ContainerConfiguration
| Name | Description | Value |
|---|---|---|
| containerGroupName | Container group name, if not specified then the name will get auto-generated. Not specifying a 'containerGroupName' indicates the system to generate a unique name which might end up flagging an Azure Policy as non-compliant. Use 'containerGroupName' when you have an Azure Policy that expects a specific naming convention or when you want to fully control the name. 'containerGroupName' property must be between 1 and 63 characters long, must contain only lowercase letters, numbers, and dashes and it cannot start or end with a dash and consecutive dashes are not allowed. To specify a 'containerGroupName', add the following object to properties: { "containerSettings": { "containerGroupName": "contoso-container" } }. If you do not want to specify a 'containerGroupName' then do not add 'containerSettings' property. | string |
EnvironmentVariable
| Name | Description | Value |
|---|---|---|
| name | The name of the environment variable. | string (required) |
| secureValue | The value of the secure environment variable. | string |
| value | The value of the environment variable. | string |
StorageAccountConfiguration
| Name | Description | Value |
|---|---|---|
| storageAccountKey | The storage account access key. | string |
| storageAccountName | The storage account name. | string |
AzurePowerShellScript
| Name | Description | Value |
|---|---|---|
| kind | Type of the script. | 'AzurePowerShell' |
| properties | Properties of the Azure PowerShell script object. | AzurePowerShellScriptProperties (required) |
AzurePowerShellScriptProperties
| Name | Description | Value |
|---|---|---|
| arguments | Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -Location 'West US 2' | string |
| azPowerShellVersion | Azure PowerShell module version to be used. | string (required) |
| cleanupPreference | The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. | 'Always' 'OnExpiration' 'OnSuccess' |
| containerSettings | Container settings. | ContainerConfiguration |
| environmentVariables | The environment variables to pass over to the script. | EnvironmentVariable[] |
| forceUpdateTag | Gets or sets how the deployment script should be forced to execute even if the script resource has not changed. Can be current time stamp or a GUID. | string |
| primaryScriptUri | Uri for the script. This is the entry point for the external script. | string |
| retentionInterval | Interval for which the service retains the script resource after it reaches a terminal state. Resource will be deleted when this duration expires. Duration is based on ISO 8601 pattern (for example P1D means one day). | string (required) |
| scriptContent | Script body. | string |
| storageAccountSettings | Storage Account settings. | StorageAccountConfiguration |
| supportingScriptUris | Supporting files for the external script. | string[] |
| timeout | Maximum allowed script execution time specified in ISO 8601 format. Default value is P1D | string |
ManagedServiceIdentity
| Name | Description | Value |
|---|---|---|
| type | Type of the managed identity. | 'UserAssigned' |
| userAssignedIdentities | The list of user-assigned managed identities associated with the resource. Key is the Azure resource Id of the managed identity. | object |
Quickstart templates
The following quickstart templates deploy this resource type.
| Template | Description |
|---|---|
| min.io Azure Gateway |
Fully private min.io Azure Gateway deployment to provide an S3 compliant storage API backed by blob storage |
| Create a WordPress site |
This template creates a WordPress site on Container Instance |
| Azure Image Builder with Azure Windows Baseline. |
Creates an Azure Image Builder environment and builds a Windows Server image with the latest Windows Updates and Azure Windows Baseline applied. |
| Import VHD Blobs from a ZIP Archive URL |
Deploying Virtual Machines based on specialized disk images requires to import VHD files into a Storage Account. In the case there are multiple VHD files compressed in a single ZIP and you got the URL to fetch the ZIP archive, this ARM template will ease the job: Download, Extract and Import into an existing Storage Account Blob Container. |
| Front Door Standard/Premium with static website origin |
This template creates a Front Door Standard/Premium and an Azure Storage static website, and configured Front Door to send traffic to the static website. |
| Create an on-demand SFTP Server with persistent storage |
This template demonstrates an on-demand SFTP server using an Azure Container Instance (ACI). |
| Testing environment for Azure Firewall Premium |
This template creates an Azure Firewall Premium and Firewall Policy with premium features such as Intrusion Inspection Detection (IDPS), TLS inspection and Web Category filtering |
| Import Container Images into ACR |
This template leverages the Import ACR module from the bicep registry to import public container images into an Azure Container Registry. |
| Create ssh-keys and store in KeyVault |
This template uses the deploymentScript resource to generate ssh keys and stores the private key in keyVault. |
| Deploys a static website |
Deploys a static website with a backing storage account |