Share via


Microsoft.Authorization policyExemptions 2022-07-01-preview

Bicep 資源定義

policyExemptions 資源類型是 延伸模組資源,這表示您可以將它套用至另一個資源。

scope使用此資源上的 屬性來設定此資源的範圍。 請參閱 在 Bicep 中設定擴充功能資源的範圍

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

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

資源格式

若要建立 Microsoft.Authorization/policyExemptions 資源,請將下列 Bicep 新增至您的範本。

resource symbolicname 'Microsoft.Authorization/policyExemptions@2022-07-01-preview' = {
  name: 'string'
  scope: resourceSymbolicName
  properties: {
    assignmentScopeValidation: 'string'
    description: 'string'
    displayName: 'string'
    exemptionCategory: 'string'
    expiresOn: 'string'
    metadata: any()
    policyAssignmentId: 'string'
    policyDefinitionReferenceIds: [
      'string'
    ]
    resourceSelectors: [
      {
        name: 'string'
        selectors: [
          {
            in: [
              'string'
            ]
            kind: 'string'
            notIn: [
              'string'
            ]
          }
        ]
      }
    ]
  }
}

屬性值

policyExemptions

名稱 描述
NAME 資源名稱 字串 (必要)

字元限制:1-128 顯示名稱

1-64 (資源名稱)

合法字元:
顯示名稱可包含任何字元。

資源名稱不能使用:
<>*%&:\?.+/ 或控制字元。

不能以句號或空格結尾。
範圍 在與部署範圍不同的範圍建立擴充資源時,請使用 。 目標資源

針對 Bicep,請將此屬性設定為資源的符號名稱,以套用 延伸模組資源
properties 原則豁免的屬性。 PolicyExemptionProperties (必要)

PolicyExemptionProperties

名稱 描述
assignmentScopeValidation 驗證豁免的選項位於或指派範圍底下。 'Default'
'DoNotValidate'
description 原則豁免的描述。 字串
displayName 原則豁免的顯示名稱。 字串
exemptionCategory 原則豁免類別。 可能的值為「豁免」和「緩和」。 「已緩和」
必要 ()
expiresOn 到期日期和時間 (UTC ISO 8601 格式 yyyy-MM-ddTHH:mm:ssZ) 原則豁免。 字串
中繼資料 原則豁免元數據。 元數據是開放式物件,通常是索引鍵值組的集合。 針對 Bicep,您可以使用 任何 () 函式。
policyAssignmentId 要豁免的原則指派標識碼。 字串 (必要)
policyDefinitionReferenceIds 當相關聯的原則指派是原則集定義的指派時,原則定義參考標識符清單。 string[]
resourceSelectors 要依資源屬性篩選原則的資源選取器清單。 ResourceSelector[]

ResourceSelector

名稱 描述
NAME 資源選取器的名稱。 字串
選擇 選取器表達式的清單。 Selector[]

選取器

名稱 描述
in 要篩選的值清單。 string[]
kind 選取器種類。 'policyDefinitionReferenceId'
'resourceLocation'
'resourceType'
'resourceWithoutLocation'
notIn 要篩選出的值清單。 string[]

ARM 範本資源定義

policyExemptions 資源類型是 延伸模組資源,這表示您可以將它套用至另一個資源。

scope使用此資源上的 屬性來設定此資源的範圍。 請參閱 在ARM範本中設定擴充功能資源的範圍

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

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

資源格式

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

{
  "type": "Microsoft.Authorization/policyExemptions",
  "apiVersion": "2022-07-01-preview",
  "name": "string",
  "scope": "string",
  "properties": {
    "assignmentScopeValidation": "string",
    "description": "string",
    "displayName": "string",
    "exemptionCategory": "string",
    "expiresOn": "string",
    "metadata": {},
    "policyAssignmentId": "string",
    "policyDefinitionReferenceIds": [ "string" ],
    "resourceSelectors": [
      {
        "name": "string",
        "selectors": [
          {
            "in": [ "string" ],
            "kind": "string",
            "notIn": [ "string" ]
          }
        ]
      }
    ]
  }
}

屬性值

policyExemptions

名稱 描述
類型 資源類型 'Microsoft.Authorization/policyExemptions'
apiVersion 資源 API 版本 '2022-07-01-preview'
NAME 資源名稱 字串 (必要)

字元限制:1-128 顯示名稱

1-64 (資源名稱)

合法字元:
顯示名稱可包含任何字元。

資源名稱不能使用:
<>*%&:\?.+/ 或控制字元。

