title | description | ms.date | monikerRange |
---|---|---|---|
AzureCLI@0 - Azure CLI Preview v0 task |
Run a Shell or Batch script with Azure CLI commands against an azure subscription. |
05/14/2024 |
<=azure-pipelines |
:::moniker range="<=azure-pipelines"
Run a shell or batch script with Azure CLI commands against an Azure subscription.
:::moniker-end
:::moniker range=">=azure-pipelines-2019"
# Azure CLI Preview v0
# Run a Shell or Batch script with Azure CLI commands against an azure subscription.
- task: AzureCLI@0
inputs:
connectedServiceNameSelector: 'connectedServiceNameARM' # 'connectedServiceName' | 'connectedServiceNameARM'. Required. Azure Connection Type. Default: connectedServiceNameARM.
connectedServiceNameARM: # string. Required when connectedServiceNameSelector = connectedServiceNameARM. AzureRM Subscription.
#connectedServiceName: # string. Required when connectedServiceNameSelector = connectedServiceName. Azure Classic Subscription.
scriptLocation: 'scriptPath' # 'inlineScript' | 'scriptPath'. Required. Script Location. Default: scriptPath.
scriptPath: # string. Required when scriptLocation = scriptPath. Script Path.
#inlineScript: # string. Required when scriptLocation = inlineScript. Inline Script.
#args: # string. Arguments.
# Advanced
#cwd: # string. Working Directory.
#failOnStandardError: true # boolean. Fail on Standard Error. Default: true.
:::moniker-end
:::moniker range="<=azure-pipelines"
connectedServiceNameSelector
- Azure Connection Type
string
. Required. Allowed values: connectedServiceName
(Azure Classic), connectedServiceNameARM
(Azure Resource Manager). Default value: connectedServiceNameARM
.
Selects the Azure connection type for the deployment.
:::moniker-end
:::moniker range="<=azure-pipelines"
connectedServiceNameARM
- AzureRM Subscription
string
. Required when connectedServiceNameSelector = connectedServiceNameARM
.
Selects the Azure Resource Manager subscription for the deployment.
:::moniker-end
:::moniker range="<=azure-pipelines"
connectedServiceName
- Azure Classic Subscription
string
. Required when connectedServiceNameSelector = connectedServiceName
.
Selects the Azure Classic subscription for the deployment.
:::moniker-end
:::moniker range="<=azure-pipelines"
scriptLocation
- Script Location
string
. Required. Allowed values: inlineScript
(Inline Script), scriptPath
(Script Path). Default value: scriptPath
.
Selects the script location.
:::moniker-end
:::moniker range="<=azure-pipelines"
scriptPath
- Script Path
string
. Required when scriptLocation = scriptPath
.
Fully qualified path of the script or a path relative to the the default working directory.
:::moniker-end
:::moniker range="<=azure-pipelines"
inlineScript
- Inline Script
string
. Required when scriptLocation = inlineScript
.
You can write your scripts inline here. For batch files, use the prefix call
before every Azure command. You can also pass predefined and custom variables to this script using arguments.
See the following examples. The first is a shell example and the second is a batch example:
azure --version || azure account show
call azure --version || call azure account show
:::moniker-end
:::moniker range="<=azure-pipelines"
args
- Arguments
string
.
Arguments passed to the script.
:::moniker-end
:::moniker range="<=azure-pipelines"
cwd
- Working Directory
string
.
Current working directory where the script is run. If left blank, this input is the root of the repo (build) or artifacts (release), which is $(System.DefaultWorkingDirectory)
.
:::moniker-end
:::moniker range="<=azure-pipelines"
failOnStandardError
- Fail on Standard Error
boolean
. Default value: true
.
If this is true, this task will fail when any errors are written to the StandardError stream.
:::moniker-end
All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.
:::moniker range="<=azure-pipelines"
None.
:::moniker-end
:::moniker range="<=azure-pipelines"
Requirement | Description |
---|---|
Pipeline types | YAML, Classic build, Classic release |
Runs on | Agent, DeploymentGroup |
Demands | None |
Capabilities | This task does not satisfy any demands for subsequent tasks in the job. |
Command restrictions | Any |
Settable variables | Any |
Agent version | 1.95.0 or greater |
Task category | Deploy |
:::moniker-end