Microsoft.Compute virtualMachines/runCommands 2021-11-01

Bicep リソース定義

virtualMachines/runCommands リソースの種類は、次を対象とする操作でデプロイできます。

各 API バージョンの変更されたプロパティの一覧については、「 変更ログ」を参照してください。

リソース形式

Microsoft.Compute/virtualMachines/runCommands リソースを作成するには、次の Bicep をテンプレートに追加します。

resource symbolicname 'Microsoft.Compute/virtualMachines/runCommands@2021-11-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  parent: resourceSymbolicName
  properties: {
    asyncExecution: bool
    errorBlobUri: 'string'
    outputBlobUri: 'string'
    parameters: [
      {
        name: 'string'
        value: 'string'
      }
    ]
    protectedParameters: [
      {
        name: 'string'
        value: 'string'
      }
    ]
    runAsPassword: 'string'
    runAsUser: 'string'
    source: {
      commandId: 'string'
      script: 'string'
      scriptUri: 'string'
    }
    timeoutInSeconds: int
  }
}

プロパティ値

virtualMachines/runCommands

名前 説明
name リソース名

Bicep で子リソースの名前と型を設定する方法を参照してください。
string (必須)
location リソースの場所 string (必須)
tags リソース タグ タグ名と値のディクショナリ。 「テンプレートのタグ」を参照してください
parent Bicep では、子リソースの親リソースを指定できます。 このプロパティを追加する必要があるのは、子リソースが親リソースの外部で宣言されている場合のみです。

詳細については、「 親リソースの外部にある子リソース」を参照してください。
種類のリソースのシンボル名: virtualMachines
properties 仮想マシンの実行コマンドのプロパティについて説明します。 VirtualMachineRunCommandProperties

VirtualMachineRunCommandProperties

名前 説明
asyncExecution 省略可能。 true に設定すると、スクリプトが開始されるとすぐにプロビジョニングが完了し、スクリプトの完了を待機しません。 [bool]
errorBlobUri スクリプト エラー ストリームをアップロードする Azure ストレージ BLOB を指定します。 string
outputBlobUri スクリプト出力ストリームをアップロードする Azure ストレージ BLOB を指定します。 string
parameters スクリプトで使用されるパラメーター。 RunCommandInputParameter[]
protectedParameters スクリプトで使用されるパラメーター。 RunCommandInputParameter[]
runAsPassword 実行コマンドの実行時に VM のユーザー アカウント パスワードを指定します。 string
runAsUser run コマンドの実行時に VM 上のユーザー アカウントを指定します。 string
source 実行コマンド スクリプトのソース。 VirtualMachineRunCommandScriptSource
timeoutInSeconds run コマンドを実行するためのタイムアウト (秒単位)。 INT

RunCommandInputParameter

名前 説明
name run コマンド パラメーター名。 string (必須)
value run コマンド パラメーターの値。 string (必須)

VirtualMachineRunCommandScriptSource

名前 説明
commandId 定義済みの組み込みスクリプトの commandId を指定します。 string
script VM で実行するスクリプト コンテンツを指定します。 string
scriptUri スクリプトのダウンロード場所を指定します。 string

クイック スタート テンプレート

次のクイックスタート テンプレートでは、このリソースの種類をデプロイします。

Template 説明
SharePoint サブスクリプション / 2019 / 2016 / 2013 すべて構成済み

Azure にデプロイする
このテンプレートは、ADFS とのフェデレーション認証、OAuth 信頼、ユーザー プロファイル サービス、複数のパス ベースおよびホスト名付きサイト コレクションを含む 2 つのゾーンを含む Web アプリケーションなど、手動で実行するのに時間がかかる広範な構成を備えた SharePoint サブスクリプション / 2019 / 2016 / 2013 ファームを作成します。 SharePoint 仮想マシンでは、Chocolatey を使用して、最新バージョンの Notepad++、Visual Studio Code、Azure Data Studio、Fiddler、ULS Viewer、7-Zip をインストールします。

ARM テンプレート リソース定義

virtualMachines/runCommands リソースの種類は、次を対象とする操作でデプロイできます。

各 API バージョンの変更されたプロパティの一覧については、「 変更ログ」を参照してください。

リソース形式

Microsoft.Compute/virtualMachines/runCommands リソースを作成するには、次の JSON をテンプレートに追加します。

{
  "type": "Microsoft.Compute/virtualMachines/runCommands",
  "apiVersion": "2021-11-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "properties": {
    "asyncExecution": "bool",
    "errorBlobUri": "string",
    "outputBlobUri": "string",
    "parameters": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "protectedParameters": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "runAsPassword": "string",
    "runAsUser": "string",
    "source": {
      "commandId": "string",
      "script": "string",
      "scriptUri": "string"
    },
    "timeoutInSeconds": "int"
  }
}

プロパティ値

virtualMachines/runCommands

名前 説明
type リソースの種類 'Microsoft.Compute/virtualMachines/runCommands'
apiVersion リソース API のバージョン '2021-11-01'
name リソース名

JSON ARM テンプレートで子リソースの名前と型を設定する方法を参照してください。
string (必須)
location リソースの場所 string (必須)
tags リソース タグ タグ名と値のディクショナリ。 「テンプレートのタグ」を参照してください
properties 仮想マシンの実行コマンドのプロパティについて説明します。 VirtualMachineRunCommandProperties

