AzureCLI@0 - Azure CLI Preview v0 작업
Azure 구독에 대해 Azure CLI 명령을 사용하여 셸 또는 일괄 처리 스크립트를 실행합니다.
구문론
# 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.
입력
Azure 연결 유형connectedServiceNameSelector
-
string
; 필수 사항입니다. 허용되는 값: connectedServiceName
(Azure 클래식), connectedServiceNameARM
(Azure Resource Manager). 기본값은 connectedServiceNameARM
입니다.
배포에 대한 Azure 연결 유형을 선택합니다.
AzureRM 구독connectedServiceNameARM
-
string
;
connectedServiceNameSelector = connectedServiceNameARM
때 필요합니다.
배포에 대한 Azure Resource Manager 구독을 선택합니다.
Azure 클래식 구독connectedServiceName
-
string
;
connectedServiceNameSelector = connectedServiceName
때 필요합니다.
배포에 대한 Azure 클래식 구독을 선택합니다.
scriptLocation
-
스크립트 위치
string
; 필수 사항입니다. 허용되는 값: inlineScript
(인라인 스크립트), scriptPath
(스크립트 경로) 기본값은 scriptPath
입니다.
스크립트 위치를 선택합니다.
scriptPath
-
스크립트 경로
string
;
scriptLocation = scriptPath
때 필요합니다.
스크립트의 정규화된 경로 또는 기본 작업 디렉터리를 기준으로 하는 경로입니다.
inlineScript
-
인라인 스크립트
string
;
scriptLocation = inlineScript
때 필요합니다.
여기에서 스크립트를 인라인으로 작성할 수 있습니다. 일괄 처리 파일의 경우 모든 Azure 명령 앞에 접두사 call
사용합니다. 또한 인수를 사용해서 이 스크립트로 사전 정의된 및 사용자 정의 변수를 전달할 수 있습니다.
다음 예제를 참조하세요. 첫 번째는 셸 예제이고 두 번째는 일괄 처리 예제입니다.
azure --version || azure account show
call azure --version || call azure account show
args
-
인수
string
;
스크립트에 전달된 인수입니다.
cwd
-
작업 디렉터리
string
;
스크립트가 실행되는 현재 작업 디렉터리입니다. 비워 두면 이 입력은 $(System.DefaultWorkingDirectory)
리포지토리(빌드) 또는 아티팩트(릴리스)의 루트입니다.
표준 오류failOnStandardError
- 실패
boolean
; 기본값은 true
입니다.
이 경우 오류가 StandardError 스트림에 기록되면 이 작업이 실패합니다.
작업 제어 옵션
모든 작업에는 작업 입력 외에 제어 옵션이 있습니다. 자세한 내용은 컨트롤 옵션 및 일반적인 작업 속성참조하세요.
출력 변수
없음.