Microsoft.Authorization policyDefinitions/versions
Bicep 資源定義
policyDefinitions/versions 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.Authorization/policyDefinitions/versions 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.Authorization/policyDefinitions/versions@2025-01-01' = {
parent: resourceSymbolicName
name: 'string'
properties: {
description: 'string'
displayName: 'string'
metadata: any(...)
mode: 'string'
parameters: {
{customized property}: {
allowedValues: [
any(...)
]
defaultValue: any(...)
metadata: {
assignPermissions: bool
description: 'string'
displayName: 'string'
strongType: 'string'
}
schema: any(...)
type: 'string'
}
}
policyRule: any(...)
policyType: 'string'
version: 'string'
}
}
屬性值
Microsoft.Authorization/policyDefinitions/versions
名字 | 描述 | 價值 |
---|---|---|
名字 | 資源名稱 | 字串 約束: 模式 = ^\d+\.\d+\.\d+$ (必要) |
父母 | 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。 如需詳細資訊,請參閱 父資源外部的子資源。 |
類型資源的符號名稱:policyDefinitions |
性能 | 原則定義版本屬性。 | PolicyDefinitionVersionProperties |
ParameterDefinitions
名字 | 描述 | 價值 |
---|
ParameterDefinitionsValue
名字 | 描述 | 價值 |
---|---|---|
allowedValues | 參數的允許值。 | any[] |
defaultValue | 如果未提供任何值,則為 參數的預設值。 | 任何 |
元數據 | 參數的一般元數據。 | ParameterDefinitionsValueMetadata |
圖式 | 使用自我定義 JSON 架構,在指派期間提供參數輸入的驗證。 此屬性僅支持物件類型參數,並遵循架構 2019-09 實作 Json.NET。 您可以在 https://json-schema.org/ 深入瞭解如何使用架構,並在 https://www.jsonschemavalidator.net/測試草稿架構。 | 任何 |
類型 | 參數的數據類型。 | 'Array' 'Boolean' 'DateTime' 'Float' 'Integer' 'Object' 'String' |
ParameterDefinitionsValueMetadata
名字 | 描述 | 價值 |
---|---|---|
assignPermissions | 設定為 true,讓 Azure 入口網站在原則指派期間,於此參數的資源標識碼或資源範圍值上建立角色指派。 如果您想要在指派範圍之外指派許可權,這個屬性就很有用。 | bool |
描述 | 參數的描述。 | 字串 |
displayName | 參數的顯示名稱。 | 字串 |
strongType | 透過入口網站指派原則定義時使用。 提供內容感知值清單,供用戶選擇。 | 字串 |
PolicyDefinitionVersionProperties
名字 | 描述 | 價值 |
---|---|---|
描述 | 原則定義描述。 | 字串 |
displayName | 原則定義的顯示名稱。 | 字串 |
元數據 | 原則定義元數據。 元數據是開放式物件,通常是索引鍵值組的集合。 | 任何 |
模式 | 原則定義模式。 有些範例包括 All、Indexed、Microsoft.KeyVault.Data。 | 字串 |
參數 | 原則規則中使用的參數參數定義。 索引鍵是參數名稱。 | ParameterDefinitions |
policyRule | 原則規則。 | 任何 |
policyType | 原則定義的類型。 可能的值為 NotSpecified、BuiltIn、Custom 和 Static。 | 'BuiltIn' 'Custom' 'NotSpecified' 'Static' |
版本 | #.#.# 格式的原則定義版本。 | 字串 |
ARM 樣本資源定義
policyDefinitions/versions 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.Authorization/policyDefinitions/versions 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.Authorization/policyDefinitions/versions",
"apiVersion": "2025-01-01",
"name": "string",
"properties": {
"description": "string",
"displayName": "string",
"metadata": {},
"mode": "string",
"parameters": {
"{customized property}": {
"allowedValues": [ {} ],
"defaultValue": {},
"metadata": {
"assignPermissions": "bool",
"description": "string",
"displayName": "string",
"strongType": "string"
},
"schema": {},
"type": "string"
}
},
"policyRule": {},
"policyType": "string",
"version": "string"
}
}
屬性值
Microsoft.Authorization/policyDefinitions/versions
名字 | 描述 | 價值 |
---|---|---|
apiVersion | API 版本 | '2025-01-01' |
名字 | 資源名稱 | 字串 約束: 模式 = ^\d+\.\d+\.\d+$ (必要) |
性能 | 原則定義版本屬性。 | PolicyDefinitionVersionProperties |
類型 | 資源類型 | 'Microsoft.Authorization/policyDefinitions/versions' |
ParameterDefinitions
名字 | 描述 | 價值 |
---|
ParameterDefinitionsValue
名字 | 描述 | 價值 |
---|---|---|
allowedValues | 參數的允許值。 | any[] |
defaultValue | 如果未提供任何值,則為 參數的預設值。 | 任何 |
元數據 | 參數的一般元數據。 | ParameterDefinitionsValueMetadata |
圖式 | 使用自我定義 JSON 架構,在指派期間提供參數輸入的驗證。 此屬性僅支持物件類型參數,並遵循架構 2019-09 實作 Json.NET。 您可以在 https://json-schema.org/ 深入瞭解如何使用架構,並在 https://www.jsonschemavalidator.net/測試草稿架構。 | 任何 |
類型 | 參數的數據類型。 | 'Array' 'Boolean' 'DateTime' 'Float' 'Integer' 'Object' 'String' |
ParameterDefinitionsValueMetadata
名字 | 描述 | 價值 |
---|---|---|
assignPermissions | 設定為 true,讓 Azure 入口網站在原則指派期間,於此參數的資源標識碼或資源範圍值上建立角色指派。 如果您想要在指派範圍之外指派許可權,這個屬性就很有用。 | bool |
描述 | 參數的描述。 | 字串 |
displayName | 參數的顯示名稱。 | 字串 |
strongType | 透過入口網站指派原則定義時使用。 提供內容感知值清單,供用戶選擇。 | 字串 |
PolicyDefinitionVersionProperties
名字 | 描述 | 價值 |
---|---|---|
描述 | 原則定義描述。 | 字串 |
displayName | 原則定義的顯示名稱。 | 字串 |
元數據 | 原則定義元數據。 元數據是開放式物件,通常是索引鍵值組的集合。 | 任何 |
模式 | 原則定義模式。 有些範例包括 All、Indexed、Microsoft.KeyVault.Data。 | 字串 |
參數 | 原則規則中使用的參數參數定義。 索引鍵是參數名稱。 | ParameterDefinitions |
policyRule | 原則規則。 | 任何 |
policyType | 原則定義的類型。 可能的值為 NotSpecified、BuiltIn、Custom 和 Static。 | 'BuiltIn' 'Custom' 'NotSpecified' 'Static' |
版本 | #.#.# 格式的原則定義版本。 | 字串 |
使用範例
Terraform (AzAPI 提供者) 資源定義
policyDefinitions/versions 資源類型可以使用目標作業來部署:
- 租使用者* 管理群組* 訂用帳戶
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.Authorization/policyDefinitions/versions 資源,請將下列 Terraform 新增至您的範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Authorization/policyDefinitions/versions@2025-01-01"
name = "string"
body = jsonencode({
properties = {
description = "string"
displayName = "string"
metadata = ?
mode = "string"
parameters = {
{customized property} = {
allowedValues = [
?
]
defaultValue = ?
metadata = {
assignPermissions = bool
description = "string"
displayName = "string"
strongType = "string"
}
schema = ?
type = "string"
}
}
policyRule = ?
policyType = "string"
version = "string"
}
})
}
屬性值
Microsoft.Authorization/policyDefinitions/versions
名字 | 描述 | 價值 |
---|---|---|
名字 | 資源名稱 | 字串 約束: 模式 = ^\d+\.\d+\.\d+$ (必要) |
parent_id | 此資源為父系之資源的標識碼。 | 類型資源的標識碼:policyDefinitions |
性能 | 原則定義版本屬性。 | PolicyDefinitionVersionProperties |
類型 | 資源類型 | “Microsoft.Authorization/policyDefinitions/versions@2025-01-01” |
ParameterDefinitions
名字 | 描述 | 價值 |
---|
ParameterDefinitionsValue
名字 | 描述 | 價值 |
---|---|---|
allowedValues | 參數的允許值。 | any[] |
defaultValue | 如果未提供任何值,則為 參數的預設值。 | 任何 |
元數據 | 參數的一般元數據。 | ParameterDefinitionsValueMetadata |
圖式 | 使用自我定義 JSON 架構,在指派期間提供參數輸入的驗證。 此屬性僅支持物件類型參數,並遵循架構 2019-09 實作 Json.NET。 您可以在 https://json-schema.org/ 深入瞭解如何使用架構,並在 https://www.jsonschemavalidator.net/測試草稿架構。 | 任何 |
類型 | 參數的數據類型。 | 'Array' 'Boolean' 'DateTime' 'Float' 'Integer' 'Object' 'String' |
ParameterDefinitionsValueMetadata
名字 | 描述 | 價值 |
---|---|---|
assignPermissions | 設定為 true,讓 Azure 入口網站在原則指派期間,於此參數的資源標識碼或資源範圍值上建立角色指派。 如果您想要在指派範圍之外指派許可權,這個屬性就很有用。 | bool |
描述 | 參數的描述。 | 字串 |
displayName | 參數的顯示名稱。 | 字串 |
strongType | 透過入口網站指派原則定義時使用。 提供內容感知值清單,供用戶選擇。 | 字串 |
PolicyDefinitionVersionProperties
名字 | 描述 | 價值 |
---|---|---|
描述 | 原則定義描述。 | 字串 |
displayName | 原則定義的顯示名稱。 | 字串 |
元數據 | 原則定義元數據。 元數據是開放式物件,通常是索引鍵值組的集合。 | 任何 |
模式 | 原則定義模式。 有些範例包括 All、Indexed、Microsoft.KeyVault.Data。 | 字串 |
參數 | 原則規則中使用的參數參數定義。 索引鍵是參數名稱。 | ParameterDefinitions |
policyRule | 原則規則。 | 任何 |
policyType | 原則定義的類型。 可能的值為 NotSpecified、BuiltIn、Custom 和 Static。 | 'BuiltIn' 'Custom' 'NotSpecified' 'Static' |
版本 | #.#.# 格式的原則定義版本。 | 字串 |