Bicep resource definition
The virtualMachineScaleSets/virtualMachines/runCommands resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
To create a Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands@2021-04-01' = {
parent: resourceSymbolicName
location: 'string'
name: 'string'
properties: {
asyncExecution: bool
errorBlobUri: 'string'
outputBlobUri: 'string'
parameters: [
{
name: 'string'
value: 'string'
}
]
protectedParameters: [
{
name: 'string'
value: 'string'
}
]
runAsPassword: 'string'
runAsUser: 'string'
source: {
commandId: 'string'
script: 'string'
scriptUri: 'string'
}
timeoutInSeconds: int
}
tags: {
{customized property}: 'string'
}
}
Property Values
Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands
Name |
Description |
Value |
name |
The run command parameter name. |
string (required) |
value |
The run command parameter value. |
string (required) |
VirtualMachineRunCommandProperties
Name |
Description |
Value |
asyncExecution |
Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. |
bool |
errorBlobUri |
Specifies the Azure storage blob where script error stream will be uploaded. |
string |
outputBlobUri |
Specifies the Azure storage blob where script output stream will be uploaded. |
string |
parameters |
The parameters used by the script. |
RunCommandInputParameter[] |
protectedParameters |
The parameters used by the script. |
RunCommandInputParameter[] |
runAsPassword |
Specifies the user account password on the VM when executing the run command. |
string |
runAsUser |
Specifies the user account on the VM when executing the run command. |
string |
source |
The source of the run command script. |
VirtualMachineRunCommandScriptSource |
timeoutInSeconds |
The timeout in seconds to execute the run command. |
int |
VirtualMachineRunCommandScriptSource
Name |
Description |
Value |
commandId |
Specifies a commandId of predefined built-in script. |
string |
script |
Specifies the script content to be executed on the VM. |
string |
scriptUri |
Specifies the script download location. |
string |
ARM template resource definition
The virtualMachineScaleSets/virtualMachines/runCommands resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
To create a Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands resource, add the following JSON to your template.
{
"type": "Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands",
"apiVersion": "2021-04-01",
"name": "string",
"location": "string",
"properties": {
"asyncExecution": "bool",
"errorBlobUri": "string",
"outputBlobUri": "string",
"parameters": [
{
"name": "string",
"value": "string"
}
],
"protectedParameters": [
{
"name": "string",
"value": "string"
}
],
"runAsPassword": "string",
"runAsUser": "string",
"source": {
"commandId": "string",
"script": "string",
"scriptUri": "string"
},
"timeoutInSeconds": "int"
},
"tags": {
"{customized property}": "string"
}
}
Property Values
Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands
Name |
Description |
Value |
apiVersion |
The api version |
'2021-04-01' |
location |
Resource location |
string (required) |
name |
The resource name |
string (required) |
properties |
Describes the properties of a Virtual Machine run command. |
VirtualMachineRunCommandProperties |
tags |
Resource tags |
Dictionary of tag names and values. See Tags in templates |
type |
The resource type |
'Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands' |
Name |
Description |
Value |
name |
The run command parameter name. |
string (required) |
value |
The run command parameter value. |
string (required) |
VirtualMachineRunCommandProperties
Name |
Description |
Value |
asyncExecution |
Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. |
bool |
errorBlobUri |
Specifies the Azure storage blob where script error stream will be uploaded. |
string |
outputBlobUri |
Specifies the Azure storage blob where script output stream will be uploaded. |
string |
parameters |
The parameters used by the script. |
RunCommandInputParameter[] |
protectedParameters |
The parameters used by the script. |
RunCommandInputParameter[] |
runAsPassword |
Specifies the user account password on the VM when executing the run command. |
string |
runAsUser |
Specifies the user account on the VM when executing the run command. |
string |
source |
The source of the run command script. |
VirtualMachineRunCommandScriptSource |
timeoutInSeconds |
The timeout in seconds to execute the run command. |
int |
VirtualMachineRunCommandScriptSource
Name |
Description |
Value |
commandId |
Specifies a commandId of predefined built-in script. |
string |
script |
Specifies the script content to be executed on the VM. |
string |
scriptUri |
Specifies the script download location. |
string |
Usage Examples
The virtualMachineScaleSets/virtualMachines/runCommands resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
To create a Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands@2021-04-01"
name = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
asyncExecution = bool
errorBlobUri = "string"
outputBlobUri = "string"
parameters = [
{
name = "string"
value = "string"
}
]
protectedParameters = [
{
name = "string"
value = "string"
}
]
runAsPassword = "string"
runAsUser = "string"
source = {
commandId = "string"
script = "string"
scriptUri = "string"
}
timeoutInSeconds = int
}
}
}
Property Values
Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands
Name |
Description |
Value |
location |
Resource location |
string (required) |
name |
The resource name |
string (required) |
parent_id |
The ID of the resource that is the parent for this resource. |
ID for resource of type: virtualMachineScaleSets/virtualMachines |
properties |
Describes the properties of a Virtual Machine run command. |
VirtualMachineRunCommandProperties |
tags |
Resource tags |
Dictionary of tag names and values. |
type |
The resource type |
"Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands@2021-04-01" |
Name |
Description |
Value |
name |
The run command parameter name. |
string (required) |
value |
The run command parameter value. |
string (required) |
VirtualMachineRunCommandProperties
Name |
Description |
Value |
asyncExecution |
Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. |
bool |
errorBlobUri |
Specifies the Azure storage blob where script error stream will be uploaded. |
string |
outputBlobUri |
Specifies the Azure storage blob where script output stream will be uploaded. |
string |
parameters |
The parameters used by the script. |
RunCommandInputParameter[] |
protectedParameters |
The parameters used by the script. |
RunCommandInputParameter[] |
runAsPassword |
Specifies the user account password on the VM when executing the run command. |
string |
runAsUser |
Specifies the user account on the VM when executing the run command. |
string |
source |
The source of the run command script. |
VirtualMachineRunCommandScriptSource |
timeoutInSeconds |
The timeout in seconds to execute the run command. |
int |
VirtualMachineRunCommandScriptSource
Name |
Description |
Value |
commandId |
Specifies a commandId of predefined built-in script. |
string |
script |
Specifies the script content to be executed on the VM. |
string |
scriptUri |
Specifies the script download location. |
string |