Microsoft.Automation AutomationAccounts/variables 2015-10-31

Bicep 資源定義

automationAccounts/variables 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

使用範例

Bicep 範例

在 Azure 自動化中部署變數的基本範例。

param resourceName string = 'acctest0001'
param location string = 'westeurope'

resource automationAccount 'Microsoft.Automation/automationAccounts@2021-06-22' = {
  name: resourceName
  location: location
  properties: {
    encryption: {
      keySource: 'Microsoft.Automation'
    }
    publicNetworkAccess: true
    sku: {
      name: 'Basic'
    }
  }
}

resource variable 'Microsoft.Automation/automationAccounts/variables@2020-01-13-preview' = {
  name: resourceName
  parent: automationAccount
  properties: {
    description: ''
    isEncrypted: false
    value: 'Hello, Terraform Basic Test.'
  }
}

Azure 已驗證的模組

下列 Azure 驗證模組 可用來部署此資源類型。

Module 描述
自動化帳戶 - 變數 AVM 自動化帳戶子模組 - 變數

Azure 快速入門範例

下列 Azure 快速入門範本 包含用於部署此資源類型的 Bicep 範例。

Bicep 檔案 描述
ASR Runbook 部署適用於 ASR 復原方案的自動化 Runbook

資源格式

若要建立 Microsoft.Automation/automationAccounts/variables 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.Automation/automationAccounts/variables@2015-10-31' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    description: 'string'
    isEncrypted: bool
    value: 'string'
  }
}

屬性值

Microsoft.Automation/automationAccounts/variables

名字 描述 價值
名字 資源名稱 字串 (必要)
父代 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。

如需詳細資訊,請參閱 父資源外部的子資源。
類型資源的符號名稱:automationAccounts
性能 取得或設定變數的屬性。 VariableCreateOrUpdatePropertiesOrVariableProperties (必要)

VariableCreateOrUpdatePropertiesOrVariableProperties

名字 描述 價值
描述 取得或設定變數的描述。 字串
isEncrypted 取得或設定變數的加密旗標。 布爾 (bool)
價值 取得或設定變數的值。 字串

ARM 樣本資源定義

automationAccounts/variables 資源類型可以使用目標作業來部署:

使用範例

Azure 快速入門範本

下列 Azure 快速入門範本 部署此資源類型。

範本 描述
ASR Runbook

部署至 Azure
部署適用於 ASR 復原方案的自動化 Runbook
Azure 資源優化 (ARO) 工具組

部署至 Azure
Azure 資源優化工具組是一種分散式原生 Azure 解決方案,使用無伺服器技術將訂用帳戶上的 Azure 資源優化。 一旦您啟用或建立自己的排程,包括新的資源,優化就會自動在您的訂用帳戶上進行。 這是一個 Azure 自動化帳戶,其中包含預先設定的 Runbook 和排程,您可以利用訂用帳戶來開始節省成本。

資源格式

若要建立 Microsoft.Automation/automationAccounts/variables 資源,請將下列 JSON 新增至範本。

{
  "type": "Microsoft.Automation/automationAccounts/variables",
  "apiVersion": "2015-10-31",
  "name": "string",
  "properties": {
    "description": "string",
    "isEncrypted": "bool",
    "value": "string"
  }
}

屬性值

Microsoft.Automation/automationAccounts/variables

名字 描述 價值
apiVersion API 版本 '2015-10-31'
名字 資源名稱 字串 (必要)
性能 取得或設定變數的屬性。 VariableCreateOrUpdatePropertiesOrVariableProperties (必要)
型別 資源類型 'Microsoft.Automation/automationAccounts/variables'

VariableCreateOrUpdatePropertiesOrVariableProperties

名字 描述 價值
描述 取得或設定變數的描述。 字串
isEncrypted 取得或設定變數的加密旗標。 布爾 (bool)
價值 取得或設定變數的值。 字串

Terraform (AzAPI 提供者) 資源定義

automationAccounts/variables 資源類型可以使用目標作業來部署:

  • 資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。

使用範例

Terraform 範例

在 Azure 自動化中部署變數的基本範例。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "automationAccount" {
  type      = "Microsoft.Automation/automationAccounts@2021-06-22"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      encryption = {
        keySource = "Microsoft.Automation"
      }
      publicNetworkAccess = true
      sku = {
        name = "Basic"
      }
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "variable" {
  type      = "Microsoft.Automation/automationAccounts/variables@2020-01-13-preview"
  parent_id = azapi_resource.automationAccount.id
  name      = var.resource_name
  body = {
    properties = {
      description = ""
      isEncrypted = false
      value       = "\"Hello, Terraform Basic Test.\""
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

資源格式

若要建立 Microsoft.Automation/automationAccounts/variables 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Automation/automationAccounts/variables@2015-10-31"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      description = "string"
      isEncrypted = bool
      value = "string"
    }
  }
}

屬性值

Microsoft.Automation/automationAccounts/variables

名字 描述 價值
名字 資源名稱 字串 (必要)
parent_id 此資源為父系之資源的標識碼。 類型資源的標識碼:automationAccounts
性能 取得或設定變數的屬性。 VariableCreateOrUpdatePropertiesOrVariableProperties (必要)
型別 資源類型 “Microsoft.Automation/automationAccounts/variables@2015-10-31”

VariableCreateOrUpdatePropertiesOrVariableProperties

名字 描述 價值
描述 取得或設定變數的描述。 字串
isEncrypted 取得或設定變數的加密旗標。 布爾 (bool)
價值 取得或設定變數的值。 字串