不能以句號或空格結尾。
範圍 在與部署範圍不同的範圍建立擴充資源時,請使用 。 目標資源

針對 JSON,請將值設定為要套用 擴充資源 的資源完整名稱。
properties 原則豁免的屬性。 PolicyExemptionProperties (必要)

PolicyExemptionProperties

名稱 描述
assignmentScopeValidation 驗證豁免的選項位於或指派範圍底下。 'Default'
'DoNotValidate'
description 原則豁免的描述。 字串
displayName 原則豁免的顯示名稱。 字串
exemptionCategory 原則豁免類別。 可能的值為「豁免」和「緩和」。 「已緩和」
必要 ()
expiresOn 到期日期和時間 (UTC ISO 8601 格式 yyyy-MM-ddTHH:mm:ssZ) 原則豁免。 字串
中繼資料 原則豁免元數據。 元數據是開放式物件,通常是索引鍵值組的集合。
policyAssignmentId 要豁免的原則指派標識碼。 字串 (必要)
policyDefinitionReferenceIds 當相關聯的原則指派是原則集定義的指派時,原則定義參考標識符清單。 string[]
resourceSelectors 要依資源屬性篩選原則的資源選取器清單。 ResourceSelector[]

ResourceSelector

名稱 描述
NAME 資源選取器的名稱。 字串
選擇 選取器表達式的清單。 Selector[]

選取器

名稱 描述
in 要篩選的值清單。 string[]
kind 選取器種類。 'policyDefinitionReferenceId'
'resourceLocation'
'resourceType'
'resourceWithoutLocation'
notIn 要篩選出的值清單。 string[]

Terraform (AzAPI 提供者) 資源定義

policyExemptions 資源類型是 延伸模組資源,這表示您可以將它套用至另一個資源。

parent_id使用此資源上的 屬性來設定此資源的範圍。

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

  • 資源群組
  • 訂用帳戶
  • 管理群組

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

資源格式

若要建立 Microsoft.Authorization/policyExemptions 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Authorization/policyExemptions@2022-07-01-preview"
  name = "string"
  parent_id = "string"
  body = jsonencode({
    properties = {
      assignmentScopeValidation = "string"
      description = "string"
      displayName = "string"
      exemptionCategory = "string"
      expiresOn = "string"
      policyAssignmentId = "string"
      policyDefinitionReferenceIds = [
        "string"
      ]
      resourceSelectors = [
        {
          name = "string"
          selectors = [
            {
              in = [
                "string"
              ]
              kind = "string"
              notIn = [
                "string"
              ]
            }
          ]
        }
      ]
    }
  })
}

屬性值

policyExemptions

名稱 描述
類型 資源類型 “Microsoft.Authorization/policyExemptions@2022-07-01-preview”
NAME 資源名稱 字串 (必要)

字元限制:1-128 顯示名稱

1-64 (資源名稱)

合法字元:
顯示名稱可包含任何字元。

資源名稱不能使用:
<>*%&:\?.+/ 或控制字元。

不能以句號或空格結尾。
parent_id 要套用此延伸模組資源的資源標識碼。 字串 (必要)
properties 原則豁免的屬性。 PolicyExemptionProperties (必要)

PolicyExemptionProperties

名稱 描述
assignmentScopeValidation 驗證豁免的選項位於或指派範圍底下。 “Default”
“DoNotValidate”
description 原則豁免的描述。 字串
displayName 原則豁免的顯示名稱。 字串
exemptionCategory 原則豁免類別。 可能的值為「豁免」和「緩和」。 「緩和」
必要) 「豁免」 (
expiresOn 到期日期和時間 (UTC ISO 8601 格式 yyyy-MM-ddTHH:mm:ssZ) 原則豁免。 字串
中繼資料 原則豁免元數據。 元數據是開放式物件,通常是索引鍵值組的集合。
policyAssignmentId 要豁免的原則指派標識碼。 字串 (必要)
policyDefinitionReferenceIds 當相關聯的原則指派是原則集定義的指派時,原則定義參考標識符清單。 string[]
resourceSelectors 要依資源屬性篩選原則的資源選取器清單。 ResourceSelector[]

ResourceSelector

名稱 描述
NAME 資源選取器的名稱。 字串
選擇 選取器表達式的清單。 Selector[]

選取器

名稱 描述
in 要篩選的值清單。 string[]
kind 選取器種類。 “policyDefinitionReferenceId”
“resourceLocation”
“resourceType”
“resourceWithoutLocation”
notIn 要篩選出的值清單。 string[]