Skip to main content

Create Or Update Hybrid Machine Command

Create or Update a run command of a hybrid machines by a given ID.

External Documentation

To learn more, visit the Azure documentation.

Basic Parameters

ParameterDescription
LocationThe geo-location where the resource lives.
Machine NameThe name of the hybrid machine. Can be obtained by the List Hybrid Machines action.
Resource Group NameThe name of the resource group.
Run Command NameThe name of the run command that will be created or updated. Can be obtained by the List Hybrid Machine Commands action.
Subscription IDThe ID of the target subscription.

Advanced Parameters

ParameterDescription
Async ExecutionIf set to true, provisioning will complete as soon as script starts and will not wait for script to complete.
Error Blob Managed IdentityUser-assigned managed identity that has access to errorBlobUri storage blob.
Error Blob URISpecifies the Azure storage blob where script error stream will be uploaded.
Output Blob Managed IdentityUser-assigned managed identity that has access to outputBlobUri storage blob.
Output Blob URISpecifies the Azure storage blob where script output stream will be uploaded.
ParametersThe parameters used by the script. For example:
<br/>[<br/> {<br/> "name": "param1",<br/> "value": "value1"<br/> },<br/> {<br/> "name": "param2",<br/> "value": "value2"<br/> }<br/>]<br/>
Protected ParametersThe protected parameters used by the script. For example:
<br/>[<br/> {<br/> "name": "param1",<br/> "value": "value1"<br/> },<br/> {<br/> "name": "param2",<br/> "value": "value2"<br/> }<br/>]<br/>
Run As UserSpecifies the user account password on the machine when executing the run command.
Run As User's PasswordSpecifies the user account password on the machine when executing the run command.
SourceThe source object of the run command script.
TagsResource tags to apply on the run command.
TimeoutThe timeout in seconds to execute the run command.

Example Output

{
"id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/runcommands/myRunCommand",
"name": "myRunCommand",
"type": "Microsoft.HybridCompute/machines/runcommands",
"location": "eastus2",
"properties": {
"source": {
"script": "Write-Host Hello World!"
},
"parameters": [
{
"name": "param1",
"value": "value1"
},
{
"name": "param2",
"value": "value2"
}
],
"asyncExecution": false,
"runAsUser": "user1",
"timeoutInSeconds": 3600,
"outputBlobUri": "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt",
"errorBlobUri": "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt",
"provisioningState": "Succeeded"
}
}

Automation Library Example

Create or Update Hybrid Machine Command with Azure and Send Results Via Email

Automation LibraryPreview this Automation on desktop