Deployment Scripts - Update

Updates deployment script tags with specified values.

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}?api-version=2020-10-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

scriptName
path True

string

Name of the deployment script.

subscriptionId
path True

string

Subscription Id which forms part of the URI for every service call.

api-version
query True

string

Client Api version.

Request Body

Name Type Description
tags

object

Resource tags to be updated.

Responses

Name Type Description
200 OK DeploymentScript:

OK -- Deployment script tags are updated.

Other Status Codes

DeploymentScriptsError

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

DeploymentScriptsUpdate

Sample Request

PATCH https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/script-rg/providers/Microsoft.Resources/deploymentScripts/MyDeploymentScript?api-version=2020-10-01

{
  "tags": {}
}

Sample Response

{
  "properties": {
    "provisioningState": "Succeeded",
    "azPowerShellVersion": "1.7.0",
    "scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
    "arguments": "-Location 'westus' -Name \"*rg2\"",
    "supportingScriptUris": [
      "https://uri1.to.supporting.script",
      "https://uri2.to.supporting.script"
    ],
    "retentionInterval": "P7D",
    "timeout": "PT1H",
    "cleanupPreference": "Always",
    "status": {
      "containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
      "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage",
      "startTime": "2018-11-13T15:19:45-08:00",
      "endTime": "2018-11-13T15:19:45-08:00",
      "expirationTime": "2018-11-13T15:19:45-08:00"
    },
    "outputs": {
      "output1": "value1"
    }
  },
  "systemData": {
    "createdBy": "string",
    "createdByType": "Application",
    "createdAt": "2020-02-01T01:01:01.1075056Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "Application",
    "lastModifiedAt": "2020-02-01T01:01:01.1075056Z"
  },
  "kind": "AzurePowerShell",
  "location": "westus",
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
    }
  },
  "tags": {}
}

Definitions

Name Description
AzureCliScript

Object model for the Azure CLI script.

AzurePowerShellScript

Object model for the Azure PowerShell script.

cleanupOptions

The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'.

ContainerConfiguration

Settings to customize ACI container instance.

createdByType

The type of identity that created the resource.

DeploymentScriptsError

Deployment scripts error response.

DeploymentScriptUpdateParameter

Deployment script parameters to be updated.

EnvironmentVariable

The environment variable to pass to the script in the container instance.

ErrorAdditionalInfo

The resource management error additional info.

ErrorResponse

Error Response

ManagedServiceIdentity

Managed identity generic object.

ManagedServiceIdentityType

Type of the managed identity.

ScriptProvisioningState

State of the script execution. This only appears in the response.

ScriptStatus

Generic object modeling results of script execution.

StorageAccountConfiguration

Settings to use an existing storage account. Valid storage account kinds are: Storage, StorageV2 and FileStorage

systemData

Metadata pertaining to creation and last modification of the resource.

UserAssignedIdentity

User-assigned managed identity.

AzureCliScript

Object model for the Azure CLI script.

Name Type Default Value Description
id

string

String Id used to locate any resource on Azure.

identity

ManagedServiceIdentity

Optional property. Managed identity to be used for this deployment script. Currently, only user-assigned MSI is supported.

kind string:

AzureCLI

Type of the script.

location

string

The location of the ACI and the storage account for the deployment script.

name

string

Name of this resource.

properties.arguments

string

Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -Location 'West US 2'

properties.azCliVersion

string

Azure CLI module version to be used.

properties.cleanupPreference

cleanupOptions

Always

The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'.

properties.containerSettings

ContainerConfiguration

Container settings.

properties.environmentVariables

EnvironmentVariable[]

The environment variables to pass over to the script.

properties.forceUpdateTag

string

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.

properties.outputs

object

List of script outputs.

properties.primaryScriptUri

string

Uri for the script. This is the entry point for the external script.

properties.provisioningState

ScriptProvisioningState

State of the script execution. This only appears in the response.

properties.retentionInterval

string

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).

properties.scriptContent

string

Script body.

properties.status

ScriptStatus

Contains the results of script execution.

properties.storageAccountSettings

StorageAccountConfiguration

Storage Account settings.

properties.supportingScriptUris

