az connectedmachine run-command
Note
This reference is part of the connectedmachine extension for the Azure CLI (version 2.49.0 or higher). The extension will automatically install the first time you run an az connectedmachine run-command command. Learn more about extensions.
This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Manage run commands on an Azure Arc-Enabled Server.
Commands
Name | Description | Type | Status |
---|---|---|---|
az connectedmachine run-command create |
Create operation to create or update a run command. |
Extension | Preview |
az connectedmachine run-command delete |
Delete operation to delete a run command. |
Extension | Preview |
az connectedmachine run-command list |
List operation to get all the run commands of a non-Azure machine. |
Extension | Preview |
az connectedmachine run-command show |
Get operation to get a run command. |
Extension | Preview |
az connectedmachine run-command update |
Update operation to create or update a run command. |
Extension | Preview |
az connectedmachine run-command wait |
Place the CLI in a waiting state until a condition is met. |
Extension | Preview |
az connectedmachine run-command create
Command group 'az connectedmachine run-command' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Create operation to create or update a run command.
az connectedmachine run-command create --machine-name
--name
--resource-group
[--async {0, 1, f, false, n, no, t, true, y, yes}]
[--command-id]
[--error-blob-managed-identity]
[--error-blob-uri]
[--location]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--output-blob-managed-identity]
[--output-blob-uri]
[--parameters]
[--password]
[--protected-parameters]
[--run-as-user]
[--script]
[--script-uri]
[--script-uri-managed-id]
[--tags]
[--timeout]
Examples
Sample command for run-command create
az connectedmachine run-command create --resource-group "myResourceGroup" --location "West US" --async false --parameters "[{"name":"param1","value":"value1"}]" --password "<runAsPassword>" --user "user1" --script "Write-Host Hello World!" --timeout 3600 --name "myRunCommand" --machine-name "myMachine" --subscription "mySubscription"
az connectedmachine run-command create --resource-group "myResourceGroup" --location "West US" --script "Write-Host Hello World!" --name "myRunCommand" --machine-name "myMachine" --output-uri "https://mystorageaccount.blob.core.windows.net/mycontainer/RuncommandOutput.txt?sp=racw&st=2022-10-17T19:02:15Z&se=2022-10-18T03:02:15Z&spr=https&sv=2021-06-08&sr=b&sig=3BxtEasfdasdfasdfdYki9yvYsqc60V0%3D" --subscription "mySubscription"
Required Parameters
The name of the hybrid machine.
The name of the run command.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.
Specifies the commandId of predefined built-in script.
User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.
The geo-location where the resource lives When not specified, the location of the resource group will be used.
Do not wait for the long-running operation to finish.
User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter.
The parameters used by the script. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Specifies the user account password on the machine when executing the run command.
The parameters used by the script. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Specifies the user account on the machine when executing the run command.
Specifies the script content to be executed on the machine.
Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.
User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Resource tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
The timeout in seconds to execute the run command.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az connectedmachine run-command delete
Command group 'az connectedmachine run-command' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Delete operation to delete a run command.
az connectedmachine run-command delete [--ids]
[--machine-name]
[--name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
[--yes]
Examples
Sample command for run-command delete
az connectedmachine run-command delete --resource-group "myResourceGroup" --name "myRunCommand" --machine-name "myMachine"
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
The name of the hybrid machine.
The name of the run command.
Do not wait for the long-running operation to finish.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az connectedmachine run-command list
Command group 'az connectedmachine run-command' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
List operation to get all the run commands of a non-Azure machine.
az connectedmachine run-command list --machine-name
--resource-group
[--expand]
Examples
Sample command for run-command list
az connectedmachine run-command list --resource-group "myResourceGroup" --machine-name "myMachine"
Required Parameters
The name of the hybrid machine.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
The expand expression to apply on the operation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az connectedmachine run-command show
Command group 'az connectedmachine run-command' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Get operation to get a run command.
az connectedmachine run-command show [--ids]
[--machine-name]
[--name]
[--resource-group]
[--subscription]
Examples
Sample command for run-command show
az connectedmahine run-command show --resource-group "myResourceGroup" --name "myRunCommand" --machine-name "myMachine"
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
The name of the hybrid machine.
The name of the run command.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az connectedmachine run-command update
Command group 'az connectedmachine run-command' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Update operation to create or update a run command.
az connectedmachine run-command update [--add]
[--async {0, 1, f, false, n, no, t, true, y, yes}]
[--error-blob-managed-identity]
[--error-blob-uri]
[--force-string {0, 1, f, false, n, no, t, true, y, yes}]
[--ids]
[--machine-name]
[--name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--output-blob-managed-identity]
[--output-blob-uri]
[--parameters]
[--password]
[--protected-parameters]
[--remove]
[--resource-group]
[--run-as-user]
[--set]
[--source]
[--subscription]
[--tags]
[--timeout]
Examples
Sample command for run-command update
az connetcedmachine run-command update --resource-group "myResourceGroup" --name "myRunCommand" --machine-name "myMachine" --subscription "mySubscription" --tags Tag1=Value1
Optional Parameters
Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.
Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.
User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
The name of the hybrid machine.
The name of the run command.
Do not wait for the long-running operation to finish.
User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter.
The parameters used by the script. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Specifies the user account password on the machine when executing the run command.
The parameters used by the script. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Specifies the user account on the machine when executing the run command.
Update an object by specifying a property path and value to set. Example: --set property1.property2=.
The source of the run command script. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Resource tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
The timeout in seconds to execute the run command.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az connectedmachine run-command wait
Command group 'az connectedmachine run-command' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Place the CLI in a waiting state until a condition is met.
az connectedmachine run-command wait [--created]
[--custom]
[--deleted]
[--exists]
[--ids]
[--interval]
[--machine-name]
[--name]
[--resource-group]
[--subscription]
[--timeout]
[--updated]
Optional Parameters
Wait until created with 'provisioningState' at 'Succeeded'.
Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].
Wait until deleted.
Wait until the resource exists.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Polling interval in seconds.
The name of the hybrid machine.
The name of the run command.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Maximum wait in seconds.
Wait until updated with provisioningState at 'Succeeded'.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Tilbakemeldinger
https://aka.ms/ContentUserFeedback.
Kommer snart: Gjennom 2024 faser vi ut GitHub Issues som tilbakemeldingsmekanisme for innhold, og erstatter det med et nytt system for tilbakemeldinger. Hvis du vil ha mer informasjon, kan du se:Send inn og vis tilbakemelding for