VirtualMachineRunCommandProperties

名前 説明
asyncExecution 省略可能。 true に設定すると、スクリプトが開始されるとすぐにプロビジョニングが完了し、スクリプトの完了を待機しません。 [bool]
errorBlobUri スクリプト エラー ストリームをアップロードする Azure ストレージ BLOB を指定します。 string
outputBlobUri スクリプト出力ストリームをアップロードする Azure ストレージ BLOB を指定します。 string
parameters スクリプトで使用されるパラメーター。 RunCommandInputParameter[]
protectedParameters スクリプトで使用されるパラメーター。 RunCommandInputParameter[]
runAsPassword 実行コマンドの実行時に VM のユーザー アカウント パスワードを指定します。 string
runAsUser run コマンドの実行時に VM 上のユーザー アカウントを指定します。 string
source 実行コマンド スクリプトのソース。 VirtualMachineRunCommandScriptSource
timeoutInSeconds run コマンドを実行するためのタイムアウト (秒単位)。 INT

RunCommandInputParameter

名前 説明
name run コマンド パラメーター名。 string (必須)
value run コマンド パラメーターの値。 string (必須)

VirtualMachineRunCommandScriptSource

名前 説明
commandId 定義済みの組み込みスクリプトの commandId を指定します。 string
script VM で実行するスクリプト コンテンツを指定します。 string
scriptUri スクリプトのダウンロード場所を指定します。 string

クイック スタート テンプレート

次のクイックスタート テンプレートでは、このリソースの種類をデプロイします。

Template 説明
SharePoint サブスクリプション / 2019 / 2016 / 2013 すべて構成済み

Azure にデプロイする
このテンプレートは、ADFS とのフェデレーション認証、OAuth 信頼、ユーザー プロファイル サービス、複数のパス ベースおよびホスト名付きサイト コレクションを含む 2 つのゾーンを含む Web アプリケーションなど、手動で実行するのに時間がかかる広範な構成を備えた SharePoint サブスクリプション / 2019 / 2016 / 2013 ファームを作成します。 SharePoint 仮想マシンでは、Chocolatey を使用して、最新バージョンの Notepad++、Visual Studio Code、Azure Data Studio、Fiddler、ULS Viewer、7-Zip をインストールします。

Terraform (AzAPI プロバイダー) リソース定義

virtualMachines/runCommands リソースの種類は、次を対象とする操作でデプロイできます。

  • リソース グループ

各 API バージョンの変更されたプロパティの一覧については、「 変更ログ」を参照してください。

リソース形式

Microsoft.Compute/virtualMachines/runCommands リソースを作成するには、次の Terraform をテンプレートに追加します。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Compute/virtualMachines/runCommands@2021-11-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      asyncExecution = bool
      errorBlobUri = "string"
      outputBlobUri = "string"
      parameters = [
        {
          name = "string"
          value = "string"
        }
      ]
      protectedParameters = [
        {
          name = "string"
          value = "string"
        }
      ]
      runAsPassword = "string"
      runAsUser = "string"
      source = {
        commandId = "string"
        script = "string"
        scriptUri = "string"
      }
      timeoutInSeconds = int
    }
  })
}

プロパティ値

virtualMachines/runCommands

名前 説明
type リソースの種類 "Microsoft.Compute/virtualMachines/runCommands@2021-11-01"
name リソース名 string (必須)
location リソースの場所 string (必須)
parent_id このリソースの親であるリソースの ID。 種類のリソースの ID: virtualMachines
tags リソース タグ タグ名と値のディクショナリ。
properties 仮想マシンの実行コマンドのプロパティについて説明します。 VirtualMachineRunCommandProperties

VirtualMachineRunCommandProperties

名前 説明
asyncExecution 省略可能。 true に設定すると、スクリプトが開始されるとすぐにプロビジョニングが完了し、スクリプトの完了を待機しません。 [bool]
errorBlobUri スクリプト エラー ストリームをアップロードする Azure ストレージ BLOB を指定します。 string
outputBlobUri スクリプト出力ストリームをアップロードする Azure ストレージ BLOB を指定します。 string
parameters スクリプトで使用されるパラメーター。 RunCommandInputParameter[]
protectedParameters スクリプトで使用されるパラメーター。 RunCommandInputParameter[]
runAsPassword 実行コマンドの実行時に VM のユーザー アカウント パスワードを指定します。 string
runAsUser run コマンドの実行時に VM 上のユーザー アカウントを指定します。 string
source 実行コマンド スクリプトのソース。 VirtualMachineRunCommandScriptSource
timeoutInSeconds run コマンドを実行するためのタイムアウト (秒単位)。 INT

RunCommandInputParameter

名前 説明
name run コマンド パラメーター名。 string (必須)
value run コマンド パラメーターの値。 string (必須)

VirtualMachineRunCommandScriptSource

名前 説明
commandId 定義済みの組み込みスクリプトの commandId を指定します。 string
script VM で実行するスクリプト コンテンツを指定します。 string
scriptUri スクリプトのダウンロード場所を指定します。 string