你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。

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 服务 此模板将按照 Dev Box 快速入门指南(/azure/dev-box/quickstart-create-dev-box)创建所有 Dev Box 管理员资源。 可以查看创建的所有资源,也可以直接转到 DevPortal.microsoft.com 创建第一个 Dev Box。
使用内置映像 部署 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
位置 资源所在的地理位置 string (必需)
name 资源名称 string

Constraints:
最小长度 = 3
最大长度 = 63
模式 = ^[a-zA-Z0-9][a-zA-Z0-9-_.]{2,62}$ (必需)
父级 在 Bicep 中,可以为子资源指定父资源。 仅当子资源在父资源外部声明时,才需要添加此属性。

有关详细信息,请参阅 父资源外部的子资源。
类型资源的符号名称:开发中心
properties Dev Box 定义属性 DevBoxDefinitionProperties
tags 资源标记 标记名称和值的字典。 请参阅模板 中的 标记

DevBoxDefinitionProperties

Name Description Value
hibernateSupport 指示使用此定义创建的 Dev Boxes 是否能够进入休眠状态。 并非所有图像都能够支持休眠。 若要了解详细信息,请参阅 https://aka.ms/devbox/hibernate 'Disabled'
'Enabled'
imageReference 图像参考信息。 ImageReference
osStorageType 用于使用此定义创建的 Dev Boxes 操作系统磁盘的存储类型。 字符串
sku 使用此定义创建的 Dev Boxes 的 SKU。 Sku

ImageReference

Name Description Value
id 映像 ID 或映像版本 ID。 提供映像 ID 时,将使用其最新版本。 字符串

Sku

Name Description Value
产能 如果 SKU 支持横向扩展/缩减,则应包含容量整数。 如果资源无法横向扩展/缩小,则可能会省略此范围。 int
family 如果服务具有不同代的硬件(对于同一 SKU,则可以在此处捕获)。 字符串
name SKU 的名称。 例 - P3。 它通常是字母+数字代码 string (必需)
size SKU 大小。 当名称字段是层和其他一些值的组合时,这将是独立的代码。 字符串
分层 如果服务具有多个层,但在 PUT 上不需要,则需要资源提供程序实现此字段。 'Basic'
'Free'
'Premium'
'Standard'

TrackedResourceTags

Name Description Value

ARM 模板资源定义

可以使用目标操作部署 devcenters/devboxdefinitions 资源类型:

用法示例

Azure 快速入门模板

以下 Azure 快速入门模板 部署此资源类型。

Template Description
配置 Dev Box 服务

部署到 Azure
此模板将按照 Dev Box 快速入门指南(/azure/dev-box/quickstart-create-dev-box)创建所有 Dev Box 管理员资源。 可以查看创建的所有资源,也可以直接转到 DevPortal.microsoft.com 创建第一个 Dev Box。
使用内置映像 部署 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'
位置 资源所在的地理位置 string (必需)
name 资源名称 string

Constraints:
最小长度 = 3
最大长度 = 63
模式 = ^[a-zA-Z0-9][a-zA-Z0-9-_.]{2,62}$ (必需)
properties Dev Box 定义属性 DevBoxDefinitionProperties
tags 资源标记 标记名称和值的字典。 请参阅模板 中的 标记
类型 资源类型 'Microsoft.DevCenter/devcenters/devboxdefinitions'

DevBoxDefinitionProperties

Name Description Value
hibernateSupport 指示使用此定义创建的 Dev Boxes 是否能够进入休眠状态。 并非所有图像都能够支持休眠。 若要了解详细信息,请参阅 https://aka.ms/devbox/hibernate 'Disabled'
'Enabled'
imageReference 图像参考信息。 ImageReference
osStorageType 用于使用此定义创建的 Dev Boxes 操作系统磁盘的存储类型。 字符串
sku 使用此定义创建的 Dev Boxes 的 SKU。 Sku

ImageReference

Name Description Value
id 映像 ID 或映像版本 ID。 提供映像 ID 时,将使用其最新版本。 字符串

Sku

Name Description Value
产能 如果 SKU 支持横向扩展/缩减,则应包含容量整数。 如果资源无法横向扩展/缩小,则可能会省略此范围。 int
family 如果服务具有不同代的硬件(对于同一 SKU,则可以在此处捕获)。 字符串
name SKU 的名称。 例 - P3。 它通常是字母+数字代码 string (必需)
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
位置 资源所在的地理位置 string (必需)
name 资源名称 string

Constraints:
最小长度 = 3
最大长度 = 63
模式 = ^[a-zA-Z0-9][a-zA-Z0-9-_.]{2,62}$ (必需)
parent_id 此资源的父资源的 ID。 类型资源的 ID:开发中心
properties Dev Box 定义属性 DevBoxDefinitionProperties
tags 资源标记 标记名称和值的字典。
类型 资源类型 "Microsoft.DevCenter/devcenters/devboxdefinitions@2023-08-01-preview"

DevBoxDefinitionProperties

Name Description Value
hibernateSupport 指示使用此定义创建的 Dev Boxes 是否能够进入休眠状态。 并非所有图像都能够支持休眠。 若要了解详细信息,请参阅 https://aka.ms/devbox/hibernate 'Disabled'
'Enabled'
imageReference 图像参考信息。 ImageReference
osStorageType 用于使用此定义创建的 Dev Boxes 操作系统磁盘的存储类型。 字符串
sku 使用此定义创建的 Dev Boxes 的 SKU。 Sku

ImageReference

Name Description Value
id 映像 ID 或映像版本 ID。 提供映像 ID 时,将使用其最新版本。 字符串

Sku

Name Description Value
产能 如果 SKU 支持横向扩展/缩减,则应包含容量整数。 如果资源无法横向扩展/缩小,则可能会省略此范围。 int
family 如果服务具有不同代的硬件(对于同一 SKU,则可以在此处捕获)。 字符串
name SKU 的名称。 例 - P3。 它通常是字母+数字代码 string (必需)
size SKU 大小。 当名称字段是层和其他一些值的组合时,这将是独立的代码。 字符串
分层 如果服务具有多个层,但在 PUT 上不需要,则需要资源提供程序实现此字段。 'Basic'
'Free'
'Premium'
'Standard'

TrackedResourceTags

Name Description Value