Microsoft.DevCenter devcenters/devboxdefinitions 2023-08-01-預覽版

Bicep 資源定義

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

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

使用範例

Bicep 範例

部署開發人員中心開發箱定義的基本範例。

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

resource devCenter 'Microsoft.DevCenter/devcenters@2023-04-01' = {
  name: resourceName
  location: location
  identity: {
    type: 'SystemAssigned'
  }
}

resource devBoxDefinition 'Microsoft.DevCenter/devcenters/devboxdefinitions@2024-10-01-preview' = {
  name: resourceName
  location: location
  parent: devCenter
  properties: {
    hibernateSupport: 'Enabled'
    imageReference: {
      id: '${devCenter.id}/galleries/default/images/microsoftvisualstudio_visualstudioplustools_vs-2022-ent-general-win10-m365-gen2'
    }
    sku: {
      name: 'general_i_8c32gb256ssd_v2'
    }
  }
}

Azure 已驗證的模組

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

Module Description
開發中心 - Devboxdefinition 開發中心的 AVM 子模組 - Devboxdefinition

Azure 快速入門範例

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

Bicep 檔案 Description
設定開發箱服務 此範本會根據 Dev Box 快速入門指南 (/azure/dev-box/quickstart-create-dev-box) 建立所有 Dev Box 管理員資源。 您可以檢視所有建立的資源,或直接移至 DevPortal.microsoft.com 來建立您的第一個開發方塊。
使用內建映射部署 Dev Box Service 此範本提供使用內建映射部署Dev Box服務的方式。

資源格式

若要建立 Microsoft.DevCenter/devcenters/devboxdefinitions 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.DevCenter/devcenters/devboxdefinitions@2023-08-01-preview' = {
  parent: resourceSymbolicName
  location: 'string'
  name: 'string'
  properties: {
    hibernateSupport: 'string'
    imageReference: {
      id: 'string'
    }
    osStorageType: 'string'
    sku: {
      capacity: int
      family: 'string'
      name: 'string'
      size: 'string'
      tier: 'string'
    }
  }
  tags: {
    {customized property}: 'string'
  }
}

屬性值

Microsoft.DevCenter/devcenters/devboxdefinitions

Name Description Value
位置 資源所在的地理位置 字串 (必要)
name 資源名稱 string

Constraints:
最小長度 = 3
最大長度 = 63
模式 = ^[a-zA-Z0-9][a-zA-Z0-9-_.]{2,62}$ (必要)
父代 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。

如需詳細資訊,請參閱 父資源外部的子資源。
類型資源的符號名稱:devcenters
properties 開發方塊定義屬性 DevBoxDefinitionProperties
tags 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤

DevBoxDefinitionProperties

Name Description Value
hibernateSupport 指出使用此定義建立的開發人員方塊是否能夠休眠。 並非所有映像都能夠支援休眠。 若要深入瞭解,請參閱 https://aka.ms/devbox/hibernate 'Disabled'
'Enabled'
imageReference 影像參考資訊。 ImageReference
osStorageType 用於使用此定義建立之開發方塊之操作系統磁碟的儲存類型。 字串
sku 使用此定義建立之開發方塊的 SKU。 Sku

ImageReference

Name Description Value
id 映射標識碼或映像版本標識碼。 提供映像標識符時,將會使用其最新版本。 字串

Sku

Name Description Value
容量 如果 SKU 支援相應放大/縮小,則應該包含容量整數。 如果資源無法相應放大/縮小,可能會省略此專案。 int
family 如果服務有不同世代的硬體,針對相同的 SKU,則可以在這裡擷取。 字串
name SKU 的名稱。 例如 - P3。 通常是字母+數位碼 字串 (必要)
size SKU 大小。 當名稱欄位是階層和其他一些值的組合時,這會是獨立程序代碼。 字串
分層 如果服務有一個以上的層級,但 PUT 上不需要此欄位,則資源提供者必須實作此字段。 'Basic'
'Free'
'Premium'
'Standard'

TrackedResourceTags

Name Description Value

ARM 樣本資源定義

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

使用範例

Azure 快速入門範本

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

Template Description
設定開發箱服務

部署至 Azure
此範本會根據 Dev Box 快速入門指南 (/azure/dev-box/quickstart-create-dev-box) 建立所有 Dev Box 管理員資源。 您可以檢視所有建立的資源,或直接移至 DevPortal.microsoft.com 來建立您的第一個開發方塊。
使用內建映射部署 Dev Box Service

部署至 Azure
此範本提供使用內建映射部署Dev Box服務的方式。

資源格式

若要建立 Microsoft.DevCenter/devcenters/devboxdefinitions 資源,請將下列 JSON 新增至範本。

{
  "type": "Microsoft.DevCenter/devcenters/devboxdefinitions",
  "apiVersion": "2023-08-01-preview",
  "name": "string",
  "location": "string",
  "properties": {
    "hibernateSupport": "string",
    "imageReference": {
      "id": "string"
    },
    "osStorageType": "string",
    "sku": {
      "capacity": "int",
      "family": "string",
      "name": "string",
      "size": "string",
      "tier": "string"
    }
  },
  "tags": {
    "{customized property}": "string"
  }
}

屬性值

Microsoft.DevCenter/devcenters/devboxdefinitions

