Policy Set Definitions - Get At Management Group

擷取原則集定義。
此作業會擷取指定管理群組中具有指定名稱的原則集定義。

GET https://management.azure.com/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}?api-version=2023-04-01

URI 參數

名稱 位於 必要 類型 Description
managementGroupId
path True

string

管理群組的標識碼。

policySetDefinitionName
path True

string

要取得的原則集定義名稱。

Regex pattern: ^[^<>*%&:\?.+/]*[^<>*%&:\?.+/ ]+$

api-version
query True

string

用於此作業的 API 版本。

回應

名稱 類型 Description
200 OK

PolicySetDefinition

確定 - 傳回原則集定義的相關信息。

Other Status Codes

CloudError

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

Retrieve a policy set definition at management group level

Sample Request

GET https://management.azure.com/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement?api-version=2023-04-01

Sample Response

{
  "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement",
  "type": "Microsoft.Authorization/policySetDefinitions",
  "name": "CostManagement",
  "properties": {
    "displayName": "Cost Management",
    "description": "Policies to enforce low cost storage SKUs",
    "metadata": {
      "category": "Cost Management"
    },
    "version": "1.2.1",
    "versions": [
      "1.2.1",
      "1.0.0"
    ],
    "policyDefinitions": [
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1",
        "policyDefinitionReferenceId": "Limit_Skus",
        "parameters": {
          "listOfAllowedSKUs": {
            "value": [
              "Standard_GRS",
              "Standard_LRS"
            ]
          }
        }
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming",
        "policyDefinitionReferenceId": "Resource_Naming",
        "parameters": {
          "prefix": {
            "value": "DeptA"
          },
          "suffix": {
            "value": "-LC"
          }
        }
      }
    ]
  }
}

定義

名稱 Description
CloudError

原則作業的錯誤回應。

createdByType

建立資源的身分識別類型。

ErrorAdditionalInfo

資源管理錯誤其他資訊。

ErrorResponse

錯誤回應

Metadata

參數的一般元數據。

ParameterDefinitionsValue

可提供給原則的參數定義。

parameterType

參數的資料類型。

ParameterValuesValue

參數的值。

PolicyDefinitionGroup

原則定義群組。

PolicyDefinitionReference

原則定義參考。

PolicySetDefinition

原則集定義。

policyType

原則集定義的類型。 可能的值為 NotSpecified、BuiltIn、Custom 和 Static。

systemData

與建立和上次修改資源相關的元數據。

CloudError

原則作業的錯誤回應。

名稱 類型 Description
error

ErrorResponse

錯誤回應
所有 Azure Resource Manager API 的常見錯誤回應,以傳回失敗作業的錯誤詳細數據。 (這也會遵循 OData 錯誤回應格式。)

createdByType

建立資源的身分識別類型。

名稱 類型 Description
Application

string

Key

string

ManagedIdentity

string

User

string

ErrorAdditionalInfo

資源管理錯誤其他資訊。

名稱 類型 Description
info

object

其他資訊。

type

string

其他信息類型。

ErrorResponse

錯誤回應

名稱 類型 Description
additionalInfo

ErrorAdditionalInfo[]

錯誤其他資訊。

code

string

錯誤碼。

details

ErrorResponse[]

錯誤詳細資料。

message

string

錯誤訊息。

target

string

錯誤目標。

Metadata

參數的一般元數據。

名稱 類型 Description
assignPermissions

boolean

設定為 true,讓 Azure 入口網站 在原則指派期間,於此參數的資源標識符或資源範圍值上建立角色指派。 如果您想要在指派範圍之外指派權限,此屬性會很有用。

description

string

參數的描述。

displayName

string

參數的顯示名稱。

strongType

string

透過入口網站指派原則定義時使用。 提供內容感知值清單,供用戶選擇。

ParameterDefinitionsValue

可提供給原則的參數定義。

名稱 類型 Description
allowedValues

object[]

參數的允許值。

defaultValue

object

如果未提供任何值,則為 參數的預設值。

metadata

Metadata

參數的一般元數據。

schema

object

使用自我定義 JSON 架構在指派期間提供參數輸入的驗證。 此屬性僅支援物件類型參數,並遵循 Json.NET 結構描述 2019-09 實作。 您可在 https://json-schema.org/ 中深入了解如何使用結構描述,並在 https://www.jsonschemavalidator.net/ 中測試草稿結構描述。

type

parameterType

參數的資料類型。

parameterType

參數的資料類型。

名稱 類型 Description
Array

string

Boolean

string

DateTime

string

Float

string

Integer

string

Object

string

String

string

ParameterValuesValue

參數的值。

名稱 類型 Description
value

object

參數的值。

PolicyDefinitionGroup

原則定義群組。

名稱 類型 Description
additionalMetadataId

string

資源的資源標識碼,其中包含群組的其他元數據。

category

string

群組的類別。

description

string

群組的描述。

displayName

string

群組的顯示名稱。

name

string

群組的名稱。

PolicyDefinitionReference

原則定義參考。

名稱 類型 Description
groupNames

string[]

此原則定義參考所屬的組名。

parameters

<string,  ParameterValuesValue>

參考之原則規則的參數值。 索引鍵是參數名稱。

policyDefinitionId

string

原則定義或原則集定義的標識碼。

policyDefinitionReferenceId

string

此原則定義參考的原則集定義) 內的唯一標識子 (。

PolicySetDefinition

原則集定義。

名稱 類型 Description
id

string

原則集定義的標識碼。

name

string

原則集定義的名稱。

properties.description

string

原則集定義描述。

properties.displayName

string

原則集定義的顯示名稱。

properties.metadata

object

原則集定義元數據。 元數據是開放式物件,通常是索引鍵值組的集合。

properties.parameters

<string,  ParameterDefinitionsValue>

原則集定義參數,可用於原則定義參考。

properties.policyDefinitionGroups

PolicyDefinitionGroup[]

元數據,描述原則集定義內的原則定義參考群組。

properties.policyDefinitions

PolicyDefinitionReference[]

原則定義參考的陣列。

properties.policyType

policyType

原則集定義的類型。 可能的值為 NotSpecified、BuiltIn、Custom 和 Static。

properties.version

string

#.#.# 格式的原則集定義版本。

properties.versions

string[]

此原則集定義的可用版本清單。

systemData

systemData

與此資源相關的系統元數據。

type

string

(Microsoft.Authorization/policySetDefinitions) 的資源類型。

policyType

原則集定義的類型。 可能的值為 NotSpecified、BuiltIn、Custom 和 Static。

名稱 類型 Description
BuiltIn

string

Custom

string

NotSpecified

string

Static

string

systemData

與建立和上次修改資源相關的元數據。

名稱 類型 Description
createdAt

string

資源建立的時間戳 (UTC) 。

createdBy

string

建立資源的身分識別。

createdByType

createdByType

建立資源的身分識別類型。

lastModifiedAt

string

上次修改的資源時間戳 (UTC)

lastModifiedBy

string

上次修改資源的身分識別。

lastModifiedByType

createdByType

上次修改資源的身分識別類型。