AzureCLI@0 - Azure CLI Preview v0 task

Run a shell or batch script with Azure CLI commands against an Azure subscription.

Syntax

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

Inputs

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.


connectedServiceNameARM - AzureRM Subscription
string. Required when connectedServiceNameSelector = connectedServiceNameARM.

Selects the Azure Resource Manager subscription for the deployment.


connectedServiceName - Azure Classic Subscription
string. Required when connectedServiceNameSelector = connectedServiceName.

Selects the Azure Classic subscription for the deployment.


scriptLocation - Script Location
string. Required. Allowed values: inlineScript (Inline Script), scriptPath (Script Path). Default value: scriptPath.

Selects the script location.


scriptPath - Script Path
string. Required when scriptLocation = scriptPath.

Fully qualified path of the script or a path relative to the the default working directory.


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

args - Arguments
string.

Arguments passed to the script.


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


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.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Requirements

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