Примечание
Для доступа к этой странице требуется авторизация. Вы можете попробовать войти или изменить каталоги.
Для доступа к этой странице требуется авторизация. Вы можете попробовать изменить каталоги.
Bicep resource definition
The policyDefinitions resource type can be deployed with operations that target:
- Tenant - See tenant deployment commands* Management groups - See management group deployment commands* Subscription - See subscription deployment commands
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Authorization/policyDefinitions resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.Authorization/policyDefinitions@2025-03-01' = {
name: 'string'
properties: {
description: 'string'
displayName: 'string'
externalEvaluationEnforcementSettings: {
endpointSettings: {
details: any(...)
kind: 'string'
}
missingTokenAction: 'string'
resultLifespan: 'string'
roleDefinitionIds: [
'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'
versions: [
'string'
]
}
}
Property Values
ExternalEvaluationEndpointSettings
Имя | Описание | Ценность |
---|---|---|
подробности | The details of the endpoint. | any |
kind | The kind of the endpoint. | струна |
ExternalEvaluationEnforcementSettings
Имя | Описание | Ценность |
---|---|---|
endpointSettings | The settings of an external endpoint providing evaluation results. | ExternalEvaluationEndpointSettings |
missingTokenAction | What to do when evaluating an enforcement policy that requires an external evaluation and the token is missing. Possible values are Audit and Deny and language expressions are supported. | струна |
resultLifespan | The lifespan of the endpoint invocation result after which it's no longer valid. Value is expected to follow the ISO 8601 duration format and language expressions are supported. | струна |
roleDefinitionIds | An array of the role definition Ids the assignment's MSI will need in order to invoke the endpoint. | строка[] |
Microsoft.Authorization/policyDefinitions
Имя | Описание | Ценность |
---|---|---|
имя | The resource name | струна Constraints: Pattern = ^[^<>*%&:\?.+/]*[^<>*%&:\?.+/ ]+$ (required) |
свойства | The policy definition properties. | PolicyDefinitionProperties |
ParameterDefinitions
Имя | Описание | Ценность |
---|
ParameterDefinitionsValue
Имя | Описание | Ценность |
---|---|---|
allowedValues | The allowed values for the parameter. | any[] |
defaultValue | The default value for the parameter if no value is provided. | any |
метаданные | General metadata for the parameter. | ParameterDefinitionsValueMetadata |
схема | Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/. | any |
тип | The data type of the parameter. | 'Array' 'Boolean' 'DateTime' 'Float' 'Integer' 'Object' 'String' |
ParameterDefinitionsValueMetadata
Имя | Описание | Ценность |
---|---|---|
assignPermissions | Set to true to have Azure portal create role assignments on the resource ID or resource scope value of this parameter during policy assignment. This property is useful in case you wish to assign permissions outside the assignment scope. | bool |
описание | The description of the parameter. | струна |
displayName | The display name for the parameter. | струна |
strongType | Used when assigning the policy definition through the portal. Provides a context aware list of values for the user to choose from. | струна |
PolicyDefinitionProperties
Имя | Описание | Ценность |
---|---|---|
описание | The policy definition description. | струна |
displayName | The display name of the policy definition. | струна |
externalEvaluationEnforcementSettings | The details of the source of external evaluation results required by the policy during enforcement evaluation. | ExternalEvaluationEnforcementSettings |
метаданные | The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. | any |
mode | The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. | струна |
Параметры | The parameter definitions for parameters used in the policy rule. The keys are the parameter names. | ParameterDefinitions |
policyRule | The policy rule. | any |
policyType | The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. | 'BuiltIn' 'Custom' 'NotSpecified' 'Static' |
version | The policy definition version in #.#.# format. | струна |
versions | A list of available versions for this policy definition. | строка[] |
Примеры использования
Azure Quickstart Samples
The following Azure Quickstart templates contain Bicep samples for deploying this resource type.
Bicep File | Описание |
---|---|
Create an Azure Virtual Network Manager and sample VNETs | This template deploys an Azure Virtual Network Manager and sample virtual networks into the named resource group. It supports multiple connectivity topologies and network group membership types. |
Deploy a Policy Def and Assign to Multiple Mgmt Groups | This template is a management group level template that will create a policy definition and assign that policy to multiple management groups. |
Deploy a policy definition and assign to a management group | This template is a management group level template that will create a policy definition and assign that policy to the target management group. Currently, this template cannot be deployed via the Azure Portal. |
ARM template resource definition
The policyDefinitions resource type can be deployed with operations that target:
- Tenant - See tenant deployment commands* Management groups - See management group deployment commands* Subscription - See subscription deployment commands
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Authorization/policyDefinitions resource, add the following JSON to your template.
{
"type": "Microsoft.Authorization/policyDefinitions",
"apiVersion": "2025-03-01",
"name": "string",
"properties": {
"description": "string",
"displayName": "string",
"externalEvaluationEnforcementSettings": {
"endpointSettings": {
"details": {},
"kind": "string"
},
"missingTokenAction": "string",
"resultLifespan": "string",
"roleDefinitionIds": [ "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",
"versions": [ "string" ]
}
}
Property Values
ExternalEvaluationEndpointSettings
Имя | Описание | Ценность |
---|---|---|
подробности | The details of the endpoint. | any |
kind | The kind of the endpoint. | струна |
ExternalEvaluationEnforcementSettings
Имя | Описание | Ценность |
---|---|---|
endpointSettings | The settings of an external endpoint providing evaluation results. | ExternalEvaluationEndpointSettings |
missingTokenAction | What to do when evaluating an enforcement policy that requires an external evaluation and the token is missing. Possible values are Audit and Deny and language expressions are supported. | струна |
resultLifespan | The lifespan of the endpoint invocation result after which it's no longer valid. Value is expected to follow the ISO 8601 duration format and language expressions are supported. | струна |
roleDefinitionIds | An array of the role definition Ids the assignment's MSI will need in order to invoke the endpoint. | строка[] |
Microsoft.Authorization/policyDefinitions
Имя | Описание | Ценность |
---|---|---|
apiVersion | The api version | '2025-03-01' |
имя | The resource name | струна Constraints: Pattern = ^[^<>*%&:\?.+/]*[^<>*%&:\?.+/ ]+$ (required) |
свойства | The policy definition properties. | PolicyDefinitionProperties |
тип | The resource type | 'Microsoft.Authorization/policyDefinitions' |
ParameterDefinitions
Имя | Описание | Ценность |
---|
ParameterDefinitionsValue
Имя | Описание | Ценность |
---|---|---|
allowedValues | The allowed values for the parameter. | any[] |
defaultValue | The default value for the parameter if no value is provided. | any |
метаданные | General metadata for the parameter. | ParameterDefinitionsValueMetadata |
схема | Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/. | any |
тип | The data type of the parameter. | 'Array' 'Boolean' 'DateTime' 'Float' 'Integer' 'Object' 'String' |
ParameterDefinitionsValueMetadata
Имя | Описание | Ценность |
---|---|---|
assignPermissions | Set to true to have Azure portal create role assignments on the resource ID or resource scope value of this parameter during policy assignment. This property is useful in case you wish to assign permissions outside the assignment scope. | bool |
описание | The description of the parameter. | струна |
displayName | The display name for the parameter. | струна |
strongType | Used when assigning the policy definition through the portal. Provides a context aware list of values for the user to choose from. | струна |
PolicyDefinitionProperties
Имя | Описание | Ценность |
---|---|---|
описание | The policy definition description. | струна |
displayName | The display name of the policy definition. | струна |
externalEvaluationEnforcementSettings | The details of the source of external evaluation results required by the policy during enforcement evaluation. | ExternalEvaluationEnforcementSettings |
метаданные | The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. | any |
mode | The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. | струна |
Параметры | The parameter definitions for parameters used in the policy rule. The keys are the parameter names. | ParameterDefinitions |
policyRule | The policy rule. | any |
policyType | The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. | 'BuiltIn' 'Custom' 'NotSpecified' 'Static' |
version | The policy definition version in #.#.# format. | струна |
versions | A list of available versions for this policy definition. | строка[] |
Примеры использования
Шаблоны быстрого запуска Azure
The following Azure Quickstart templates deploy this resource type.
Шаблон | Описание |
---|---|
Create an Azure Virtual Network Manager and sample VNETs |
This template deploys an Azure Virtual Network Manager and sample virtual networks into the named resource group. It supports multiple connectivity topologies and network group membership types. |
Deploy a Policy Def and Assign to Multiple Mgmt Groups |
This template is a management group level template that will create a policy definition and assign that policy to multiple management groups. |
Deploy a policy definition and assign to a management group |
This template is a management group level template that will create a policy definition and assign that policy to the target management group. Currently, this template cannot be deployed via the Azure Portal. |
Terraform (AzAPI provider) resource definition
The policyDefinitions resource type can be deployed with operations that target:
- Tenant* Management groups* Subscription
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Authorization/policyDefinitions resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Authorization/policyDefinitions@2025-03-01"
name = "string"
body = {
properties = {
description = "string"
displayName = "string"
externalEvaluationEnforcementSettings = {
endpointSettings = {
details = ?
kind = "string"
}
missingTokenAction = "string"
resultLifespan = "string"
roleDefinitionIds = [
"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"
versions = [
"string"
]
}
}
}
Property Values
ExternalEvaluationEndpointSettings
Имя | Описание | Ценность |
---|---|---|
подробности | The details of the endpoint. | any |
kind | The kind of the endpoint. | струна |
ExternalEvaluationEnforcementSettings
Имя | Описание | Ценность |
---|---|---|
endpointSettings | The settings of an external endpoint providing evaluation results. | ExternalEvaluationEndpointSettings |
missingTokenAction | What to do when evaluating an enforcement policy that requires an external evaluation and the token is missing. Possible values are Audit and Deny and language expressions are supported. | струна |
resultLifespan | The lifespan of the endpoint invocation result after which it's no longer valid. Value is expected to follow the ISO 8601 duration format and language expressions are supported. | струна |
roleDefinitionIds | An array of the role definition Ids the assignment's MSI will need in order to invoke the endpoint. | строка[] |
Microsoft.Authorization/policyDefinitions
Имя | Описание | Ценность |
---|---|---|
имя | The resource name | струна Constraints: Pattern = ^[^<>*%&:\?.+/]*[^<>*%&:\?.+/ ]+$ (required) |
свойства | The policy definition properties. | PolicyDefinitionProperties |
тип | The resource type | "Microsoft.Authorization/policyDefinitions@2025-03-01" |
ParameterDefinitions
Имя | Описание | Ценность |
---|
ParameterDefinitionsValue
Имя | Описание | Ценность |
---|---|---|
allowedValues | The allowed values for the parameter. | any[] |
defaultValue | The default value for the parameter if no value is provided. | any |
метаданные | General metadata for the parameter. | ParameterDefinitionsValueMetadata |
схема | Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/. | any |
тип | The data type of the parameter. | 'Array' 'Boolean' 'DateTime' 'Float' 'Integer' 'Object' 'String' |
ParameterDefinitionsValueMetadata
Имя | Описание | Ценность |
---|---|---|
assignPermissions | Set to true to have Azure portal create role assignments on the resource ID or resource scope value of this parameter during policy assignment. This property is useful in case you wish to assign permissions outside the assignment scope. | bool |
описание | The description of the parameter. | струна |
displayName | The display name for the parameter. | струна |
strongType | Used when assigning the policy definition through the portal. Provides a context aware list of values for the user to choose from. | струна |
PolicyDefinitionProperties
Имя | Описание | Ценность |
---|---|---|
описание | The policy definition description. | струна |
displayName | The display name of the policy definition. | струна |
externalEvaluationEnforcementSettings | The details of the source of external evaluation results required by the policy during enforcement evaluation. | ExternalEvaluationEnforcementSettings |
метаданные | The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. | any |
mode | The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. | струна |
Параметры | The parameter definitions for parameters used in the policy rule. The keys are the parameter names. | ParameterDefinitions |
policyRule | The policy rule. | any |
policyType | The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. | 'BuiltIn' 'Custom' 'NotSpecified' 'Static' |
version | The policy definition version in #.#.# format. | струна |
versions | A list of available versions for this policy definition. | строка[] |