Name Description Value
apiVersion API 版本 '2023-08-01-preview'
位置 資源所在的地理位置 字串 (必要)
name 資源名稱 string

Constraints:
最小長度 = 3
最大長度 = 63
模式 = ^[a-zA-Z0-9][a-zA-Z0-9-_.]{2,62}$ (必要)
properties 開發方塊定義屬性 DevBoxDefinitionProperties
tags 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤
型別 資源類型 'Microsoft.DevCenter/devcenters/devboxdefinitions'

DevBoxDefinitionProperties

Name Description Value
hibernateSupport 指出使用此定義建立的開發人員方塊是否能夠休眠。 並非所有映像都能夠支援休眠。 若要深入瞭解,請參閱 https://aka.ms/devbox/hibernate 'Disabled'
'Enabled'
imageReference 影像參考資訊。 ImageReference
osStorageType 用於使用此定義建立之開發方塊之操作系統磁碟的儲存類型。 字串
sku 使用此定義建立之開發方塊的 SKU。 Sku

ImageReference

Name Description Value
id 映射標識碼或映像版本標識碼。 提供映像標識符時,將會使用其最新版本。 字串

Sku

Name Description Value
容量 如果 SKU 支援相應放大/縮小,則應該包含容量整數。 如果資源無法相應放大/縮小,可能會省略此專案。 int
family 如果服務有不同世代的硬體,針對相同的 SKU,則可以在這裡擷取。 字串
name SKU 的名稱。 例如 - P3。 通常是字母+數位碼 字串 (必要)
size SKU 大小。 當名稱欄位是階層和其他一些值的組合時,這會是獨立程序代碼。 字串
分層 如果服務有一個以上的層級,但 PUT 上不需要此欄位,則資源提供者必須實作此字段。 'Basic'
'Free'
'Premium'
'Standard'

TrackedResourceTags

Name Description Value

Terraform (AzAPI 提供者) 資源定義

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

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

使用範例

Terraform 範例

部署開發人員中心開發箱定義的基本範例。

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

provider "azapi" {
  skip_provider_registration = false
}

provider "azurerm" {
  features {
  }
}

data "azurerm_client_config" "current" {
}

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" "devCenter" {
  type      = "Microsoft.DevCenter/devcenters@2023-04-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    identity = {
      type                   = "SystemAssigned"
      userAssignedIdentities = null
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "devBoxDefinition" {
  type      = "Microsoft.DevCenter/devcenters/devboxdefinitions@2024-10-01-preview"
  parent_id = azapi_resource.devCenter.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      hibernateSupport = "Enabled"
      imageReference = {
        id = "${azapi_resource.devCenter.id}/galleries/default/images/microsoftvisualstudio_visualstudioplustools_vs-2022-ent-general-win10-m365-gen2"
      },
      sku = {
        name = "general_i_8c32gb256ssd_v2"
      }
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

資源格式

若要建立 Microsoft.DevCenter/devcenters/devboxdefinitions 資源,請將下列 Terraform 新增至您的範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.DevCenter/devcenters/devboxdefinitions@2023-08-01-preview"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      hibernateSupport = "string"
      imageReference = {
        id = "string"
      }
      osStorageType = "string"
      sku = {
        capacity = int
        family = "string"
        name = "string"
        size = "string"
        tier = "string"
      }
    }
  }
}

屬性值

Microsoft.DevCenter/devcenters/devboxdefinitions

Name Description Value
位置 資源所在的地理位置 字串 (必要)
name 資源名稱 string

Constraints:
最小長度 = 3
最大長度 = 63
模式 = ^[a-zA-Z0-9][a-zA-Z0-9-_.]{2,62}$ (必要)
parent_id 此資源為父系之資源的標識碼。 類型的資源標識碼:devcenters
properties 開發方塊定義屬性 DevBoxDefinitionProperties
tags 資源標籤 標記名稱和值的字典。
型別 資源類型 "Microsoft.DevCenter/devcenters/devboxdefinitions@2023-08-01-preview"

DevBoxDefinitionProperties

Name Description Value
hibernateSupport 指出使用此定義建立的開發人員方塊是否能夠休眠。 並非所有映像都能夠支援休眠。 若要深入瞭解,請參閱 https://aka.ms/devbox/hibernate 'Disabled'
'Enabled'
imageReference 影像參考資訊。 ImageReference
osStorageType 用於使用此定義建立之開發方塊之操作系統磁碟的儲存類型。 字串
sku 使用此定義建立之開發方塊的 SKU。 Sku

ImageReference

Name Description Value
id 映射標識碼或映像版本標識碼。 提供映像標識符時,將會使用其最新版本。 字串

Sku

Name Description Value
容量 如果 SKU 支援相應放大/縮小,則應該包含容量整數。 如果資源無法相應放大/縮小,可能會省略此專案。 int
family 如果服務有不同世代的硬體,針對相同的 SKU,則可以在這裡擷取。 字串
name SKU 的名稱。 例如 - P3。 通常是字母+數位碼 字串 (必要)
size SKU 大小。 當名稱欄位是階層和其他一些值的組合時,這會是獨立程序代碼。 字串
分層 如果服務有一個以上的層級,但 PUT 上不需要此欄位,則資源提供者必須實作此字段。 'Basic'
'Free'
'Premium'
'Standard'

TrackedResourceTags

Name Description Value