string[]

Supporting files for the external script.

properties.timeout

string

P1D

Maximum allowed script execution time specified in ISO 8601 format. Default value is P1D

systemData

systemData

The system metadata related to this resource.

tags

object

Resource tags.

type

string

Type of this resource.

AzurePowerShellScript

Object model for the Azure PowerShell script.

Name Type Default Value Description
id

string

String Id used to locate any resource on Azure.

identity

ManagedServiceIdentity

Optional property. Managed identity to be used for this deployment script. Currently, only user-assigned MSI is supported.

kind string:

AzurePowerShell

Type of the script.

location

string

The location of the ACI and the storage account for the deployment script.

name

string

Name of this resource.

properties.arguments

string

Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -Location 'West US 2'

properties.azPowerShellVersion

string

Azure PowerShell module version to be used.

properties.cleanupPreference

cleanupOptions

Always

The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'.

properties.containerSettings

ContainerConfiguration

Container settings.

properties.environmentVariables

EnvironmentVariable[]

The environment variables to pass over to the script.

properties.forceUpdateTag

string

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.

properties.outputs

object

List of script outputs.

properties.primaryScriptUri

string

Uri for the script. This is the entry point for the external script.

properties.provisioningState

ScriptProvisioningState

State of the script execution. This only appears in the response.

properties.retentionInterval

string

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).

properties.scriptContent

string

Script body.

properties.status

ScriptStatus

Contains the results of script execution.

properties.storageAccountSettings

StorageAccountConfiguration

Storage Account settings.

properties.supportingScriptUris

string[]

Supporting files for the external script.

properties.timeout

string

P1D

Maximum allowed script execution time specified in ISO 8601 format. Default value is P1D

systemData

systemData

The system metadata related to this resource.

tags

object

Resource tags.

type

string

Type of this resource.

cleanupOptions

The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'.

Name Type Description
Always

string

OnExpiration

string

OnSuccess

string

ContainerConfiguration

Settings to customize ACI container instance.

Name Type Description
containerGroupName

string

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.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

DeploymentScriptsError

Deployment scripts error response.

Name Type Description
error

ErrorResponse

Error Response
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)

DeploymentScriptUpdateParameter

Deployment script parameters to be updated.

Name Type Description
id

string

String Id used to locate any resource on Azure.

name

string

Name of this resource.

tags

object

Resource tags to be updated.

type

string

Type of this resource.

EnvironmentVariable

The environment variable to pass to the script in the container instance.

Name Type Description
name

string

The name of the environment variable.

secureValue

string

The value of the secure environment variable.

value

string

The value of the environment variable.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorResponse

Error Response

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorResponse[]

The error details.

message

string

The error message.

target

string

The error target.

ManagedServiceIdentity

Managed identity generic object.

Name Type Description
tenantId

string

ID of the Azure Active Directory.

type

ManagedServiceIdentityType

Type of the managed identity.

userAssignedIdentities

<string,  UserAssignedIdentity>

The list of user-assigned managed identities associated with the resource. Key is the Azure resource Id of the managed identity.

ManagedServiceIdentityType

Type of the managed identity.

Name Type Description
UserAssigned

string

ScriptProvisioningState

State of the script execution. This only appears in the response.

Name Type Description
Canceled

string

Creating

string

Failed

string

ProvisioningResources

string

Running

string

Succeeded

string

ScriptStatus

Generic object modeling results of script execution.

Name Type Description
containerInstanceId

string

ACI resource Id.

endTime

string

End time of the script execution.

error

ErrorResponse

Error Response
Error that is relayed from the script execution.

expirationTime

string

Time the deployment script resource will expire.

startTime

string

Start time of the script execution.

storageAccountId

string

Storage account resource Id.

StorageAccountConfiguration

Settings to use an existing storage account. Valid storage account kinds are: Storage, StorageV2 and FileStorage

Name Type Description
storageAccountKey

string

The storage account access key.

storageAccountName

string

The storage account name.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

UserAssignedIdentity

User-assigned managed identity.

Name Type Description
clientId

string

Client App Id associated with this identity.

principalId

string

Azure Active Directory principal ID associated with this identity.