AzurePowerShell@1 - v1 タスクをAzure PowerShellする

このタスクを使用して、Azure 環境内で PowerShell スクリプトを実行します。 Azure コンテキストは、提供された Azure Resource Manager サービス接続で認証されます。

構文

# Azure PowerShell v1
# Run a PowerShell script within an Azure environment.
- task: AzurePowerShell@1
  inputs:
    #ConnectedServiceNameSelector: 'ConnectedServiceName' # 'ConnectedServiceName' | 'ConnectedServiceNameARM'. Azure Connection Type. Default: ConnectedServiceName.
    ConnectedServiceName: # string. Required when ConnectedServiceNameSelector = ConnectedServiceName. Azure Classic Subscription. 
    #ConnectedServiceNameARM: # string. Required when ConnectedServiceNameSelector = ConnectedServiceNameARM. Azure Subscription. 
    ScriptType: 'FilePath' # 'FilePath' | 'InlineScript'. Required. Script Type. Default: FilePath.
    #ScriptPath: # string. Optional. Use when ScriptType = FilePath. Script Path. 
    #Inline: # string. Optional. Use when ScriptType = InlineScript. Inline Script. 
    #ScriptArguments: # string. Script Arguments.

入力

ConnectedServiceNameSelector - Azure 接続の種類
string. 使用できる値: ConnectedServiceName (Azure クラシック)、 ConnectedServiceNameARM (Azure Resource Manager)。 既定値: ConnectedServiceName


ConnectedServiceName - Azure クラシック サブスクリプション
string. ConnectedServiceNameSelector = ConnectedServiceName の場合に必要です。

PowerShell を実行する前に構成する Azure クラシック サブスクリプション。


ConnectedServiceNameARM - Azure サブスクリプション
string. ConnectedServiceNameSelector = ConnectedServiceNameARM の場合に必要です。

PowerShell を実行する前に構成する Azure Resource Manager サブスクリプション。


ScriptType - スクリプトの種類
string. 必須です。 使用できる値: FilePath (スクリプト ファイル パス)、 InlineScript (インライン スクリプト)。 既定値: FilePath

スクリプトの種類: ファイル パスまたはインライン。


ScriptPath - スクリプト パス
string. 省略可能。 の場合は ScriptType = FilePathを使用します。

スクリプトのパス。 これは、完全修飾パス、または既定の作業ディレクトリに対する相対パスである必要があります。


Inline - インライン スクリプト
string. 省略可能。 の場合は ScriptType = InlineScriptを使用します。 既定値: # You can write your azure powershell scripts inline here. \n# You can also pass predefined and custom variables to this script using arguments

実行するスクリプトを指定します。 サポートされているインライン スクリプトの最大長は 500 文字です。 より長いスクリプトを使用する場合は、ファイルのスクリプトを使用します。


ScriptArguments - スクリプト引数
string.

PowerShell に渡す追加のパラメーター。 これらのパラメーターには、序数パラメーターまたは名前付きパラメーターを指定できます。


タスク制御オプション

すべてのタスクには、タスク入力に加えて制御オプションがあります。 詳細については、「 コントロール オプションと一般的なタスク プロパティ」を参照してください。

出力変数

[なし] :

必要条件

要件 説明
パイプラインの種類 YAML、クラシック ビルド、クラシック リリース
上で実行 エージェント、DeploymentGroup
確認要求 セルフホステッド エージェントには、このタスクを使用するジョブを実行するための次の要求に一致する機能が必要です。
Capabilities このタスクは、ジョブ内の後続のタスクに対する要求を満たしていません。
コマンドの制限 Any
設定可能な変数 Any
エージェントのバージョン 1.95.0 以上
タスクのカテゴリ 配置