{ "swagger": "2.0", "info": { "title": "PolicyClient", "version": "2025-01-01", "description": "To manage and control access to your resources, you can define customized policies and assign them at a scope." }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": { "put": { "tags": [ "PolicySetDefinitions" ], "operationId": "PolicySetDefinitions_CreateOrUpdate", "summary": "Creates or updates a policy set definition.", "description": "This operation creates or updates a policy set definition in the given subscription with the given name.", "x-ms-examples": { "Create or update a policy set definition": { "$ref": "./examples/createOrUpdatePolicySetDefinition.json" }, "Create or update a policy set definition with groups": { "$ref": "./examples/createOrUpdatePolicySetDefinitionWithGroups.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", "in": "path", "required": true, "type": "string", "pattern": "^[^<>%&:\\?/]*[^<>%&:\\?/ ]+$", "description": "The name of the policy set definition to create." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PolicySetDefinition" }, "description": "The policy set definition properties." }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "201": { "description": "Created - Returns information about the policy set definition.", "schema": { "$ref": "#/definitions/PolicySetDefinition" } }, "200": { "description": "OK - Returns information about the policy set definition.", "schema": { "$ref": "#/definitions/PolicySetDefinition" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } }, "delete": { "tags": [ "PolicySetDefinitions" ], "operationId": "PolicySetDefinitions_Delete", "summary": "Deletes a policy set definition.", "description": "This operation deletes the policy set definition in the given subscription with the given name.", "x-ms-examples": { "Delete a policy set definition": { "$ref": "./examples/deletePolicySetDefinition.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", "in": "path", "required": true, "type": "string", "pattern": "^[^<>%&:\\?/]*[^<>%&:\\?/ ]+$", "description": "The name of the policy set definition to delete." }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "204": { "description": "No Content - the policy set definition doesn't exist in the subscription." }, "200": { "description": "OK" }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } }, "get": { "tags": [ "PolicySetDefinitions" ], "operationId": "PolicySetDefinitions_Get", "summary": "Retrieves a policy set definition.", "description": "This operation retrieves the policy set definition in the given subscription with the given name.", "x-ms-examples": { "Retrieve a policy set definition": { "$ref": "./examples/getPolicySetDefinition.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", "in": "path", "required": true, "type": "string", "pattern": "^[^<>%&:\\?/]*[^<>%&:\\?/ ]+$", "description": "The name of the policy set definition to get." }, { "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK - Returns information about the policy set definition.", "schema": { "$ref": "#/definitions/PolicySetDefinition" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } } }, "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": { "get": { "tags": [ "PolicySetDefinitions" ], "operationId": "PolicySetDefinitions_GetBuiltIn", "summary": "Retrieves a built in policy set definition.", "description": "This operation retrieves the built-in policy set definition with the given name.", "x-ms-examples": { "Retrieve a built-in policy set definition": { "$ref": "./examples/getBuiltInPolicySetDefinition.json" } }, "parameters": [ { "name": "policySetDefinitionName", "in": "path", "required": true, "type": "string", "pattern": "^[^<>%&:\\?/]*[^<>%&:\\?/ ]+$", "description": "The name of the policy set definition to get." }, { "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK - Returns information about the built in policy set definition.", "schema": { "$ref": "#/definitions/PolicySetDefinition" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions": { "get": { "tags": [ "PolicySetDefinitions" ], "operationId": "PolicySetDefinitions_List", "summary": "Retrieves the policy set definitions for a subscription.", "description": "This operation retrieves a list of all the policy set definitions in a given subscription that match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with the subscription, including those that apply directly or from management groups that contain the given subscription. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn and Custom. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}.", "x-ms-examples": { "List policy set definitions": { "$ref": "./examples/listPolicySetDefinitions.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/PolicySetDefinitionsFilterParameter" }, { "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" }, { "$ref": "#/parameters/TopParameter" } ], "responses": { "200": { "description": "OK - Returns an array of policy set definitions.", "schema": { "$ref": "#/definitions/PolicySetDefinitionListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/providers/Microsoft.Authorization/policySetDefinitions": { "get": { "tags": [ "PolicySetDefinitions" ], "operationId": "PolicySetDefinitions_ListBuiltIn", "summary": "Retrieves built-in policy set definitions.", "description": "This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set definitions whose category match the {value}.", "x-ms-examples": { "List built-in policy set definitions": { "$ref": "./examples/listBuiltInPolicySetDefinitions.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/PolicySetDefinitionsFilterParameter" }, { "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" }, { "$ref": "#/parameters/TopParameter" } ], "responses": { "200": { "description": "OK - Returns an array of built in policy set definitions.", "schema": { "$ref": "#/definitions/PolicySetDefinitionListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": { "put": { "tags": [ "PolicySetDefinitions" ], "operationId": "PolicySetDefinitions_CreateOrUpdateAtManagementGroup", "summary": "Creates or updates a policy set definition.", "description": "This operation creates or updates a policy set definition in the given management group with the given name.", "x-ms-examples": { "Create or update a policy set definition at management group level": { "$ref": "./examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json" }, "Create or update a policy set definition with groups at management group level": { "$ref": "./examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json" } }, "parameters": [ { "$ref": "#/parameters/ManagementGroupIdParameter" }, { "name": "policySetDefinitionName", "in": "path", "required": true, "type": "string", "pattern": "^[^<>%&:\\?/]*[^<>%&:\\?/ ]+$", "description": "The name of the policy set definition to create." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PolicySetDefinition" }, "description": "The policy set definition properties." }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "201": { "description": "Created - Returns information about the policy set definition.", "schema": { "$ref": "#/definitions/PolicySetDefinition" } }, "200": { "description": "OK - Returns information about the policy set definition.", "schema": { "$ref": "#/definitions/PolicySetDefinition" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } }, "delete": { "tags": [ "PolicySetDefinitions" ], "operationId": "PolicySetDefinitions_DeleteAtManagementGroup", "summary": "Deletes a policy set definition.", "description": "This operation deletes the policy set definition in the given management group with the given name.", "x-ms-examples": { "Delete a policy set definition at management group level": { "$ref": "./examples/deletePolicySetDefinitionAtManagementGroup.json" } }, "parameters": [ { "$ref": "#/parameters/ManagementGroupIdParameter" }, { "name": "policySetDefinitionName", "in": "path", "required": true, "type": "string", "pattern": "^[^<>%&:\\?/]*[^<>%&:\\?/ ]+$", "description": "The name of the policy set definition to delete." }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "204": { "description": "No Content - the policy set definition doesn't exist in the subscription." }, "200": { "description": "OK" }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } }, "get": { "tags": [ "PolicySetDefinitions" ], "operationId": "PolicySetDefinitions_GetAtManagementGroup", "summary": "Retrieves a policy set definition.", "description": "This operation retrieves the policy set definition in the given management group with the given name.", "x-ms-examples": { "Retrieve a policy set definition at management group level": { "$ref": "./examples/getPolicySetDefinitionAtManagementGroup.json" } }, "parameters": [ { "$ref": "#/parameters/ManagementGroupIdParameter" }, { "name": "policySetDefinitionName", "in": "path", "required": true, "type": "string", "pattern": "^[^<>%&:\\?/]*[^<>%&:\\?/ ]+$", "description": "The name of the policy set definition to get." }, { "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK - Returns information about the policy set definition.", "schema": { "$ref": "#/definitions/PolicySetDefinition" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } } }, "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions": { "get": { "tags": [ "PolicySetDefinitions" ], "operationId": "PolicySetDefinitions_ListByManagementGroup", "summary": "Retrieves all policy set definitions in management group.", "description": "This operation retrieves a list of all the policy set definitions in a given management group that match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with the management group, including those that apply directly or from management groups that contain the given management group. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given management group. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn and Custom. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}.", "x-ms-examples": { "List policy set definitions at management group level": { "$ref": "./examples/listPolicySetDefinitionsByManagementGroup.json" } }, "parameters": [ { "$ref": "#/parameters/ManagementGroupIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/PolicySetDefinitionsFilterParameter" }, { "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" }, { "$ref": "#/parameters/TopParameter" } ], "responses": { "200": { "description": "OK - Returns an array of policy set definitions.", "schema": { "$ref": "#/definitions/PolicySetDefinitionListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "CloudError": { "type": "object", "x-ms-external": true, "properties": { "error": { "$ref": "../../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse" } }, "description": "An error response from a policy operation." }, "PolicySetDefinitionProperties": { "type": "object", "properties": { "policyType": { "type": "string", "description": "The type of policy set definition. Possible values are NotSpecified, BuiltIn, Custom, and Static.", "enum": [ "NotSpecified", "BuiltIn", "Custom", "Static" ], "x-ms-enum": { "name": "policyType", "modelAsString": true } }, "displayName": { "type": "string", "description": "The display name of the policy set definition." }, "description": { "type": "string", "description": "The policy set definition description." }, "metadata": { "type": "object", "description": "The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." }, "parameters": { "description": "The policy set definition parameters that can be used in policy definition references.", "$ref": "./policyDefinitions.json#/definitions/ParameterDefinitions" }, "policyDefinitions": { "type": "array", "items": { "$ref": "#/definitions/PolicyDefinitionReference" }, "x-ms-identifiers": [ "policyDefinitionReferenceId" ], "description": "An array of policy definition references." }, "policyDefinitionGroups": { "type": "array", "items": { "$ref": "#/definitions/PolicyDefinitionGroup" }, "x-ms-identifiers": [ "name" ], "description": "The metadata describing groups of policy definition references within the policy set definition." }, "version": { "type": "string", "description": "The policy set definition version in #.#.# format." }, "versions": { "type": "array", "items": { "type": "string" }, "description": "A list of available versions for this policy set definition." } }, "required": [ "policyDefinitions" ], "description": "The policy set definition properties." }, "PolicyDefinitionReference": { "type": "object", "properties": { "policyDefinitionId": { "type": "string", "description": "The ID of the policy definition or policy set definition." }, "definitionVersion": { "type": "string", "description": "The version of the policy definition to use." }, "latestDefinitionVersion": { "type": "string", "description": "The latest version of the policy definition available. This is only present if requested via the $expand query parameter.", "readOnly": true }, "effectiveDefinitionVersion": { "type": "string", "description": "The effective version of the policy definition in use. This is only present if requested via the $expand query parameter.", "readOnly": true }, "parameters": { "description": "The parameter values for the referenced policy rule. The keys are the parameter names.", "$ref": "./policyAssignments.json#/definitions/ParameterValues" }, "policyDefinitionReferenceId": { "type": "string", "description": "A unique id (within the policy set definition) for this policy definition reference." }, "groupNames": { "type": "array", "items": { "type": "string" }, "description": "The name of the groups that this policy definition reference belongs to." } }, "required": [ "policyDefinitionId" ], "description": "The policy definition reference." }, "PolicyDefinitionGroup": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the group." }, "displayName": { "type": "string", "description": "The group's display name." }, "category": { "type": "string", "description": "The group's category." }, "description": { "type": "string", "description": "The group's description." }, "additionalMetadataId": { "type": "string", "description": "A resource ID of a resource that contains additional metadata about the group." } }, "required": [ "name" ], "description": "The policy definition group." }, "PolicySetDefinition": { "type": "object", "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PolicySetDefinitionProperties", "description": "The policy set definition properties." }, "id": { "readOnly": true, "type": "string", "description": "The ID of the policy set definition." }, "name": { "readOnly": true, "type": "string", "description": "The name of the policy set definition." }, "type": { "readOnly": true, "type": "string", "description": "The type of the resource (Microsoft.Authorization/policySetDefinitions)." }, "systemData": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/systemData", "readOnly": true, "description": "The system metadata relating to this resource." } }, "description": "The policy set definition.", "x-ms-azure-resource": true }, "PolicySetDefinitionListResult": { "type": "object", "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/PolicySetDefinition" }, "description": "An array of policy set definitions." }, "nextLink": { "type": "string", "description": "The URL to use for getting the next set of results." } }, "description": "List of policy set definitions." } }, "parameters": { "ManagementGroupIdParameter": { "name": "managementGroupId", "in": "path", "required": true, "type": "string", "description": "The ID of the management group.", "x-ms-parameter-location": "method" }, "PolicySetDefinitionsFilterParameter": { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}.", "x-ms-skip-url-encoding": true, "x-ms-parameter-location": "method" }, "PolicySetDefinitionsExpandParameter": { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", "x-ms-parameter-location": "method" }, "TopParameter": { "name": "$top", "in": "query", "required": false, "type": "integer", "format": "int32", "minimum": 1, "maximum": 1000, "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", "x-ms-parameter-location": "method" } } }