Bicep 資源定義
實驗室資源類型可以使用目標作業來部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.DevTestLab/labs 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.DevTestLab/labs@2018-09-15' = {
location: 'string'
name: 'string'
properties: {
announcement: {
enabled: 'string'
expirationDate: 'string'
expired: bool
markdown: 'string'
title: 'string'
}
environmentPermission: 'string'
extendedProperties: {
{customized property}: 'string'
}
labStorageType: 'string'
mandatoryArtifactsResourceIdsLinux: [
'string'
]
mandatoryArtifactsResourceIdsWindows: [
'string'
]
premiumDataDisks: 'string'
support: {
enabled: 'string'
markdown: 'string'
}
}
tags: {
{customized property}: 'string'
}
}
屬性值
Microsoft.DevTestLab/labs
| Name | Description | Value |
|---|---|---|
| 位置 | 資源的位置。 | 字串 |
| name | 資源名稱 | 字串 (必要) |
| properties | 資源的屬性。 | LabProperties (必要) |
| tags | 資源標籤 | 標記名稱和值的字典。 請參閱範本中的 標籤 |
LabAnnouncementProperties
| Name | Description | Value |
|---|---|---|
| enabled | 實驗室公告目前是否為作用中/啟用? | 'Disabled' 'Enabled' |
| expirationDate | 公告到期的時間(永不為 Null) | 字串 |
| expired | 此公告是否已過期? | bool |
| markdown | 此實驗室顯示在UI中的Markdown文字(如果有的話)。 如果保留空白/Null,則不會顯示任何專案。 | 字串 |
| title | 實驗室公告的純文本標題 | 字串 |
LabProperties
| Name | Description | Value |
|---|---|---|
| announcement | 與此實驗室相關聯的任何實驗室公告屬性 | LabAnnouncementProperties |
| environmentPermission | 布建環境時要授與使用者的訪問許可權 | 'Contributor' 'Reader' |
| extendedProperties | 用於實驗功能的實驗室擴充屬性 | LabPropertiesExtendedProperties |
| labStorageType | 實驗室所使用的記憶體類型。 它可以是進階或標準。 預設值為 Premium。 | 'Premium' 'Standard' 'StandardSSD' |
| mandatoryArtifactsResourceIdsLinux | 在使用者指定的成品之前,預設應在所有 Linux VM 建立上套用的成品資源識別符排序列表。 | string[] |
| mandatoryArtifactsResourceIdsWindows | 在使用者指定的成品之前,預設應該在所有 Windows VM 建立上套用的成品資源識別符排序列表。 | string[] |
| premiumDataDisks | 啟用進階數據磁碟使用量的設定。 當其值為 「已啟用」時,允許建立標準或進階數據磁碟。 當其值為 「已停用」時,只允許建立標準數據磁碟。 |
'Disabled' 'Enabled' |
| 支援 | 與此實驗室相關聯的任何實驗室支援訊息屬性 | LabSupportProperties |
LabPropertiesExtendedProperties
| Name | Description | Value |
|---|
LabSupportProperties
| Name | Description | Value |
|---|---|---|
| enabled | 實驗室支援橫幅目前是否為使用中/啟用? | 'Disabled' 'Enabled' |
| markdown | 此實驗室顯示在UI中的Markdown文字(如果有的話)。 如果保留空白/Null,則不會顯示任何專案。 | 字串 |
ResourceTags
| Name | Description | Value |
|---|
使用範例
Azure 已驗證的模組
下列 Azure 驗證模組 可用來部署此資源類型。
| Module | Description |
|---|---|
| 開發測試實驗室 | DevTest Lab 的AVM資源模組 |
Azure 快速入門範例
下列 Azure 快速入門範本 包含用於部署此資源類型的 Bicep 範例。
| Bicep 檔案 | Description |
|---|---|
| 使用宣告的 VM 在 Azure DevTest Labs 中建立實驗室 | 此範本會在其中建立具有宣告 Windows Server 2019 Datacenter VM 的新 DevTest Lab / DTL 實例。 如需更多適用於 Azure DevTest Labs 的 Azure Resource Manager 快速入門範本,請參閱 https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/QuickStartTemplates |
ARM 樣本資源定義
實驗室資源類型可以使用目標作業來部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.DevTestLab/labs 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.DevTestLab/labs",
"apiVersion": "2018-09-15",
"name": "string",
"location": "string",
"properties": {
"announcement": {
"enabled": "string",
"expirationDate": "string",
"expired": "bool",
"markdown": "string",
"title": "string"
},
"environmentPermission": "string",
"extendedProperties": {
"{customized property}": "string"
},
"labStorageType": "string",
"mandatoryArtifactsResourceIdsLinux": [ "string" ],
"mandatoryArtifactsResourceIdsWindows": [ "string" ],
"premiumDataDisks": "string",
"support": {
"enabled": "string",
"markdown": "string"
}
},
"tags": {
"{customized property}": "string"
}
}
屬性值
Microsoft.DevTestLab/labs
| Name | Description | Value |
|---|---|---|
| apiVersion | API 版本 | '2018-09-15' |
| 位置 | 資源的位置。 | 字串 |
| name | 資源名稱 | 字串 (必要) |
| properties | 資源的屬性。 | LabProperties (必要) |
| tags | 資源標籤 | 標記名稱和值的字典。 請參閱範本中的 標籤 |
| 型別 | 資源類型 | 'Microsoft.DevTestLab/labs' |
LabAnnouncementProperties
| Name | Description | Value |
|---|---|---|
| enabled | 實驗室公告目前是否為作用中/啟用? | 'Disabled' 'Enabled' |
| expirationDate | 公告到期的時間(永不為 Null) | 字串 |
| expired | 此公告是否已過期? | bool |
| markdown | 此實驗室顯示在UI中的Markdown文字(如果有的話)。 如果保留空白/Null,則不會顯示任何專案。 | 字串 |
| title | 實驗室公告的純文本標題 | 字串 |
LabProperties
| Name | Description | Value |
|---|---|---|
| announcement | 與此實驗室相關聯的任何實驗室公告屬性 | LabAnnouncementProperties |
| environmentPermission | 布建環境時要授與使用者的訪問許可權 | 'Contributor' 'Reader' |
| extendedProperties | 用於實驗功能的實驗室擴充屬性 | LabPropertiesExtendedProperties |
| labStorageType | 實驗室所使用的記憶體類型。 它可以是進階或標準。 預設值為 Premium。 | 'Premium' 'Standard' 'StandardSSD' |
| mandatoryArtifactsResourceIdsLinux | 在使用者指定的成品之前,預設應在所有 Linux VM 建立上套用的成品資源識別符排序列表。 | string[] |
| mandatoryArtifactsResourceIdsWindows | 在使用者指定的成品之前,預設應該在所有 Windows VM 建立上套用的成品資源識別符排序列表。 | string[] |
| premiumDataDisks | 啟用進階數據磁碟使用量的設定。 當其值為 「已啟用」時,允許建立標準或進階數據磁碟。 當其值為 「已停用」時,只允許建立標準數據磁碟。 |
'Disabled' 'Enabled' |
| 支援 | 與此實驗室相關聯的任何實驗室支援訊息屬性 | LabSupportProperties |
LabPropertiesExtendedProperties
| Name | Description | Value |
|---|
LabSupportProperties
| Name | Description | Value |
|---|---|---|
| enabled | 實驗室支援橫幅目前是否為使用中/啟用? | 'Disabled' 'Enabled' |
| markdown | 此實驗室顯示在UI中的Markdown文字(如果有的話)。 如果保留空白/Null,則不會顯示任何專案。 | 字串 |
ResourceTags
| Name | Description | Value |
|---|
使用範例
Azure 快速入門範本
下列 Azure 快速入門範本 部署此資源類型。
| Template | Description |
|---|---|
|
在 Azure DevTest Labs 中建立新實驗室 |
此範本會建立新的 DevTest Lab / DTL 實例。 如需更多適用於 Azure DevTestlab 的 Azure Resource Manager 快速入門範本,請參閱 https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/QuickStartTemplates |
|
使用宣告的 VM 在 Azure DevTest Labs 中建立實驗室 |
此範本會在其中建立具有宣告 Windows Server 2019 Datacenter VM 的新 DevTest Lab / DTL 實例。 如需更多適用於 Azure DevTest Labs 的 Azure Resource Manager 快速入門範本,請參閱 https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/QuickStartTemplates |
|
使用 Windows Server VM 在 Azure DevTest Labs 中建立實驗室 |
此範本會在其中建立具有 Windows Server 2019 Datacenter VM 的新 DevTest Lab / DTL 實例。 如需更多適用於 Azure DevTest Labs 的 Azure Resource Manager 快速入門範本,請參閱 https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/QuickStartTemplates |
Terraform (AzAPI 提供者) 資源定義
實驗室資源類型可以使用目標作業來部署:
- 資源群組
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.DevTestLab/labs 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DevTestLab/labs@2018-09-15"
name = "string"
parent_id = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
announcement = {
enabled = "string"
expirationDate = "string"
expired = bool
markdown = "string"
title = "string"
}
environmentPermission = "string"
extendedProperties = {
{customized property} = "string"
}
labStorageType = "string"
mandatoryArtifactsResourceIdsLinux = [
"string"
]
mandatoryArtifactsResourceIdsWindows = [
"string"
]
premiumDataDisks = "string"
support = {
enabled = "string"
markdown = "string"
}
}
}
}
屬性值
Microsoft.DevTestLab/labs
| Name | Description | Value |
|---|---|---|
| 位置 | 資源的位置。 | 字串 |
| name | 資源名稱 | 字串 (必要) |
| properties | 資源的屬性。 | LabProperties (必要) |
| tags | 資源標籤 | 標記名稱和值的字典。 |
| 型別 | 資源類型 | "Microsoft.DevTestLab/labs@2018-09-15" |
LabAnnouncementProperties
| Name | Description | Value |
|---|---|---|
| enabled | 實驗室公告目前是否為作用中/啟用? | 'Disabled' 'Enabled' |
| expirationDate | 公告到期的時間(永不為 Null) | 字串 |
| expired | 此公告是否已過期? | bool |
| markdown | 此實驗室顯示在UI中的Markdown文字(如果有的話)。 如果保留空白/Null,則不會顯示任何專案。 | 字串 |
| title | 實驗室公告的純文本標題 | 字串 |
LabProperties
| Name | Description | Value |
|---|---|---|
| announcement | 與此實驗室相關聯的任何實驗室公告屬性 | LabAnnouncementProperties |
| environmentPermission | 布建環境時要授與使用者的訪問許可權 | 'Contributor' 'Reader' |
| extendedProperties | 用於實驗功能的實驗室擴充屬性 | LabPropertiesExtendedProperties |
| labStorageType | 實驗室所使用的記憶體類型。 它可以是進階或標準。 預設值為 Premium。 | 'Premium' 'Standard' 'StandardSSD' |
| mandatoryArtifactsResourceIdsLinux | 在使用者指定的成品之前,預設應在所有 Linux VM 建立上套用的成品資源識別符排序列表。 | string[] |
| mandatoryArtifactsResourceIdsWindows | 在使用者指定的成品之前,預設應該在所有 Windows VM 建立上套用的成品資源識別符排序列表。 | string[] |
| premiumDataDisks | 啟用進階數據磁碟使用量的設定。 當其值為 「已啟用」時,允許建立標準或進階數據磁碟。 當其值為 「已停用」時,只允許建立標準數據磁碟。 |
'Disabled' 'Enabled' |
| 支援 | 與此實驗室相關聯的任何實驗室支援訊息屬性 | LabSupportProperties |
LabPropertiesExtendedProperties
| Name | Description | Value |
|---|
LabSupportProperties
| Name | Description | Value |
|---|---|---|
| enabled | 實驗室支援橫幅目前是否為使用中/啟用? | 'Disabled' 'Enabled' |
| markdown | 此實驗室顯示在UI中的Markdown文字(如果有的話)。 如果保留空白/Null,則不會顯示任何專案。 | 字串 |
ResourceTags
| Name | Description | Value |
|---|
使用範例
Terraform 範例
部署開發測試實驗室的基本範例。
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" "lab" {
type = "Microsoft.DevTestLab/labs@2018-09-15"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
labStorageType = "Premium"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}