From 8a37528a74cfec9d9aab9cb4f2e7aa48e5d7dd99 Mon Sep 17 00:00:00 2001 From: Cale Carter Date: Tue, 13 Jul 2021 13:40:05 -0700 Subject: [PATCH 1/8] Initial commit of previous api-version --- .../2021-06-01/dataPolicyManifests.json | 311 +++++++ .../createOrUpdatePolicyDefinition.json | 90 ++ ...rUpdatePolicyDefinitionAdvancedParams.json | 117 +++ ...datePolicyDefinitionAtManagementGroup.json | 90 ++ .../createOrUpdatePolicySetDefinition.json | 153 ++++ ...ePolicySetDefinitionAtManagementGroup.json | 126 +++ ...OrUpdatePolicySetDefinitionWithGroups.json | 180 ++++ ...DefinitionWithGroupsAtManagementGroup.json | 180 ++++ .../examples/createPolicyAssignment.json | 64 ++ .../examples/createPolicyAssignmentById.json | 53 ++ ...PolicyAssignmentNonComplianceMessages.json | 59 ++ .../createPolicyAssignmentWithIdentity.json | 65 ++ ...reatePolicyAssignmentWithIdentityById.json | 63 ++ ...atePolicyAssignmentWithoutEnforcement.json | 55 ++ .../examples/deletePolicyAssignment.json | 38 + .../examples/deletePolicyAssignmentById.json | 36 + .../examples/deletePolicyDefinition.json | 15 + ...letePolicyDefinitionAtManagementGroup.json | 15 + .../examples/deletePolicySetDefinition.json | 15 + ...ePolicySetDefinitionAtManagementGroup.json | 15 + .../getBuiltInPolicySetDefinition.json | 67 ++ .../examples/getBuiltinPolicyDefinition.json | 52 ++ .../examples/getDataPolicyManifest.json | 69 ++ .../examples/getPolicyAssignment.json | 36 + .../examples/getPolicyAssignmentById.json | 34 + .../getPolicyAssignmentWithIdentity.json | 42 + .../getPolicyAssignmentWithIdentityById.json | 40 + .../examples/getPolicyDefinition.json | 53 ++ .../getPolicyDefinitionAtManagementGroup.json | 53 ++ .../examples/getPolicySetDefinition.json | 68 ++ ...tPolicySetDefinitionAtManagementGroup.json | 50 ++ .../listBuiltInPolicyDefinitions.json | 130 +++ .../listBuiltInPolicySetDefinitions.json | 70 ++ .../examples/listDataPolicyManifests.json | 112 +++ ...istDataPolicyManifestsNamespaceFilter.json | 73 ++ .../examples/listPolicyAssignments.json | 54 ++ ...stPolicyAssignmentsForManagementGroup.json | 54 ++ .../listPolicyAssignmentsForResource.json | 58 ++ ...listPolicyAssignmentsForResourceGroup.json | 55 ++ .../examples/listPolicyDefinitions.json | 128 +++ ...istPolicyDefinitionsByManagementGroup.json | 96 ++ .../examples/listPolicySetDefinitions.json | 109 +++ ...PolicySetDefinitionsByManagementGroup.json | 109 +++ .../stable/2021-06-01/policyAssignments.json | 823 ++++++++++++++++++ .../stable/2021-06-01/policyDefinitions.json | 697 +++++++++++++++ .../2021-06-01/policySetDefinitions.json | 710 +++++++++++++++ 46 files changed, 5582 insertions(+) create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinition.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinition.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignment.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentById.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentNonComplianceMessages.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentity.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentityById.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithoutEnforcement.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignment.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignmentById.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinition.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinitionAtManagementGroup.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinition.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinitionAtManagementGroup.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltInPolicySetDefinition.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltinPolicyDefinition.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getDataPolicyManifest.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignment.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentById.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentity.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentityById.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinition.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinitionAtManagementGroup.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinition.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinitionAtManagementGroup.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicyDefinitions.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicySetDefinitions.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifests.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifestsNamespaceFilter.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignments.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForManagementGroup.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResource.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResourceGroup.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitions.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitionsByManagementGroup.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitions.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitionsByManagementGroup.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json new file mode 100644 index 000000000000..2e6c787d2834 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json @@ -0,0 +1,311 @@ +{ + "swagger": "2.0", + "info": { + "title": "PolicyClient", + "version": "2020-09-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": { + "/providers/Microsoft.Authorization/dataPolicyManifests/{policyMode}": { + "get": { + "tags": [ + "DataPolicyManifests" + ], + "operationId": "DataPolicyManifests_GetByPolicyMode", + "summary": "Retrieves a data policy manifest.", + "description": "This operation retrieves the data policy manifest with the given policy mode.", + "x-ms-examples": { + "Retrieve a data policy manifest by policy mode": { + "$ref": "./examples/getDataPolicyManifest.json" + } + }, + "parameters": [ + { + "name": "policyMode", + "in": "path", + "required": true, + "type": "string", + "description": "The policy mode of the data policy manifest to get." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns information about a data policy manifest.", + "schema": { + "$ref": "#/definitions/DataPolicyManifest" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/providers/Microsoft.Authorization/dataPolicyManifests": { + "get": { + "tags": [ + "DataPolicyManifests" + ], + "operationId": "DataPolicyManifests_List", + "summary": "Retrieves data policy manifests", + "description": "This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only includes all data policy manifests that have a namespace matching the provided value.", + "x-ms-examples": { + "List data policy manifests": { + "$ref": "./examples/listDataPolicyManifests.json" + }, + "List data policy manifests with namespace filter": { + "$ref": "./examples/listDataPolicyManifestsNamespaceFilter.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/DataPolicyManifestsFilterParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns an array of data policy manifests.", + "schema": { + "$ref": "#/definitions/DataPolicyManifestListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "CloudError": { + "x-ms-external": true, + "properties": { + "error": { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse" + } + }, + "description": "An error response from a policy operation." + }, + "DataManifestCustomResourceFunctionDefinition": { + "properties": { + "name": { + "type": "string", + "description": "The function name as it will appear in the policy rule. eg - 'vault'." + }, + "fullyQualifiedResourceType": { + "type": "string", + "description": "The fully qualified control plane resource type that this function represents. eg - 'Microsoft.KeyVault/vaults'." + }, + "defaultProperties": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The top-level properties that can be selected on the function's output. eg - [ \"name\", \"location\" ] if vault().name and vault().location are supported" + }, + "allowCustomProperties": { + "type": "boolean", + "description": "A value indicating whether the custom properties within the property bag are allowed. Needs api-version to be specified in the policy rule eg - vault('2019-06-01')." + } + }, + "description": "The custom resource function definition." + }, + "DataManifestResourceFunctionsDefinition": { + "properties": { + "standard": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The standard resource functions (subscription and/or resourceGroup)." + }, + "custom": { + "type": "array", + "items": { + "$ref": "#/definitions/DataManifestCustomResourceFunctionDefinition" + }, + "description": "An array of data manifest custom resource definition." + } + }, + "description": "The resource functions supported by a manifest" + }, + "DataEffect": { + "properties": { + "name": { + "type": "string", + "description": "The data effect name." + }, + "detailsSchema": { + "type": "object", + "description": "The data effect details schema." + } + }, + "description": "The data effect definition." + }, + "ResourceTypeAliases": { + "properties": { + "resourceType": { + "type": "string", + "description": "The resource type name." + }, + "aliases": { + "type": "array", + "items": { + "$ref": "../../../Microsoft.Resources/stable/2020-06-01/resources.json#/definitions/Alias" + }, + "description": "The aliases for property names." + } + }, + "description": "The resource type aliases definition." + }, + "DataPolicyManifestProperties": { + "properties": { + "namespaces": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of namespaces for the data policy manifest." + }, + "policyMode": { + "type": "string", + "description": "The policy mode of the data policy manifest." + }, + "isBuiltInOnly": { + "type": "boolean", + "description": "A value indicating whether policy mode is allowed only in built-in definitions." + }, + "resourceTypeAliases": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceTypeAliases" + }, + "description": "An array of resource type aliases." + }, + "effects": { + "type": "array", + "items": { + "$ref": "#/definitions/DataEffect" + }, + "description": "The effect definition." + }, + "fieldValues": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The non-alias field accessor values that can be used in the policy rule." + }, + "resourceFunctions": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/DataManifestResourceFunctionsDefinition", + "description": "The resource functions definition specified in the data manifest." + } + }, + "description": "The properties of the data policy manifest." + }, + "DataPolicyManifest": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/DataPolicyManifestProperties", + "description": "The data policy manifest properties." + }, + "id": { + "readOnly": true, + "type": "string", + "description": "The ID of the data policy manifest." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the data policy manifest (it's the same as the Policy Mode)." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "The type of the resource (Microsoft.Authorization/dataPolicyManifests)." + } + }, + "description": "The data policy manifest.", + "x-ms-azure-resource": true + }, + "DataPolicyManifestListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/DataPolicyManifest" + }, + "description": "An array of data policy manifests." + }, + "nextLink": { + "type": "string", + "description": "The URL to use for getting the next set of results." + } + }, + "description": "List of data policy manifests." + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "The API version to use for the operation." + }, + "DataPolicyManifestsFilterParameter": { + "name": "$filter", + "in": "query", + "required": false, + "type": "string", + "description": "The filter to apply on the operation. Valid values for $filter are: \"namespace eq '{value}'\". If $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is provided, the returned list only includes all data policy manifests that have a namespace matching the provided value.", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinition.json new file mode 100644 index 000000000000..aa3e55e29488 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinition.json @@ -0,0 +1,90 @@ +{ + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyDefinitionName": "ResourceNaming", + "api-version": "2020-09-01", + "parameters": { + "properties": { + "mode": "All", + "displayName": "Enforce resource naming convention", + "description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'", + "metadata": { + "category": "Naming" + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "displayName": "Prefix", + "description": "Resource name prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "displayName": "Suffix", + "description": "Resource name suffix" + } + } + } + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "ResourceNaming", + "properties": { + "mode": "All", + "displayName": "Naming Convention", + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "metadata": { + "category": "Naming" + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "displayName": "Prefix", + "description": "Resource name prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "displayName": "Suffix", + "description": "Resource name suffix" + } + } + }, + "policyType": "Custom" + } + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json new file mode 100644 index 000000000000..c2fa248db943 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json @@ -0,0 +1,117 @@ +{ + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyDefinitionName": "EventHubDiagnosticLogs", + "api-version": "2020-09-01", + "parameters": { + "properties": { + "mode": "Indexed", + "displayName": "Event Hubs should have diagnostic logging enabled", + "description": "Audit enabling of logs and retain them up to a year. This enables recreation of activity trails for investigation purposes when a security incident occurs or your network is compromised", + "metadata": { + "category": "Event Hub" + }, + "policyRule": { + "if": { + "field": "type", + "equals": "Microsoft.EventHub/namespaces" + }, + "then": { + "effect": "AuditIfNotExists", + "details": { + "type": "Microsoft.Insights/diagnosticSettings", + "existenceCondition": { + "allOf": [ + { + "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled", + "equals": "true" + }, + { + "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days", + "equals": "[parameters('requiredRetentionDays')]" + } + ] + } + } + } + }, + "parameters": { + "requiredRetentionDays": { + "type": "Integer", + "defaultValue": 365, + "allowedValues": [ + 0, + 30, + 90, + 180, + 365 + ], + "metadata": { + "displayName": "Required retention (days)", + "description": "The required diagnostic logs retention in days" + } + } + } + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "ResourceNaming", + "properties": { + "mode": "Indexed", + "displayName": "Event Hubs should have diagnostic logging enabled", + "description": "Audit enabling of logs and retain them up to a year. This enables recreation of activity trails for investigation purposes when a security incident occurs or your network is compromised", + "metadata": { + "category": "Event Hub" + }, + "policyRule": { + "if": { + "field": "type", + "equals": "Microsoft.EventHub/namespaces" + }, + "then": { + "effect": "AuditIfNotExists", + "details": { + "type": "Microsoft.Insights/diagnosticSettings", + "existenceCondition": { + "allOf": [ + { + "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled", + "equals": "true" + }, + { + "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days", + "equals": "[parameters('requiredRetentionDays')]" + } + ] + } + } + } + }, + "parameters": { + "requiredRetentionDays": { + "type": "Integer", + "defaultValue": 365, + "allowedValues": [ + 0, + 30, + 90, + 180, + 365 + ], + "metadata": { + "displayName": "Required retention (days)", + "description": "The required diagnostic logs retention in days" + } + } + } + } + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json new file mode 100644 index 000000000000..058b36dde308 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json @@ -0,0 +1,90 @@ +{ + "parameters": { + "managementGroupId": "MyManagementGroup", + "policyDefinitionName": "ResourceNaming", + "api-version": "2020-09-01", + "parameters": { + "properties": { + "mode": "All", + "displayName": "Enforce resource naming convention", + "description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'", + "metadata": { + "category": "Naming" + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "displayName": "Prefix", + "description": "Resource name prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "displayName": "Suffix", + "description": "Resource name suffix" + } + } + } + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "ResourceNaming", + "properties": { + "mode": "All", + "displayName": "Naming Convention", + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "metadata": { + "category": "Naming" + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "displayName": "Prefix", + "description": "Resource name prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "displayName": "Suffix", + "description": "Resource name suffix" + } + } + }, + "policyType": "Custom" + } + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinition.json new file mode 100644 index 000000000000..f58ada40720e --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinition.json @@ -0,0 +1,153 @@ +{ + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policySetDefinitionName": "CostManagement", + "api-version": "2020-09-01", + "parameters": { + "properties": { + "displayName": "Cost Management", + "description": "Policies to enforce low cost storage SKUs", + "metadata": { + "category": "Cost Management" + }, + "parameters": { + "namePrefix": { + "type": "String", + "defaultValue": "myPrefix", + "metadata": { + "displayName": "Prefix to enforce on resource names" + } + } + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + } + }, + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming", + "parameters": { + "prefix": { + "value": "[parameters('namePrefix')]" + }, + "suffix": { + "value": "-LC" + } + } + } + ] + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/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" + }, + "parameters": { + "namePrefix": { + "type": "String", + "defaultValue": "myPrefix", + "metadata": { + "displayName": "Prefix to enforce on resource names" + } + } + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + } + }, + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming", + "parameters": { + "prefix": { + "value": "[parameters('namePrefix')]" + }, + "suffix": { + "value": "-LC" + } + } + } + ] + } + } + }, + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/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" + }, + "parameters": { + "namePrefix": { + "type": "String", + "defaultValue": "myPrefix", + "metadata": { + "displayName": "Prefix to enforce on resource names" + } + } + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + } + }, + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming", + "parameters": { + "prefix": { + "value": "[parameters('namePrefix')]" + }, + "suffix": { + "value": "-LC" + } + } + } + ] + } + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json new file mode 100644 index 000000000000..8eea7c0fe7a5 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json @@ -0,0 +1,126 @@ +{ + "parameters": { + "managementGroupId": "MyManagementGroup", + "policySetDefinitionName": "CostManagement", + "api-version": "2020-09-01", + "parameters": { + "properties": { + "displayName": "Cost Management", + "description": "Policies to enforce low cost storage SKUs", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/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" + } + } + } + ] + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "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" + }, + "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" + } + } + } + ] + } + } + }, + "200": { + "headers": {}, + "body": { + "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" + }, + "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" + } + } + } + ] + } + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json new file mode 100644 index 000000000000..eaef603244e7 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json @@ -0,0 +1,180 @@ +{ + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policySetDefinitionName": "CostManagement", + "api-version": "2020-09-01", + "parameters": { + "properties": { + "displayName": "Cost Management", + "description": "Policies to enforce low cost storage SKUs", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "displayName": "Cost Management Policies", + "description": "Policies designed to control spend within a subscription." + }, + { + "name": "Organizational", + "displayName": "Organizational Policies", + "description": "Policies that help enforce resource organization standards within a subscription." + } + ], + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + } + }, + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + } + } + ] + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/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" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "displayName": "Cost Management Policies", + "description": "Policies designed to control spend within a subscription." + }, + { + "name": "Organizational", + "displayName": "Organizational Policies", + "description": "Policies that help enforce resource organization standards within a subscription." + } + ], + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + } + }, + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + } + } + ] + } + } + }, + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/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" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "displayName": "Cost Management Policies", + "description": "Policies designed to control spend within a subscription." + }, + { + "name": "Organizational", + "displayName": "Organizational Policies", + "description": "Policies that help enforce resource organization standards within a subscription." + } + ], + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + } + }, + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + } + } + ] + } + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json new file mode 100644 index 000000000000..1e89a5d474f7 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json @@ -0,0 +1,180 @@ +{ + "parameters": { + "managementGroupId": "MyManagementGroup", + "policySetDefinitionName": "CostManagement", + "api-version": "2020-09-01", + "parameters": { + "properties": { + "displayName": "Cost Management", + "description": "Policies to enforce low cost storage SKUs", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "displayName": "Cost Management Policies", + "description": "Policies designed to control spend within a subscription." + }, + { + "name": "Organizational", + "displayName": "Organizational Policies", + "description": "Policies that help enforce resource organization standards within a subscription." + } + ], + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + } + }, + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + } + } + ] + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "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" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "displayName": "Cost Management Policies", + "description": "Policies designed to control spend within a subscription." + }, + { + "name": "Organizational", + "displayName": "Organizational Policies", + "description": "Policies that help enforce resource organization standards within a subscription." + } + ], + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + } + }, + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + } + } + ] + } + } + }, + "200": { + "headers": {}, + "body": { + "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" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "displayName": "Cost Management Policies", + "description": "Policies designed to control spend within a subscription." + }, + { + "name": "Organizational", + "displayName": "Organizational Policies", + "description": "Policies that help enforce resource organization standards within a subscription." + } + ], + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + } + }, + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + } + } + ] + } + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignment.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignment.json new file mode 100644 index 000000000000..f13d4a79fc5e --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignment.json @@ -0,0 +1,64 @@ +{ + "parameters": { + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyAssignmentName": "EnforceNaming", + "api-version": "2020-09-01", + "parameters": { + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "nonComplianceMessages": [ + { + "message": "Resource names must start with 'DeptA' and end with '-LC'." + } + ] + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "enforcementMode": "Default", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "nonComplianceMessages": [ + { + "message": "Resource names must start with 'DeptA' and end with '-LC'." + } + ] + }, + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "name": "EnforceNaming" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentById.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentById.json new file mode 100644 index 000000000000..90da2df54878 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentById.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "policyAssignmentId": "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", + "api-version": "2020-09-01", + "parameters": { + "properties": { + "displayName": "Enforce storage account SKU", + "description": "Allow only storage accounts of SKU Standard_GRS or Standard_LRS to be created", + "metadata": { + "assignedBy": "Cheapskate Boss" + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "enforcementMode": "Default" + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce storage account SKU", + "description": "Allow only storage accounts of SKU Standard_GRS or Standard_LRS to be created", + "metadata": { + "assignedBy": "Cheapskate Boss" + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "notScopes": [], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "enforcementMode": "Default" + }, + "id": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", + "type": "Microsoft.Authorization/policyAssignments", + "name": "LowCostStorage" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentNonComplianceMessages.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentNonComplianceMessages.json new file mode 100644 index 000000000000..3ae122db57e8 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentNonComplianceMessages.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyAssignmentName": "securityInitAssignment", + "api-version": "2020-09-01", + "parameters": { + "properties": { + "displayName": "Enforce security policies", + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/securityInitiative", + "nonComplianceMessages": [ + { + "message": "Resources must comply with all internal security policies. See for more info." + }, + { + "message": "Resource names must start with 'DeptA' and end with '-LC'.", + "policyDefinitionReferenceId": "10420126870854049575" + }, + { + "message": "Storage accounts must have firewall rules configured.", + "policyDefinitionReferenceId": "8572513655450389710" + } + ] + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce security policies", + "metadata": { + "assignedBy": "User 1" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/securityInitiative", + "notScopes": [], + "enforcementMode": "Default", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "nonComplianceMessages": [ + { + "message": "Resources must comply with all internal security policies. See for more info." + }, + { + "message": "Resource names must start with 'DeptA' and end with '-LC'.", + "policyDefinitionReferenceId": "10420126870854049575" + }, + { + "message": "Storage accounts must have firewall rules configured.", + "policyDefinitionReferenceId": "8572513655450389710" + } + ] + }, + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/securityInitAssignment", + "type": "Microsoft.Authorization/policyAssignments", + "name": "securityInitAssignment" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentity.json new file mode 100644 index 000000000000..a275b445dcdb --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentity.json @@ -0,0 +1,65 @@ +{ + "parameters": { + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyAssignmentName": "EnforceNaming", + "api-version": "2020-09-01", + "parameters": { + "location": "eastus", + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Foo Bar" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "enforcementMode": "Default" + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "enforcementMode": "Default", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "eastus", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "name": "EnforceNaming" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentityById.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentityById.json new file mode 100644 index 000000000000..f406821541a3 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentityById.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "policyAssignmentId": "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", + "api-version": "2020-09-01", + "parameters": { + "identity": { + "type": "SystemAssigned" + }, + "location": "eastus", + "properties": { + "displayName": "Enforce storage account SKU", + "description": "Allow only storage accounts of SKU Standard_GRS or Standard_LRS to be created", + "metadata": { + "assignedBy": "Cheapskate Boss" + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "enforcementMode": "Default" + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce storage account SKU", + "description": "Allow only storage accounts of SKU Standard_GRS or Standard_LRS to be created", + "metadata": { + "assignedBy": "Cheapskate Boss" + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "notScopes": [], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "enforcementMode": "Default" + }, + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "eastus", + "id": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", + "type": "Microsoft.Authorization/policyAssignments", + "name": "LowCostStorage" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithoutEnforcement.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithoutEnforcement.json new file mode 100644 index 000000000000..793c092aee93 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithoutEnforcement.json @@ -0,0 +1,55 @@ +{ + "parameters": { + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyAssignmentName": "EnforceNaming", + "api-version": "2020-09-01", + "parameters": { + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "enforcementMode": "DoNotEnforce" + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "enforcementMode": "DoNotEnforce", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "name": "EnforceNaming" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignment.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignment.json new file mode 100644 index 000000000000..544cb5ac97fa --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignment.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyAssignmentName": "EnforceNaming", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "name": "EnforceNaming" + } + }, + "204": { + "headers": {} + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignmentById.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignmentById.json new file mode 100644 index 000000000000..e1921db5f45b --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignmentById.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "policyAssignmentId": "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce storage account SKU", + "description": "Allow only storage accounts of SKU Standard_GRS or Standard_LRS to be created", + "metadata": { + "assignedBy": "Cheapskate Boss" + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "notScopes": [], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + } + }, + "id": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", + "type": "Microsoft.Authorization/policyAssignments", + "name": "LowCostStorage" + } + }, + "204": { + "headers": {} + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinition.json new file mode 100644 index 000000000000..b410e9ca857a --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinition.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyDefinitionName": "ResourceNaming", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {} + }, + "204": { + "headers": {} + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinitionAtManagementGroup.json new file mode 100644 index 000000000000..5604e2df3490 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinitionAtManagementGroup.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "managementGroupId": "MyManagementGroup", + "policyDefinitionName": "ResourceNaming", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {} + }, + "204": { + "headers": {} + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinition.json new file mode 100644 index 000000000000..e8a7c67030c1 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinition.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policySetDefinitionName": "CostManagement", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {} + }, + "204": { + "headers": {} + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinitionAtManagementGroup.json new file mode 100644 index 000000000000..19c7f6532144 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinitionAtManagementGroup.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "managementGroupId": "MyManagementGroup", + "policySetDefinitionName": "CostManagement", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {} + }, + "204": { + "headers": {} + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltInPolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltInPolicySetDefinition.json new file mode 100644 index 000000000000..0679500dba8a --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltInPolicySetDefinition.json @@ -0,0 +1,67 @@ +{ + "parameters": { + "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", + "policyType": "BuiltIn", + "description": "Monitor all the available security recommendations in Azure Security Center. This is the default policy for Azure Security Center.", + "metadata": { + "category": "Security Center" + }, + "parameters": {}, + "policyDefinitions": [ + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", + "policyDefinitionReferenceId": "RefId1" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", + "policyDefinitionReferenceId": "RefId2" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", + "policyDefinitionReferenceId": "RefId3" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "policyDefinitionReferenceId": "RefId4" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", + "policyDefinitionReferenceId": "RefId5" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", + "policyDefinitionReferenceId": "RefId6" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionReferenceId": "RefId7" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", + "policyDefinitionReferenceId": "RefId8" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", + "policyDefinitionReferenceId": "RefId9" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", + "policyDefinitionReferenceId": "RefId10" + } + ] + }, + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "type": "Microsoft.Authorization/policySetDefinitions", + "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltinPolicyDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltinPolicyDefinition.json new file mode 100644 index 000000000000..06ab3d9c41bf --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltinPolicyDefinition.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyDefinitionName": "7433c107-6db4-4ad1-b57a-a76dce0154a1", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "mode": "All", + "displayName": "Allowed storage account SKUs", + "policyType": "BuiltIn", + "description": "This policy enables you to specify a set of storage account SKUs that your organization can deploy.", + "parameters": { + "listOfAllowedSKUs": { + "type": "Array", + "metadata": { + "description": "The list of SKUs that can be specified for storage accounts.", + "displayName": "Allowed SKUs", + "strongType": "StorageSKUs" + } + } + }, + "policyRule": { + "if": { + "allOf": [ + { + "field": "type", + "equals": "Microsoft.Storage/storageAccounts" + }, + { + "not": { + "field": "Microsoft.Storage/storageAccounts/sku.name", + "in": "[parameters('listOfAllowedSKUs')]" + } + } + ] + }, + "then": { + "effect": "Deny" + } + } + }, + "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getDataPolicyManifest.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getDataPolicyManifest.json new file mode 100644 index 000000000000..a11055df4c03 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getDataPolicyManifest.json @@ -0,0 +1,69 @@ +{ + "parameters": { + "api-version": "2020-09-01", + "policyMode": "Microsoft.KeyVault.Data" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/providers/Microsoft.Authorization/dataPolicyManifests/Microsoft.KeyVault.Data", + "type": "Microsoft.Authorization/dataPolicyManifests", + "name": "Microsoft.KeyVault.Data", + "properties": { + "namespaces": [ + "Microsoft.KeyVault" + ], + "policyMode": "Microsoft.KeyVault.Data", + "isBuiltInOnly": true, + "resourceTypeAliases": [ + { + "resourceType": "vaults/certificates", + "aliases": [ + { + "name": "Microsoft.KeyVault.Data/vaults/certificates/keyProperties.keyType", + "paths": [ + { + "path": "keyProperties.keyType", + "apiVersions": [ + "2019-01-01" + ] + } + ] + } + ] + } + ], + "effects": [ + { + "name": "Audit" + }, + { + "name": "Deny" + } + ], + "fieldValues": [ + "type" + ], + "resourceFunctions": { + "standard": [ + "subscription", + "resourceGroup" + ], + "custom": [ + { + "name": "vault", + "fullyQualifiedResourceType": "Microsoft.KeyVault/vaults", + "defaultProperties": [ + "location", + "tags" + ], + "allowCustomProperties": false + } + ] + } + } + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignment.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignment.json new file mode 100644 index 000000000000..0c72cd86a9aa --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignment.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyAssignmentName": "EnforceNaming", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "enforcementMode": "Default", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "name": "EnforceNaming" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentById.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentById.json new file mode 100644 index 000000000000..d47e8f05f819 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentById.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "policyAssignmentId": "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce storage account SKU", + "description": "Allow only storage accounts of SKU Standard_GRS or Standard_LRS to be created", + "metadata": { + "assignedBy": "Cheapskate Boss" + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "notScopes": [], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "enforcementMode": "Default" + }, + "id": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", + "type": "Microsoft.Authorization/policyAssignments", + "name": "LowCostStorage" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentity.json new file mode 100644 index 000000000000..0d4a478abd53 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentity.json @@ -0,0 +1,42 @@ +{ + "parameters": { + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyAssignmentName": "EnforceNaming", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "enforcementMode": "Default", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "westus", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "name": "EnforceNaming" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentityById.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentityById.json new file mode 100644 index 000000000000..c7223fa1a752 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentityById.json @@ -0,0 +1,40 @@ +{ + "parameters": { + "policyAssignmentId": "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce storage account SKU", + "description": "Allow only storage accounts of SKU Standard_GRS or Standard_LRS to be created", + "metadata": { + "assignedBy": "Cheapskate Boss" + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "notScopes": [], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "enforcementMode": "Default" + }, + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "westus", + "id": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", + "type": "Microsoft.Authorization/policyAssignments", + "name": "LowCostStorage" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinition.json new file mode 100644 index 000000000000..8046637f1c3e --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinition.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyDefinitionName": "ResourceNaming", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "mode": "All", + "displayName": "Naming Convention", + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "metadata": { + "category": "Naming" + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "displayName": "Prefix", + "description": "Resource name prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "displayName": "Suffix", + "description": "Resource name suffix" + } + } + }, + "policyType": "Custom" + }, + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "ResourceNaming" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinitionAtManagementGroup.json new file mode 100644 index 000000000000..0b3579c2e860 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinitionAtManagementGroup.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "managementGroupId": "MyManagementGroup", + "policyDefinitionName": "ResourceNaming", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "ResourceNaming", + "properties": { + "mode": "All", + "displayName": "Naming Convention", + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "metadata": { + "category": "Naming" + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "displayName": "Prefix", + "description": "Resource name prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "displayName": "Suffix", + "description": "Resource name suffix" + } + } + }, + "policyType": "Custom" + } + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinition.json new file mode 100644 index 000000000000..56ee429d5786 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinition.json @@ -0,0 +1,68 @@ +{ + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policySetDefinitionName": "CostManagement", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/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" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "displayName": "Cost Management Policies", + "description": "Policies designed to control spend within a subscription." + }, + { + "name": "Organizational", + "displayName": "Organizational Policies", + "description": "Policies that help enforce resource organization standards within a subscription." + } + ], + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + } + }, + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + } + } + ] + } + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinitionAtManagementGroup.json new file mode 100644 index 000000000000..3e5d5a5a5e45 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinitionAtManagementGroup.json @@ -0,0 +1,50 @@ +{ + "parameters": { + "managementGroupId": "MyManagementGroup", + "policySetDefinitionName": "CostManagement", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "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" + }, + "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" + } + } + } + ] + } + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicyDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicyDefinitions.json new file mode 100644 index 000000000000..9c1cbe6f3706 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicyDefinitions.json @@ -0,0 +1,130 @@ +{ + "parameters": { + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "properties": { + "mode": "All", + "displayName": "Audit SQL DB Level Audit Setting", + "policyType": "BuiltIn", + "description": "Audit DB level audit setting for SQL databases", + "parameters": { + "setting": { + "type": "String", + "metadata": { + "displayName": "Audit Setting" + }, + "allowedValues": [ + "enabled", + "disabled" + ] + } + }, + "policyRule": { + "if": { + "field": "type", + "equals": "Microsoft.Sql/servers/databases" + }, + "then": { + "effect": "AuditIfNotExists", + "details": { + "type": "Microsoft.Sql/servers/databases/auditingSettings", + "name": "default", + "existenceCondition": { + "allOf": [ + { + "field": "Microsoft.Sql/auditingSettings.state", + "equals": "[parameters('setting')]" + } + ] + } + } + } + } + }, + "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "06a78e20-9358-41c9-923c-fb736d382a12" + }, + { + "properties": { + "mode": "All", + "displayName": "Allowed storage account SKUs", + "policyType": "Static", + "description": "This policy enables you to specify a set of storage account SKUs that your organization can deploy.", + "parameters": { + "listOfAllowedSKUs": { + "type": "Array", + "metadata": { + "description": "The list of SKUs that can be specified for storage accounts.", + "displayName": "Allowed SKUs", + "strongType": "StorageSKUs" + } + } + }, + "policyRule": { + "if": { + "allOf": [ + { + "field": "type", + "equals": "Microsoft.Storage/storageAccounts" + }, + { + "not": { + "field": "Microsoft.Storage/storageAccounts/sku.name", + "in": "[parameters('listOfAllowedSKUs')]" + } + } + ] + }, + "then": { + "effect": "Deny" + } + } + }, + "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1" + }, + { + "properties": { + "mode": "Microsoft.KeyVault.Data", + "displayName": "Audit KeyVault certificates that expire within specified number of days", + "policyType": "BuiltIn", + "description": "Audit certificates that are stored in Azure Key Vault, that expire within 'X' number of days.", + "metadata": { + "category": "KeyVault DataPlane" + }, + "parameters": { + "daysToExpire": { + "type": "Integer", + "metadata": { + "displayName": "Days to expire", + "description": "The number of days for a certificate to expire." + } + } + }, + "policyRule": { + "if": { + "field": "Microsoft.KeyVault.Data/vaults/certificates/attributes/expiresOn", + "lessOrEquals": "[addDays(utcNow(), parameters('daysToExpire'))]" + }, + "then": { + "effect": "audit" + } + } + }, + "id": "/providers/Microsoft.Authorization/policyDefinitions/abeed54a-73c5-441d-8a8c-6b5e7a0c299e", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "abeed54a-73c5-441d-8a8c-6b5e7a0c299e" + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicySetDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicySetDefinitions.json new file mode 100644 index 000000000000..77aab4627e3d --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicySetDefinitions.json @@ -0,0 +1,70 @@ +{ + "parameters": { + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "properties": { + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", + "policyType": "BuiltIn", + "description": "Monitor all the available security recommendations in Azure Security Center. This is the default policy for Azure Security Center.", + "metadata": { + "category": "Security Center" + }, + "parameters": {}, + "policyDefinitions": [ + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", + "policyDefinitionReferenceId": "RefId1" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", + "policyDefinitionReferenceId": "RefId2" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", + "policyDefinitionReferenceId": "RefId3" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "policyDefinitionReferenceId": "RefId4" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", + "policyDefinitionReferenceId": "RefId5" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", + "policyDefinitionReferenceId": "RefId6" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionReferenceId": "RefId7" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", + "policyDefinitionReferenceId": "RefId8" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", + "policyDefinitionReferenceId": "RefId9" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", + "policyDefinitionReferenceId": "RefId10" + } + ] + }, + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "type": "Microsoft.Authorization/policySetDefinitions", + "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8" + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifests.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifests.json new file mode 100644 index 000000000000..d73b38f1c3f7 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifests.json @@ -0,0 +1,112 @@ +{ + "parameters": { + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/providers/Microsoft.Authorization/dataPolicyManifests/Microsoft.KeyVault.Data", + "type": "Microsoft.Authorization/dataPolicyManifests", + "name": "Microsoft.KeyVault.Data", + "properties": { + "namespaces": [ + "Microsoft.KeyVault" + ], + "policyMode": "Microsoft.KeyVault.Data", + "isBuiltInOnly": true, + "resourceTypeAliases": [ + { + "resourceType": "vaults/certificates", + "aliases": [ + { + "name": "Microsoft.KeyVault.Data/vaults/certificates/keyProperties.keyType", + "paths": [ + { + "path": "keyProperties.keyType", + "apiVersions": [ + "2019-01-01" + ] + } + ] + } + ] + } + ], + "effects": [ + { + "name": "audit" + }, + { + "name": "deny" + } + ], + "fieldValues": [ + "type" + ], + "resourceFunctions": { + "standard": [ + "subscription", + "resourceGroup" + ], + "custom": [ + { + "name": "vault", + "fullyQualifiedResourceType": "Microsoft.KeyVault/vaults", + "defaultProperties": [ + "location", + "tags" + ], + "allowCustomProperties": false + } + ] + } + } + }, + { + "id": "/providers/Microsoft.Authorization/dataPolicyManifests/Microsoft.Kubernetes.Data", + "type": "Microsoft.Authorization/dataPolicyManifests", + "name": "Microsoft.Kubernetes.Data", + "properties": { + "namespaces": [ + "Microsoft.Kubernetes", + "Microsoft.ContainerService" + ], + "policyMode": "Microsoft.Kubernetes.Data", + "isBuiltInOnly": false, + "effects": [ + { + "name": "audit", + "detailsSchema": { + "type": "object", + "properties": { + "constraintTemplate": { + "type": "string", + "pattern": "^(?i)(https:\\/\\/raw\\.githubusercontent\\.com\\/){1}(.+)(\\.){1}(yaml|yml){1}$" + }, + "constraint": { + "type": "string", + "pattern": "^(?i)(https:\\/\\/raw\\.githubusercontent\\.com\\/){1}(.+)(\\.){1}(yaml|yml){1}$" + }, + "values": { + "type": "object", + "maxProperties": 10, + "additionalProperties": {} + } + }, + "required": [ + "constraintTemplate" + ], + "additionalProperties": false + } + } + ] + } + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifestsNamespaceFilter.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifestsNamespaceFilter.json new file mode 100644 index 000000000000..8cd8e706f4a1 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifestsNamespaceFilter.json @@ -0,0 +1,73 @@ +{ + "parameters": { + "api-version": "2020-09-01", + "$filter": "namespace eq 'Microsoft.KeyVault'" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/providers/Microsoft.Authorization/dataPolicyManifests/Microsoft.KeyVault.Data", + "type": "Microsoft.Authorization/dataPolicyManifests", + "name": "Microsoft.KeyVault.Data", + "properties": { + "namespaces": [ + "Microsoft.KeyVault" + ], + "policyMode": "Microsoft.KeyVault.Data", + "isBuiltInOnly": true, + "resourceTypeAliases": [ + { + "resourceType": "vaults/certificates", + "aliases": [ + { + "name": "Microsoft.KeyVault.Data/vaults/certificates/keyProperties.keyType", + "paths": [ + { + "path": "keyProperties.keyType", + "apiVersions": [ + "2019-01-01" + ] + } + ] + } + ] + } + ], + "effects": [ + { + "name": "audit" + }, + { + "name": "deny" + } + ], + "fieldValues": [ + "type" + ], + "resourceFunctions": { + "standard": [ + "subscription", + "resourceGroup" + ], + "custom": [ + { + "name": "vault", + "fullyQualifiedResourceType": "Microsoft.KeyVault/vaults", + "defaultProperties": [ + "location", + "tags" + ], + "allowCustomProperties": false + } + ] + } + } + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignments.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignments.json new file mode 100644 index 000000000000..14fd8f089a64 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignments.json @@ -0,0 +1,54 @@ +{ + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2020-09-01", + "$filter": "atScope()" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "name": "CostManagement", + "location": "eastus", + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "properties": { + "displayName": "Storage Cost Management", + "description": "Minimize the risk of accidental cost overruns", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/storageSkus", + "parameters": { + "allowedSkus": { + "value": "Standard_A1" + } + }, + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "notScopes": [] + } + }, + { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/TagEnforcement", + "type": "Microsoft.Authorization/policyAssignments", + "name": "TagEnforcement", + "properties": { + "displayName": "Enforces a tag key and value", + "description": "Ensure a given tag key and value are present on all resources", + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/TagKeyValue", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "notScopes": [] + } + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForManagementGroup.json new file mode 100644 index 000000000000..13e53bb0a720 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForManagementGroup.json @@ -0,0 +1,54 @@ +{ + "parameters": { + "managementGroupId": "TestManagementGroup", + "api-version": "2020-09-01", + "$filter": "atScope()" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/providers/Microsoft.Management/managementGroups/TestManagementGroup/providers/Microsoft.Authorization/policyAssignments/TestCostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "name": "TestCostManagement", + "location": "eastus", + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "properties": { + "displayName": "Storage Cost Management", + "description": "Minimize the risk of accidental cost overruns", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/TestManagementGroup/providers/Microsoft.Authorization/policyDefinitions/storageSkus", + "parameters": { + "allowedSkus": { + "value": "Standard_A1" + } + }, + "scope": "/providers/Microsoft.Management/managementGroups/TestManagementGroup", + "notScopes": [] + } + }, + { + "id": "/providers/Microsoft.Management/managementGroups/TestManagementGroup/providers/Microsoft.Authorization/policyAssignments/TestTagEnforcement", + "type": "Microsoft.Authorization/policyAssignments", + "name": "TestTagEnforcement", + "properties": { + "displayName": "Enforces a tag key and value", + "description": "Ensure a given tag key and value are present on all resources", + "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/TestManagementGroup/providers/Microsoft.Authorization/policyDefinitions/TagKeyValue", + "scope": "/providers/Microsoft.Management/managementGroups/TestManagementGroup", + "notScopes": [] + } + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResource.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResource.json new file mode 100644 index 000000000000..270985a50ef1 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResource.json @@ -0,0 +1,58 @@ +{ + "parameters": { + "resourceGroupName": "TestResourceGroup", + "resourceProviderNamespace": "Microsoft.Compute", + "parentResourcePath": "virtualMachines/MyTestVm", + "resourceType": "domainNames", + "resourceName": "MyTestComputer.cloudapp.net", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup/providers/Microsoft.Authorization/policyAssignments/TestCostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "name": "TestCostManagement", + "location": "eastus", + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "properties": { + "displayName": "VM Cost Management", + "description": "Minimize the risk of accidental cost overruns", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/vmSkus", + "parameters": { + "allowedSkus": { + "value": "Standard_A1" + } + }, + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup", + "notScopes": [] + } + }, + { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup/providers/Microsoft.Authorization/policyAssignments/TestTagEnforcement", + "type": "Microsoft.Authorization/policyAssignments", + "name": "TestTagEnforcement", + "properties": { + "displayName": "Enforces a tag key and value", + "description": "Ensure a given tag key and value are present on all resources", + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/TagKeyValue", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup", + "notScopes": [] + } + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResourceGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResourceGroup.json new file mode 100644 index 000000000000..2fb1d326f1a2 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResourceGroup.json @@ -0,0 +1,55 @@ +{ + "parameters": { + "resourceGroupName": "TestResourceGroup", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2020-09-01", + "$filter": "atScope()" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup/providers/Microsoft.Authorization/policyAssignments/TestCostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "name": "TestCostManagement", + "location": "eastus", + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "properties": { + "displayName": "Storage Cost Management", + "description": "Minimize the risk of accidental cost overruns", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/storageSkus", + "parameters": { + "allowedSkus": { + "value": "Standard_A1" + } + }, + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup", + "notScopes": [] + } + }, + { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup/providers/Microsoft.Authorization/policyAssignments/TestTagEnforcement", + "type": "Microsoft.Authorization/policyAssignments", + "name": "TestTagEnforcement", + "properties": { + "displayName": "Enforces a tag key and value", + "description": "Ensure a given tag key and value are present on all resources", + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/TagKeyValue", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup", + "notScopes": [] + } + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitions.json new file mode 100644 index 000000000000..60d824bd3152 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitions.json @@ -0,0 +1,128 @@ +{ + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "properties": { + "mode": "All", + "displayName": "Allowed storage account SKUs", + "policyType": "BuiltIn", + "description": "This policy enables you to specify a set of storage account SKUs that your organization can deploy.", + "parameters": { + "listOfAllowedSKUs": { + "type": "Array", + "metadata": { + "description": "The list of SKUs that can be specified for storage accounts.", + "displayName": "Allowed SKUs", + "strongType": "StorageSKUs" + } + } + }, + "policyRule": { + "if": { + "allOf": [ + { + "field": "type", + "equals": "Microsoft.Storage/storageAccounts" + }, + { + "not": { + "field": "Microsoft.Storage/storageAccounts/sku.name", + "in": "[parameters('listOfAllowedSKUs')]" + } + } + ] + }, + "then": { + "effect": "Deny" + } + } + }, + "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1" + }, + { + "properties": { + "mode": "All", + "displayName": "Naming Convention", + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "metadata": { + "category": "Naming" + }, + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "displayName": "Prefix", + "description": "Resource name prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "displayName": "Suffix", + "description": "Resource name suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom" + }, + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "ResourceNaming" + }, + { + "properties": { + "mode": "Microsoft.KeyVault.Data", + "displayName": "Audit KeyVault certificates that expire within specified number of days", + "description": "Audit certificates that are stored in Azure Key Vault, that expire within 'X' number of days.", + "metadata": { + "category": "KeyVault DataPlane" + }, + "parameters": { + "daysToExpire": { + "type": "Integer", + "metadata": { + "displayName": "Days to expire", + "description": "The number of days for a certificate to expire." + } + } + }, + "policyRule": { + "if": { + "field": "Microsoft.KeyVault.Data/vaults/certificates/attributes/expiresOn", + "lessOrEquals": "[addDays(utcNow(), parameters('daysToExpire'))]" + }, + "then": { + "effect": "audit" + } + }, + "policyType": "Custom" + }, + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/AuditSoonToExpireCerts", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "AuditSoonToExpireCerts" + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitionsByManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitionsByManagementGroup.json new file mode 100644 index 000000000000..507c6a224117 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitionsByManagementGroup.json @@ -0,0 +1,96 @@ +{ + "parameters": { + "managementGroupId": "MyManagementGroup", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "properties": { + "mode": "All", + "displayName": "Allowed storage account SKUs", + "policyType": "BuiltIn", + "description": "This policy enables you to specify a set of storage account SKUs that your organization can deploy.", + "parameters": { + "listOfAllowedSKUs": { + "type": "Array", + "metadata": { + "description": "The list of SKUs that can be specified for storage accounts.", + "displayName": "Allowed SKUs", + "strongType": "StorageSKUs" + } + } + }, + "policyRule": { + "if": { + "allOf": [ + { + "field": "type", + "equals": "Microsoft.Storage/storageAccounts" + }, + { + "not": { + "field": "Microsoft.Storage/storageAccounts/sku.name", + "in": "[parameters('listOfAllowedSKUs')]" + } + } + ] + }, + "then": { + "effect": "Deny" + } + } + }, + "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1" + }, + { + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "name": "ResourceNaming", + "properties": { + "mode": "All", + "displayName": "Naming Convention", + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "metadata": { + "category": "Naming" + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "displayName": "Prefix", + "description": "Resource name prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "displayName": "Suffix", + "description": "Resource name suffix" + } + } + }, + "policyType": "Custom" + } + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitions.json new file mode 100644 index 000000000000..46647dfbbad5 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitions.json @@ -0,0 +1,109 @@ +{ + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "properties": { + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", + "policyType": "BuiltIn", + "description": "Monitor all the available security recommendations in Azure Security Center. This is the default policy for Azure Security Center.", + "metadata": { + "category": "Security Center" + }, + "parameters": {}, + "policyDefinitions": [ + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", + "policyDefinitionReferenceId": "RefId1" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", + "policyDefinitionReferenceId": "RefId2" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", + "policyDefinitionReferenceId": "RefId3" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "policyDefinitionReferenceId": "RefId4" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", + "policyDefinitionReferenceId": "RefId5" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", + "policyDefinitionReferenceId": "RefId6" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionReferenceId": "RefId7" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", + "policyDefinitionReferenceId": "RefId8" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", + "policyDefinitionReferenceId": "RefId9" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", + "policyDefinitionReferenceId": "RefId10" + } + ] + }, + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "type": "Microsoft.Authorization/policySetDefinitions", + "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8" + }, + { + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/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" + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + } + }, + { + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + } + } + ] + } + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitionsByManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitionsByManagementGroup.json new file mode 100644 index 000000000000..1fec469d807f --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitionsByManagementGroup.json @@ -0,0 +1,109 @@ +{ + "parameters": { + "managementGroupId": "MyManagementGroup", + "api-version": "2020-09-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "properties": { + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", + "policyType": "BuiltIn", + "description": "Monitor all the available security recommendations in Azure Security Center. This is the default policy for Azure Security Center.", + "metadata": { + "category": "Security Center" + }, + "parameters": {}, + "policyDefinitions": [ + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", + "policyDefinitionReferenceId": "RefId1" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", + "policyDefinitionReferenceId": "RefId2" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", + "policyDefinitionReferenceId": "RefId3" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "policyDefinitionReferenceId": "RefId4" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", + "policyDefinitionReferenceId": "RefId5" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", + "policyDefinitionReferenceId": "RefId6" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionReferenceId": "RefId7" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", + "policyDefinitionReferenceId": "RefId8" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", + "policyDefinitionReferenceId": "RefId9" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", + "policyDefinitionReferenceId": "RefId10" + } + ] + }, + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "type": "Microsoft.Authorization/policySetDefinitions", + "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8" + }, + { + "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" + }, + "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" + } + } + } + ] + } + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json new file mode 100644 index 000000000000..f28ad9d62305 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json @@ -0,0 +1,823 @@ +{ + "swagger": "2.0", + "info": { + "title": "PolicyClient", + "version": "2020-09-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": { + "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}": { + "delete": { + "tags": [ + "PolicyAssignments" + ], + "operationId": "PolicyAssignments_Delete", + "summary": "Deletes a policy assignment.", + "description": "This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy assignment is the part of its ID preceding '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'.", + "x-ms-examples": { + "Delete a policy assignment": { + "$ref": "./examples/deletePolicyAssignment.json" + } + }, + "parameters": [ + { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'", + "x-ms-skip-url-encoding": true + }, + { + "name": "policyAssignmentName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy assignment to delete." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns information about the deleted assignment.", + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "204": { + "description": "No Content - the policy assignment doesn't exist." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "put": { + "tags": [ + "PolicyAssignments" + ], + "operationId": "PolicyAssignments_Create", + "summary": "Creates or updates a policy assignment.", + "description": " This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group.", + "x-ms-examples": { + "Create or update a policy assignment": { + "$ref": "./examples/createPolicyAssignment.json" + }, + "Create or update a policy assignment with multiple non-compliance messages": { + "$ref": "./examples/createPolicyAssignmentNonComplianceMessages.json" + }, + "Create or update a policy assignment with a managed identity": { + "$ref": "./examples/createPolicyAssignmentWithIdentity.json" + }, + "Create or update a policy assignment without enforcing policy effect during resource creation or update.": { + "$ref": "./examples/createPolicyAssignmentWithoutEnforcement.json" + } + }, + "parameters": [ + { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'", + "x-ms-skip-url-encoding": true + }, + { + "name": "policyAssignmentName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy assignment." + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyAssignment" + }, + "description": "Parameters for the policy assignment." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "201": { + "description": "Created - Returns information about the new policy assignment.", + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "get": { + "tags": [ + "PolicyAssignments" + ], + "operationId": "PolicyAssignments_Get", + "summary": "Retrieves a policy assignment.", + "description": "This operation retrieves a single policy assignment, given its name and the scope it was created at.", + "x-ms-examples": { + "Retrieve a policy assignment": { + "$ref": "./examples/getPolicyAssignment.json" + }, + "Retrieve a policy assignment with a managed identity": { + "$ref": "./examples/getPolicyAssignmentWithIdentity.json" + } + }, + "parameters": [ + { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'", + "x-ms-skip-url-encoding": true + }, + { + "name": "policyAssignmentName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy assignment to get." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns information about the policy assignment.", + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments": { + "get": { + "tags": [ + "PolicyAssignments" + ], + "operationId": "PolicyAssignments_ListForResourceGroup", + "summary": "Retrieves all policy assignments that apply to a resource group.", + "description": "This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value} that apply to the resource group.", + "x-ms-examples": { + "List policy assignments that apply to a resource group": { + "$ref": "./examples/listPolicyAssignmentsForResourceGroup.json" + } + }, + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group that contains policy assignments.", + "pattern": "^[-\\w\\._\\(\\)]+$", + "minLength": 1, + "maxLength": 90 + }, + { + "$ref": "#/parameters/PolicyAssignmentsFilterParameter" + }, + { + "$ref": "#/parameters/TopParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns an array of policy assignments.", + "schema": { + "$ref": "#/definitions/PolicyAssignmentListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments": { + "get": { + "tags": [ + "PolicyAssignments" + ], + "operationId": "PolicyAssignments_ListForResource", + "summary": "Retrieves all policy assignments that apply to a resource.", + "description": "This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp').", + "deprecated": false, + "x-ms-examples": { + "List all policy assignments that apply to a resource": { + "$ref": "./examples/listPolicyAssignmentsForResource.json" + } + }, + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group containing the resource.", + "pattern": "^[-\\w\\._\\(\\)]+$", + "minLength": 1, + "maxLength": 90 + }, + { + "name": "resourceProviderNamespace", + "in": "path", + "required": true, + "type": "string", + "description": "The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines)" + }, + { + "name": "parentResourcePath", + "in": "path", + "required": true, + "type": "string", + "description": "The parent resource path. Use empty string if there is none.", + "x-ms-skip-url-encoding": true + }, + { + "name": "resourceType", + "in": "path", + "required": true, + "type": "string", + "description": "The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites).", + "x-ms-skip-url-encoding": true + }, + { + "name": "resourceName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource." + }, + { + "$ref": "#/parameters/PolicyAssignmentsFilterParameter" + }, + { + "$ref": "#/parameters/TopParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns an array of policy assignments.", + "schema": { + "$ref": "#/definitions/PolicyAssignmentListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-odata": "#/definitions/PolicyAssignment" + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments": { + "get": { + "tags": [ + "PolicyAssignments" + ], + "operationId": "PolicyAssignments_ListForManagementGroup", + "summary": "Retrieves all policy assignments that apply to a management group.", + "description": "This operation retrieves the list of all policy assignments applicable to the management group that match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value} that apply to the management group.", + "x-ms-examples": { + "List policy assignments that apply to a management group": { + "$ref": "./examples/listPolicyAssignmentsForManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ManagementGroupIdParameter" + }, + { + "$ref": "#/parameters/PolicyAssignmentsFilterParameter" + }, + { + "$ref": "#/parameters/TopParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns an array of policy assignments.", + "schema": { + "$ref": "#/definitions/PolicyAssignmentListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments": { + "get": { + "tags": [ + "PolicyAssignments" + ], + "operationId": "PolicyAssignments_List", + "summary": "Retrieves all policy assignments that apply to a subscription.", + "description": "This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}.", + "x-ms-examples": { + "List policy assignments that apply to a subscription": { + "$ref": "./examples/listPolicyAssignments.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/PolicyAssignmentsFilterParameter" + }, + { + "$ref": "#/parameters/TopParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns an array of policy assignments.", + "schema": { + "$ref": "#/definitions/PolicyAssignmentListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-odata": "#/definitions/PolicyAssignment" + } + }, + "/{policyAssignmentId}": { + "delete": { + "tags": [ + "PolicyAssignments" + ], + "operationId": "PolicyAssignments_DeleteById", + "summary": "Deletes a policy assignment.", + "description": "This operation deletes the policy with the given ID. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), '/subscriptions/{subscriptionId}' (subscription), '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' (resource).", + "x-ms-examples": { + "Delete a policy assignment by ID": { + "$ref": "./examples/deletePolicyAssignmentById.json" + } + }, + "parameters": [ + { + "name": "policyAssignmentId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the policy assignment to delete. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'.", + "x-ms-skip-url-encoding": true + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns information about the policy assignment.", + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "204": { + "description": "No Content - the policy assignment doesn't exist." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "put": { + "tags": [ + "PolicyAssignments" + ], + "operationId": "PolicyAssignments_CreateById", + "summary": "Creates or updates a policy assignment.", + "description": "This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope apply to all resources contained in that scope. For example, when you assign a policy to a resource group that policy applies to all resources in the group. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'.", + "x-ms-examples": { + "Create or update policy assignment by ID": { + "$ref": "./examples/createPolicyAssignmentById.json" + }, + "Create or update policy assignment with a managed identity by ID": { + "$ref": "./examples/createPolicyAssignmentWithIdentityById.json" + } + }, + "parameters": [ + { + "name": "policyAssignmentId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the policy assignment to create. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'.", + "x-ms-skip-url-encoding": true + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyAssignment" + }, + "description": "Parameters for policy assignment." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "201": { + "description": "Created - Returns information about the policy assignment.", + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "get": { + "tags": [ + "PolicyAssignments" + ], + "operationId": "PolicyAssignments_GetById", + "summary": "Retrieves the policy assignment with the given ID.", + "description": "The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'.", + "x-ms-examples": { + "Retrieve a policy assignment by ID": { + "$ref": "./examples/getPolicyAssignmentById.json" + }, + "Retrieve a policy assignment with a managed identity by ID": { + "$ref": "./examples/getPolicyAssignmentWithIdentityById.json" + } + }, + "parameters": [ + { + "name": "policyAssignmentId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the policy assignment to get. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'.", + "x-ms-skip-url-encoding": true + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns information about the policy assignment.", + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + } + }, + "definitions": { + "CloudError": { + "x-ms-external": true, + "properties": { + "error": { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse" + } + }, + "description": "An error response from a policy operation." + }, + "PolicyAssignmentProperties": { + "properties": { + "displayName": { + "type": "string", + "description": "The display name of the policy assignment." + }, + "policyDefinitionId": { + "type": "string", + "description": "The ID of the policy definition or policy set definition being assigned." + }, + "scope": { + "type": "string", + "description": "The scope for the policy assignment.", + "readOnly": true + }, + "notScopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The policy's excluded scopes." + }, + "parameters": { + "description": "The parameter values for the assigned policy rule. The keys are the parameter names.", + "$ref": "#/definitions/ParameterValues" + }, + "description": { + "type": "string", + "description": "This message will be part of response in case of policy violation." + }, + "metadata": { + "type": "object", + "description": "The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs." + }, + "enforcementMode": { + "type": "string", + "description": "The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.", + "enum": [ + "Default", + "DoNotEnforce" + ], + "x-ms-enum": { + "name": "enforcementMode", + "modelAsString": true, + "values": [ + { + "value": "Default", + "description": "The policy effect is enforced during resource creation or update." + }, + { + "value": "DoNotEnforce", + "description": "The policy effect is not enforced during resource creation or update." + } + ] + }, + "default": "Default" + }, + "nonComplianceMessages": { + "type": "array", + "items": { + "$ref": "#/definitions/NonComplianceMessage" + }, + "description": "The messages that describe why a resource is non-compliant with the policy." + } + }, + "description": "The policy assignment properties." + }, + "NonComplianceMessage": { + "properties": { + "message": { + "type": "string", + "description": "A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results." + }, + "policyDefinitionReferenceId": { + "type": "string", + "description": "The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment." + } + }, + "required": [ + "message" + ], + "description": "A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results." + }, + "ParameterValues": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParameterValuesValue" + }, + "description": "The parameter values for the policy rule. The keys are the parameter names." + }, + "ParameterValuesValue": { + "properties": { + "value": { + "description": "The value of the parameter.", + "type": "object" + } + }, + "description": "The value of a parameter." + }, + "PolicyAssignment": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/PolicyAssignmentProperties", + "description": "Properties for the policy assignment." + }, + "id": { + "type": "string", + "description": "The ID of the policy assignment.", + "readOnly": true + }, + "type": { + "type": "string", + "description": "The type of the policy assignment.", + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the policy assignment.", + "readOnly": true + }, + "location": { + "type": "string", + "description": "The location of the policy assignment. Only required when utilizing managed identity." + }, + "identity": { + "$ref": "#/definitions/Identity", + "description": "The managed identity associated with the policy assignment." + } + }, + "description": "The policy assignment.", + "x-ms-azure-resource": true + }, + "PolicyAssignmentListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/PolicyAssignment" + }, + "description": "An array of policy assignments." + }, + "nextLink": { + "type": "string", + "description": "The URL to use for getting the next set of results." + } + }, + "description": "List of policy assignments." + }, + "Identity": { + "properties": { + "principalId": { + "readOnly": true, + "type": "string", + "description": "The principal ID of the resource identity." + }, + "tenantId": { + "readOnly": true, + "type": "string", + "description": "The tenant ID of the resource identity." + }, + "type": { + "type": "string", + "description": "The identity type. This is the only required field when adding a system assigned identity to a resource.", + "enum": [ + "SystemAssigned", + "None" + ], + "x-ms-enum": { + "name": "ResourceIdentityType", + "modelAsString": false, + "values": [ + { + "value": "SystemAssigned", + "description": "Indicates that a system assigned identity is associated with the resource." + }, + { + "value": "None", + "description": "Indicates that no identity is associated with the resource or that the existing identity should be removed." + } + ] + } + } + }, + "description": "Identity for the resource." + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the target subscription." + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "The API version to use for the operation." + }, + "ManagementGroupIdParameter": { + "name": "managementGroupId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the management group.", + "x-ms-parameter-location": "method" + }, + "PolicyAssignmentsFilterParameter": { + "name": "$filter", + "in": "query", + "required": false, + "type": "string", + "description": "The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}.", + "x-ms-skip-url-encoding": true, + "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" + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json new file mode 100644 index 000000000000..82ee6aac911b --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json @@ -0,0 +1,697 @@ +{ + "swagger": "2.0", + "info": { + "title": "PolicyClient", + "version": "2020-09-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/policyDefinitions/{policyDefinitionName}": { + "put": { + "tags": [ + "PolicyDefinitions" + ], + "operationId": "PolicyDefinitions_CreateOrUpdate", + "summary": "Creates or updates a policy definition in a subscription.", + "description": "This operation creates or updates a policy definition in the given subscription with the given name.", + "x-ms-examples": { + "Create or update a policy definition": { + "$ref": "./examples/createOrUpdatePolicyDefinition.json" + }, + "Create or update a policy definition with advanced parameters": { + "$ref": "./examples/createOrUpdatePolicyDefinitionAdvancedParams.json" + } + }, + "parameters": [ + { + "name": "policyDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy definition to create." + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyDefinition" + }, + "description": "The policy definition properties." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "201": { + "description": "Created - Returns information about the policy definition.", + "schema": { + "$ref": "#/definitions/PolicyDefinition" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "delete": { + "tags": [ + "PolicyDefinitions" + ], + "operationId": "PolicyDefinitions_Delete", + "summary": "Deletes a policy definition in a subscription.", + "description": "This operation deletes the policy definition in the given subscription with the given name.", + "x-ms-examples": { + "Delete a policy definition": { + "$ref": "./examples/deletePolicyDefinition.json" + } + }, + "parameters": [ + { + "name": "policyDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy definition to delete." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "200": { + "description": "OK" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "get": { + "tags": [ + "PolicyDefinitions" + ], + "operationId": "PolicyDefinitions_Get", + "summary": "Retrieves a policy definition in a subscription.", + "description": "This operation retrieves the policy definition in the given subscription with the given name.", + "x-ms-examples": { + "Retrieve a policy definition": { + "$ref": "./examples/getPolicyDefinition.json" + } + }, + "parameters": [ + { + "name": "policyDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy definition to get." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns information about the policy definition.", + "schema": { + "$ref": "#/definitions/PolicyDefinition" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}": { + "get": { + "tags": [ + "PolicyDefinitions" + ], + "operationId": "PolicyDefinitions_GetBuiltIn", + "summary": "Retrieves a built-in policy definition.", + "description": "This operation retrieves the built-in policy definition with the given name.", + "x-ms-examples": { + "Retrieve a built-in policy definition": { + "$ref": "./examples/getBuiltinPolicyDefinition.json" + } + }, + "parameters": [ + { + "name": "policyDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the built-in policy definition to get." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns information about the built-in policy definition.", + "schema": { + "$ref": "#/definitions/PolicyDefinition" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}": { + "put": { + "tags": [ + "PolicyDefinitions" + ], + "operationId": "PolicyDefinitions_CreateOrUpdateAtManagementGroup", + "summary": "Creates or updates a policy definition in a management group.", + "description": "This operation creates or updates a policy definition in the given management group with the given name.", + "x-ms-examples": { + "Create or update a policy definition at management group level": { + "$ref": "./examples/createOrUpdatePolicyDefinitionAtManagementGroup.json" + } + }, + "parameters": [ + { + "name": "policyDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy definition to create." + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyDefinition" + }, + "description": "The policy definition properties." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ManagementGroupIdParameter" + } + ], + "responses": { + "201": { + "description": "Created - Returns information about the policy definition.", + "schema": { + "$ref": "#/definitions/PolicyDefinition" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "delete": { + "tags": [ + "PolicyDefinitions" + ], + "operationId": "PolicyDefinitions_DeleteAtManagementGroup", + "summary": "Deletes a policy definition in a management group.", + "description": "This operation deletes the policy definition in the given management group with the given name.", + "x-ms-examples": { + "Delete a policy definition at management group level": { + "$ref": "./examples/deletePolicyDefinitionAtManagementGroup.json" + } + }, + "parameters": [ + { + "name": "policyDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy definition to delete." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ManagementGroupIdParameter" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "200": { + "description": "OK" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "get": { + "tags": [ + "PolicyDefinitions" + ], + "operationId": "PolicyDefinitions_GetAtManagementGroup", + "summary": "Retrieve a policy definition in a management group.", + "description": "This operation retrieves the policy definition in the given management group with the given name.", + "x-ms-examples": { + "Retrieve a policy definition at management group level": { + "$ref": "./examples/getPolicyDefinitionAtManagementGroup.json" + } + }, + "parameters": [ + { + "name": "policyDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy definition to get." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ManagementGroupIdParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns information about the policy definition.", + "schema": { + "$ref": "#/definitions/PolicyDefinition" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions": { + "get": { + "tags": [ + "PolicyDefinitions" + ], + "operationId": "PolicyDefinitions_List", + "summary": "Retrieves policy definitions in a subscription", + "description": "This operation retrieves a list of all the policy 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 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 definitions that at the given subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy 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 definitions whose category match the {value}.", + "x-ms-examples": { + "List policy definitions by subscription": { + "$ref": "./examples/listPolicyDefinitions.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/PolicyDefinitionsFilterParameter" + }, + { + "$ref": "#/parameters/TopParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns an array of policy definitions.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Authorization/policyDefinitions": { + "get": { + "tags": [ + "PolicyDefinitions" + ], + "operationId": "PolicyDefinitions_ListBuiltIn", + "summary": "Retrieve built-in policy definitions", + "description": "This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy 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 built-in policy definitions whose category match the {value}.", + "x-ms-examples": { + "List built-in policy definitions": { + "$ref": "./examples/listBuiltInPolicyDefinitions.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/PolicyDefinitionsFilterParameter" + }, + { + "$ref": "#/parameters/TopParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns an array of built-in policy definitions.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionListResult" + } + }, + "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/policyDefinitions": { + "get": { + "tags": [ + "PolicyDefinitions" + ], + "operationId": "PolicyDefinitions_ListByManagementGroup", + "summary": "Retrieve policy definitions in a management group", + "description": "This operation retrieves a list of all the policy 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 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 definitions that at the given management group. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy 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 definitions whose category match the {value}.", + "x-ms-examples": { + "List policy definitions by management group": { + "$ref": "./examples/listPolicyDefinitionsByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ManagementGroupIdParameter" + }, + { + "$ref": "#/parameters/PolicyDefinitionsFilterParameter" + }, + { + "$ref": "#/parameters/TopParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns an array of policy definitions.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "CloudError": { + "x-ms-external": true, + "properties": { + "error": { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse" + } + }, + "description": "An error response from a policy operation." + }, + "PolicyDefinitionProperties": { + "properties": { + "policyType": { + "type": "string", + "description": "The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static.", + "enum": [ + "NotSpecified", + "BuiltIn", + "Custom", + "Static" + ], + "x-ms-enum": { + "name": "policyType", + "modelAsString": true + } + }, + "mode": { + "type": "string", + "description": "The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data.", + "default": "Indexed" + }, + "displayName": { + "type": "string", + "description": "The display name of the policy definition." + }, + "description": { + "type": "string", + "description": "The policy definition description." + }, + "policyRule": { + "type": "object", + "description": "The policy rule." + }, + "metadata": { + "type": "object", + "description": "The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." + }, + "parameters": { + "description": "The parameter definitions for parameters used in the policy rule. The keys are the parameter names.", + "$ref": "#/definitions/ParameterDefinitions" + } + }, + "description": "The policy definition properties." + }, + "ParameterDefinitionsValue": { + "properties": { + "type": { + "description": "The data type of the parameter.", + "type": "string", + "enum": [ + "String", + "Array", + "Object", + "Boolean", + "Integer", + "Float", + "DateTime" + ], + "x-ms-enum": { + "name": "parameterType", + "modelAsString": true + } + }, + "allowedValues": { + "type": "array", + "items": { + "type": "object" + }, + "description": "The allowed values for the parameter." + }, + "defaultValue": { + "type": "object", + "description": "The default value for the parameter if no value is provided." + }, + "metadata": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "The display name for the parameter." + }, + "description": { + "type": "string", + "description": "The description of the parameter." + }, + "strongType": { + "type": "string", + "description": "Used when assigning the policy definition through the portal. Provides a context aware list of values for the user to choose from." + }, + "assignPermissions": { + "type": "boolean", + "description": "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." + } + }, + "additionalProperties": { + "type": "object" + }, + "description": "General metadata for the parameter." + } + }, + "description": "The definition of a parameter that can be provided to the policy." + }, + "ParameterDefinitions": { + "description": "The parameter definitions for parameters used in the policy. The keys are the parameter names.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParameterDefinitionsValue" + } + }, + "PolicyDefinition": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/PolicyDefinitionProperties", + "description": "The policy definition properties." + }, + "id": { + "readOnly": true, + "type": "string", + "description": "The ID of the policy definition." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the policy definition." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "The type of the resource (Microsoft.Authorization/policyDefinitions)." + } + }, + "description": "The policy definition.", + "x-ms-azure-resource": true + }, + "PolicyDefinitionListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/PolicyDefinition" + }, + "description": "An array of policy definitions." + }, + "nextLink": { + "type": "string", + "description": "The URL to use for getting the next set of results." + } + }, + "description": "List of policy definitions." + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the target subscription." + }, + "ManagementGroupIdParameter": { + "name": "managementGroupId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the management group.", + "x-ms-parameter-location": "method" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "The API version to use for the operation." + }, + "PolicyDefinitionsFilterParameter": { + "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 definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy 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 definitions whose category match the {value}.", + "x-ms-skip-url-encoding": true, + "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" + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json new file mode 100644 index 000000000000..4af4ba7facbd --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json @@ -0,0 +1,710 @@ +{ + "swagger": "2.0", + "info": { + "title": "PolicyClient", + "version": "2020-09-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": [ + { + "name": "policySetDefinitionName", + "in": "path", + "required": true, + "type": "string", + "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": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "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": [ + { + "name": "policySetDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy set definition to delete." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "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": [ + { + "name": "policySetDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy set definition to get." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "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", + "description": "The name of the policy set definition to get." + }, + { + "$ref": "#/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": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/PolicySetDefinitionsFilterParameter" + }, + { + "$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": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/PolicySetDefinitionsFilterParameter" + }, + { + "$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": [ + { + "name": "policySetDefinitionName", + "in": "path", + "required": true, + "type": "string", + "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": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ManagementGroupIdParameter" + } + ], + "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": [ + { + "name": "policySetDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy set definition to delete." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ManagementGroupIdParameter" + } + ], + "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": [ + { + "name": "policySetDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy set definition to get." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ManagementGroupIdParameter" + } + ], + "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/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ManagementGroupIdParameter" + }, + { + "$ref": "#/parameters/PolicySetDefinitionsFilterParameter" + }, + { + "$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": { + "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": { + "properties": { + "policyType": { + "type": "string", + "description": "The type of policy 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" + }, + "description": "An array of policy definition references." + }, + "policyDefinitionGroups": { + "type": "array", + "items": { + "$ref": "#/definitions/PolicyDefinitionGroup" + }, + "description": "The metadata describing groups of policy definition references within the policy set definition." + } + }, + "required": [ + "policyDefinitions" + ], + "description": "The policy set definition properties." + }, + "PolicyDefinitionReference": { + "properties": { + "policyDefinitionId": { + "type": "string", + "description": "The ID of the policy definition or policy set definition." + }, + "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": { + "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": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/PolicySetDefinitionProperties", + "description": "The policy 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)." + } + }, + "description": "The policy set definition.", + "x-ms-azure-resource": true + }, + "PolicySetDefinitionListResult": { + "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": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the target subscription." + }, + "ManagementGroupIdParameter": { + "name": "managementGroupId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the management group.", + "x-ms-parameter-location": "method" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "The API version to use for the operation." + }, + "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" + }, + "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" + } + } +} From 83482f52a575794af990ebe2349f55bbaad22a8f Mon Sep 17 00:00:00 2001 From: Cale Carter Date: Tue, 13 Jul 2021 13:44:15 -0700 Subject: [PATCH 2/8] Update swagger --- .../2021-06-01/dataPolicyManifests.json | 2 +- .../stable/2021-06-01/policyAssignments.json | 45 ++++++++++++++++--- .../stable/2021-06-01/policyDefinitions.json | 2 +- .../2021-06-01/policySetDefinitions.json | 2 +- 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json index 2e6c787d2834..730ca3c3d103 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "PolicyClient", - "version": "2020-09-01", + "version": "2021-06-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", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json index f28ad9d62305..3bf7147d4e90 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "PolicyClient", - "version": "2020-09-01", + "version": "2021-06-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", @@ -99,9 +99,12 @@ "Create or update a policy assignment with multiple non-compliance messages": { "$ref": "./examples/createPolicyAssignmentNonComplianceMessages.json" }, - "Create or update a policy assignment with a managed identity": { + "Create or update a policy assignment with a system assigned identity": { "$ref": "./examples/createPolicyAssignmentWithIdentity.json" }, + "Create or update a policy assignment with a user assigned identity": { + "$ref": "./examples/createPolicyAssignmentWithUserAssignedIdentity.json" + }, "Create or update a policy assignment without enforcing policy effect during resource creation or update.": { "$ref": "./examples/createPolicyAssignmentWithoutEnforcement.json" } @@ -161,8 +164,11 @@ "Retrieve a policy assignment": { "$ref": "./examples/getPolicyAssignment.json" }, - "Retrieve a policy assignment with a managed identity": { + "Retrieve a policy assignment with a system assigned identity": { "$ref": "./examples/getPolicyAssignmentWithIdentity.json" + }, + "Retrieve a policy assignment with a user assigned identity": { + "$ref": "./examples/getPolicyAssignmentWithUserAssignedIdentity.json" } }, "parameters": [ @@ -743,18 +749,19 @@ "principalId": { "readOnly": true, "type": "string", - "description": "The principal ID of the resource identity." + "description": "The principal ID of the resource identity. This property will only be provided for a system assigned identity" }, "tenantId": { "readOnly": true, "type": "string", - "description": "The tenant ID of the resource identity." + "description": "The tenant ID of the resource identity. This property will only be provided for a system assigned identity" }, "type": { "type": "string", - "description": "The identity type. This is the only required field when adding a system assigned identity to a resource.", + "description": "The identity type. This is the only required field when adding a system or user assigned identity to a resource.", "enum": [ "SystemAssigned", + "UserAssigned", "None" ], "x-ms-enum": { @@ -765,15 +772,39 @@ "value": "SystemAssigned", "description": "Indicates that a system assigned identity is associated with the resource." }, + { + "value": "UserAssigned", + "description": "Indicates that a system assigned identity is associated with the resource." + }, { "value": "None", "description": "Indicates that no identity is associated with the resource or that the existing identity should be removed." } ] } + }, + "userAssignedIdentities": { + "type": "object", + "additionalProperties": { + "type": "object", + "x-ms-client-name": "userAssignedIdentitiesValue", + "properties": { + "principalId": { + "readOnly": true, + "type": "string", + "description": "The principal id of user assigned identity." + }, + "clientId": { + "readOnly": true, + "type": "string", + "description": "The client id of user assigned identity." + } + } + }, + "description": "The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'." } }, - "description": "Identity for the resource." + "description": "Identity for the resource. Policy assignments support a maximum of one identity. That is either a system assigned identity or a single user assigned identity." } }, "parameters": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json index 82ee6aac911b..f28c808366bd 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "PolicyClient", - "version": "2020-09-01", + "version": "2021-06-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", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json index 4af4ba7facbd..f87952766d8d 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "PolicyClient", - "version": "2020-09-01", + "version": "2021-06-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", From 59cb951abce2c446a5a900341d14fb82d2efc84a Mon Sep 17 00:00:00 2001 From: Cale Carter Date: Tue, 13 Jul 2021 13:52:13 -0700 Subject: [PATCH 3/8] Updated examples --- .../createOrUpdatePolicyDefinition.json | 2 +- ...rUpdatePolicyDefinitionAdvancedParams.json | 2 +- ...datePolicyDefinitionAtManagementGroup.json | 2 +- .../createOrUpdatePolicySetDefinition.json | 2 +- ...ePolicySetDefinitionAtManagementGroup.json | 2 +- ...OrUpdatePolicySetDefinitionWithGroups.json | 2 +- ...DefinitionWithGroupsAtManagementGroup.json | 2 +- .../examples/createPolicyAssignment.json | 4 +- .../examples/createPolicyAssignmentById.json | 2 +- ...PolicyAssignmentNonComplianceMessages.json | 2 +- .../createPolicyAssignmentWithIdentity.json | 2 +- ...reatePolicyAssignmentWithIdentityById.json | 2 +- ...icyAssignmentWithUserAssignedIdentity.json | 72 +++++++++++++++++++ ...atePolicyAssignmentWithoutEnforcement.json | 2 +- .../examples/deletePolicyAssignment.json | 2 +- .../examples/deletePolicyAssignmentById.json | 2 +- .../examples/deletePolicyDefinition.json | 2 +- ...letePolicyDefinitionAtManagementGroup.json | 2 +- .../examples/deletePolicySetDefinition.json | 2 +- ...ePolicySetDefinitionAtManagementGroup.json | 2 +- .../getBuiltInPolicySetDefinition.json | 2 +- .../examples/getBuiltinPolicyDefinition.json | 2 +- .../examples/getDataPolicyManifest.json | 2 +- .../examples/getPolicyAssignment.json | 2 +- .../examples/getPolicyAssignmentById.json | 2 +- .../getPolicyAssignmentWithIdentity.json | 2 +- .../getPolicyAssignmentWithIdentityById.json | 2 +- ...icyAssignmentWithUserAssignedIdentity.json | 46 ++++++++++++ .../examples/getPolicyDefinition.json | 2 +- .../getPolicyDefinitionAtManagementGroup.json | 2 +- .../examples/getPolicySetDefinition.json | 2 +- ...tPolicySetDefinitionAtManagementGroup.json | 2 +- .../listBuiltInPolicyDefinitions.json | 2 +- .../listBuiltInPolicySetDefinitions.json | 2 +- .../examples/listDataPolicyManifests.json | 2 +- ...istDataPolicyManifestsNamespaceFilter.json | 2 +- .../examples/listPolicyAssignments.json | 2 +- ...stPolicyAssignmentsForManagementGroup.json | 2 +- .../listPolicyAssignmentsForResource.json | 2 +- ...listPolicyAssignmentsForResourceGroup.json | 2 +- .../examples/listPolicyDefinitions.json | 2 +- ...istPolicyDefinitionsByManagementGroup.json | 2 +- .../examples/listPolicySetDefinitions.json | 2 +- ...PolicySetDefinitionsByManagementGroup.json | 2 +- 44 files changed, 161 insertions(+), 43 deletions(-) create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithUserAssignedIdentity.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithUserAssignedIdentity.json diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinition.json index aa3e55e29488..6e75d0f0abd1 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinition.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policyDefinitionName": "ResourceNaming", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "properties": { "mode": "All", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json index c2fa248db943..53b198029a94 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policyDefinitionName": "EventHubDiagnosticLogs", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "properties": { "mode": "Indexed", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json index 058b36dde308..e3f2052dea6d 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json @@ -2,7 +2,7 @@ "parameters": { "managementGroupId": "MyManagementGroup", "policyDefinitionName": "ResourceNaming", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "properties": { "mode": "All", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinition.json index f58ada40720e..90333afdb78e 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinition.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policySetDefinitionName": "CostManagement", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "properties": { "displayName": "Cost Management", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json index 8eea7c0fe7a5..c23d54035486 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json @@ -2,7 +2,7 @@ "parameters": { "managementGroupId": "MyManagementGroup", "policySetDefinitionName": "CostManagement", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "properties": { "displayName": "Cost Management", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json index eaef603244e7..855291621345 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policySetDefinitionName": "CostManagement", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "properties": { "displayName": "Cost Management", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json index 1e89a5d474f7..9234e862b197 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json @@ -2,7 +2,7 @@ "parameters": { "managementGroupId": "MyManagementGroup", "policySetDefinitionName": "CostManagement", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "properties": { "displayName": "Cost Management", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignment.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignment.json index f13d4a79fc5e..7d2665242886 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignment.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignment.json @@ -2,7 +2,7 @@ "parameters": { "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policyAssignmentName": "EnforceNaming", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "properties": { "displayName": "Enforce resource naming rules", @@ -22,7 +22,7 @@ "nonComplianceMessages": [ { "message": "Resource names must start with 'DeptA' and end with '-LC'." - } + } ] } } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentById.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentById.json index 90da2df54878..120d28bf5e83 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentById.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentById.json @@ -1,7 +1,7 @@ { "parameters": { "policyAssignmentId": "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "properties": { "displayName": "Enforce storage account SKU", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentNonComplianceMessages.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentNonComplianceMessages.json index 3ae122db57e8..02ba33cf328d 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentNonComplianceMessages.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentNonComplianceMessages.json @@ -2,7 +2,7 @@ "parameters": { "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policyAssignmentName": "securityInitAssignment", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "properties": { "displayName": "Enforce security policies", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentity.json index a275b445dcdb..4339fa8dff3f 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentity.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentity.json @@ -2,7 +2,7 @@ "parameters": { "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policyAssignmentName": "EnforceNaming", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "location": "eastus", "identity": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentityById.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentityById.json index f406821541a3..c71134471afe 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentityById.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithIdentityById.json @@ -1,7 +1,7 @@ { "parameters": { "policyAssignmentId": "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "identity": { "type": "SystemAssigned" diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithUserAssignedIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithUserAssignedIdentity.json new file mode 100644 index 000000000000..e1c18b5b3af6 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithUserAssignedIdentity.json @@ -0,0 +1,72 @@ +{ + "parameters": { + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyAssignmentName": "EnforceNaming", + "api-version": "2021-06-01", + "parameters": { + "location": "eastus", + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {} + } + }, + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Foo Bar" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "enforcementMode": "Default" + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "enforcementMode": "Default", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": { + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "clientId": "4bee2b8a-1bee-47c2-90e9-404241551135" + } + } + }, + "location": "eastus", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "name": "EnforceNaming" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithoutEnforcement.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithoutEnforcement.json index 793c092aee93..1d820cbdc632 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithoutEnforcement.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignmentWithoutEnforcement.json @@ -2,7 +2,7 @@ "parameters": { "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policyAssignmentName": "EnforceNaming", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "parameters": { "properties": { "displayName": "Enforce resource naming rules", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignment.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignment.json index 544cb5ac97fa..1c1e28c991b9 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignment.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignment.json @@ -2,7 +2,7 @@ "parameters": { "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policyAssignmentName": "EnforceNaming", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignmentById.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignmentById.json index e1921db5f45b..0f0730c5daf7 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignmentById.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyAssignmentById.json @@ -1,7 +1,7 @@ { "parameters": { "policyAssignmentId": "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinition.json index b410e9ca857a..7afd61dab4f4 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinition.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policyDefinitionName": "ResourceNaming", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinitionAtManagementGroup.json index 5604e2df3490..b90b79faf86e 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinitionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicyDefinitionAtManagementGroup.json @@ -2,7 +2,7 @@ "parameters": { "managementGroupId": "MyManagementGroup", "policyDefinitionName": "ResourceNaming", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinition.json index e8a7c67030c1..4ff657f231ab 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinition.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policySetDefinitionName": "CostManagement", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinitionAtManagementGroup.json index 19c7f6532144..d8d901bc03d5 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinitionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/deletePolicySetDefinitionAtManagementGroup.json @@ -2,7 +2,7 @@ "parameters": { "managementGroupId": "MyManagementGroup", "policySetDefinitionName": "CostManagement", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltInPolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltInPolicySetDefinition.json index 0679500dba8a..bec7bb8ff839 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltInPolicySetDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltInPolicySetDefinition.json @@ -1,7 +1,7 @@ { "parameters": { "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltinPolicyDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltinPolicyDefinition.json index 06ab3d9c41bf..95d4a4009ec6 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltinPolicyDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getBuiltinPolicyDefinition.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policyDefinitionName": "7433c107-6db4-4ad1-b57a-a76dce0154a1", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getDataPolicyManifest.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getDataPolicyManifest.json index a11055df4c03..87692c83debc 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getDataPolicyManifest.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getDataPolicyManifest.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2020-09-01", + "api-version": "2021-06-01", "policyMode": "Microsoft.KeyVault.Data" }, "responses": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignment.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignment.json index 0c72cd86a9aa..849a328e7285 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignment.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignment.json @@ -2,7 +2,7 @@ "parameters": { "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policyAssignmentName": "EnforceNaming", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentById.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentById.json index d47e8f05f819..a7fa47acf4b0 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentById.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentById.json @@ -1,7 +1,7 @@ { "parameters": { "policyAssignmentId": "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentity.json index 0d4a478abd53..12c54bbbd3d8 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentity.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentity.json @@ -2,7 +2,7 @@ "parameters": { "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policyAssignmentName": "EnforceNaming", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentityById.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentityById.json index c7223fa1a752..e5169e563716 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentityById.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithIdentityById.json @@ -1,7 +1,7 @@ { "parameters": { "policyAssignmentId": "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithUserAssignedIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithUserAssignedIdentity.json new file mode 100644 index 000000000000..828890b6a36a --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyAssignmentWithUserAssignedIdentity.json @@ -0,0 +1,46 @@ +{ + "parameters": { + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyAssignmentName": "EnforceNaming", + "api-version": "2021-06-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "enforcementMode": "Default", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": { + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "clientId": "4bee2b8a-1bee-47c2-90e9-404241551135" + } + } + }, + "location": "westus", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "name": "EnforceNaming" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinition.json index 8046637f1c3e..f3bc054a6eeb 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinition.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policyDefinitionName": "ResourceNaming", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinitionAtManagementGroup.json index 0b3579c2e860..4cb073faece5 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinitionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinitionAtManagementGroup.json @@ -2,7 +2,7 @@ "parameters": { "managementGroupId": "MyManagementGroup", "policyDefinitionName": "ResourceNaming", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinition.json index 56ee429d5786..44b4c4f4005d 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinition.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "policySetDefinitionName": "CostManagement", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinitionAtManagementGroup.json index 3e5d5a5a5e45..506b99046b1e 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinitionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicySetDefinitionAtManagementGroup.json @@ -2,7 +2,7 @@ "parameters": { "managementGroupId": "MyManagementGroup", "policySetDefinitionName": "CostManagement", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicyDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicyDefinitions.json index 9c1cbe6f3706..a02d0d9b5cc6 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicyDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicyDefinitions.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicySetDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicySetDefinitions.json index 77aab4627e3d..98486d14574b 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicySetDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listBuiltInPolicySetDefinitions.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifests.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifests.json index d73b38f1c3f7..d1494ce2f284 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifests.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifests.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifestsNamespaceFilter.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifestsNamespaceFilter.json index 8cd8e706f4a1..6caa90bfced0 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifestsNamespaceFilter.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifestsNamespaceFilter.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2020-09-01", + "api-version": "2021-06-01", "$filter": "namespace eq 'Microsoft.KeyVault'" }, "responses": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignments.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignments.json index 14fd8f089a64..ced0d65640da 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignments.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignments.json @@ -1,7 +1,7 @@ { "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "$filter": "atScope()" }, "responses": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForManagementGroup.json index 13e53bb0a720..5ea56e66b29a 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForManagementGroup.json @@ -1,7 +1,7 @@ { "parameters": { "managementGroupId": "TestManagementGroup", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "$filter": "atScope()" }, "responses": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResource.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResource.json index 270985a50ef1..25ba40d814e0 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResource.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResource.json @@ -6,7 +6,7 @@ "resourceType": "domainNames", "resourceName": "MyTestComputer.cloudapp.net", "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResourceGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResourceGroup.json index 2fb1d326f1a2..3f4ec2bb8fa4 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResourceGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyAssignmentsForResourceGroup.json @@ -2,7 +2,7 @@ "parameters": { "resourceGroupName": "TestResourceGroup", "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "api-version": "2020-09-01", + "api-version": "2021-06-01", "$filter": "atScope()" }, "responses": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitions.json index 60d824bd3152..7d47a847c6d2 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitions.json @@ -1,7 +1,7 @@ { "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitionsByManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitionsByManagementGroup.json index 507c6a224117..2563c7b2a2ea 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitionsByManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicyDefinitionsByManagementGroup.json @@ -1,7 +1,7 @@ { "parameters": { "managementGroupId": "MyManagementGroup", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitions.json index 46647dfbbad5..0760092d2814 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitions.json @@ -1,7 +1,7 @@ { "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitionsByManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitionsByManagementGroup.json index 1fec469d807f..b9151af9b555 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitionsByManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listPolicySetDefinitionsByManagementGroup.json @@ -1,7 +1,7 @@ { "parameters": { "managementGroupId": "MyManagementGroup", - "api-version": "2020-09-01" + "api-version": "2021-06-01" }, "responses": { "200": { From 4f9dec3b05bdfbd0b3f4bf3040d68886730681f5 Mon Sep 17 00:00:00 2001 From: Cale Carter Date: Tue, 13 Jul 2021 13:55:39 -0700 Subject: [PATCH 4/8] Updated readme --- .../resources/resource-manager/readme.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/specification/resources/resource-manager/readme.md b/specification/resources/resource-manager/readme.md index f6354879cd2f..409929e8b230 100644 --- a/specification/resources/resource-manager/readme.md +++ b/specification/resources/resource-manager/readme.md @@ -37,7 +37,7 @@ tag: package-locks-2016-09 ``` ``` yaml $(package-policy) -tag: package-policy-2020-09 +tag: package-policy-2021-06 ``` ``` yaml $(package-resources) @@ -64,6 +64,23 @@ tag: package-deploymentscripts-2020-10 tag: package-templatespecs-2021-03-preview ``` +### Tag: package-policy-2020-09 + +These settings apply only when `--tag=package-policy-2021-06` is specified on the command line. + +``` yaml $(tag) == 'package-policy-2021-06' +input-file: +- Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json +- Microsoft.Authorization/stable/2021-06-01/policyAssignments.json +- Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json +- Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json +- Microsoft.Authorization/preview/2020-07-01-preview/policyExemptions.json + +# Needed when there is more than one input file +override-info: + title: PolicyClient +``` + ### Tag: package-resources-2021-04 These settings apply only when `--tag=package-resources-2021-04` is specified on the command line. From cb43666ca671afb780fc685a9cd3ad2d7a78388e Mon Sep 17 00:00:00 2001 From: Cale Carter Date: Tue, 20 Jul 2021 10:45:10 -0700 Subject: [PATCH 5/8] Removed dataPolicyManifest.json as we will use the previous one. Also updated based on feedback. --- .../2021-06-01/dataPolicyManifests.json | 311 ------------------ .../examples/getDataPolicyManifest.json | 69 ---- .../examples/listDataPolicyManifests.json | 112 ------- ...istDataPolicyManifestsNamespaceFilter.json | 73 ---- .../resources/resource-manager/readme.go.md | 11 + .../resources/resource-manager/readme.java.md | 19 ++ .../resources/resource-manager/readme.md | 4 +- .../resource-manager/readme.python.md | 11 + 8 files changed, 43 insertions(+), 567 deletions(-) delete mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json delete mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getDataPolicyManifest.json delete mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifests.json delete mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifestsNamespaceFilter.json diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json deleted file mode 100644 index 730ca3c3d103..000000000000 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json +++ /dev/null @@ -1,311 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "PolicyClient", - "version": "2021-06-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": { - "/providers/Microsoft.Authorization/dataPolicyManifests/{policyMode}": { - "get": { - "tags": [ - "DataPolicyManifests" - ], - "operationId": "DataPolicyManifests_GetByPolicyMode", - "summary": "Retrieves a data policy manifest.", - "description": "This operation retrieves the data policy manifest with the given policy mode.", - "x-ms-examples": { - "Retrieve a data policy manifest by policy mode": { - "$ref": "./examples/getDataPolicyManifest.json" - } - }, - "parameters": [ - { - "name": "policyMode", - "in": "path", - "required": true, - "type": "string", - "description": "The policy mode of the data policy manifest to get." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns information about a data policy manifest.", - "schema": { - "$ref": "#/definitions/DataPolicyManifest" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/CloudError" - } - } - } - } - }, - "/providers/Microsoft.Authorization/dataPolicyManifests": { - "get": { - "tags": [ - "DataPolicyManifests" - ], - "operationId": "DataPolicyManifests_List", - "summary": "Retrieves data policy manifests", - "description": "This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only includes all data policy manifests that have a namespace matching the provided value.", - "x-ms-examples": { - "List data policy manifests": { - "$ref": "./examples/listDataPolicyManifests.json" - }, - "List data policy manifests with namespace filter": { - "$ref": "./examples/listDataPolicyManifestsNamespaceFilter.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/DataPolicyManifestsFilterParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of data policy manifests.", - "schema": { - "$ref": "#/definitions/DataPolicyManifestListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/CloudError" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "CloudError": { - "x-ms-external": true, - "properties": { - "error": { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse" - } - }, - "description": "An error response from a policy operation." - }, - "DataManifestCustomResourceFunctionDefinition": { - "properties": { - "name": { - "type": "string", - "description": "The function name as it will appear in the policy rule. eg - 'vault'." - }, - "fullyQualifiedResourceType": { - "type": "string", - "description": "The fully qualified control plane resource type that this function represents. eg - 'Microsoft.KeyVault/vaults'." - }, - "defaultProperties": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The top-level properties that can be selected on the function's output. eg - [ \"name\", \"location\" ] if vault().name and vault().location are supported" - }, - "allowCustomProperties": { - "type": "boolean", - "description": "A value indicating whether the custom properties within the property bag are allowed. Needs api-version to be specified in the policy rule eg - vault('2019-06-01')." - } - }, - "description": "The custom resource function definition." - }, - "DataManifestResourceFunctionsDefinition": { - "properties": { - "standard": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The standard resource functions (subscription and/or resourceGroup)." - }, - "custom": { - "type": "array", - "items": { - "$ref": "#/definitions/DataManifestCustomResourceFunctionDefinition" - }, - "description": "An array of data manifest custom resource definition." - } - }, - "description": "The resource functions supported by a manifest" - }, - "DataEffect": { - "properties": { - "name": { - "type": "string", - "description": "The data effect name." - }, - "detailsSchema": { - "type": "object", - "description": "The data effect details schema." - } - }, - "description": "The data effect definition." - }, - "ResourceTypeAliases": { - "properties": { - "resourceType": { - "type": "string", - "description": "The resource type name." - }, - "aliases": { - "type": "array", - "items": { - "$ref": "../../../Microsoft.Resources/stable/2020-06-01/resources.json#/definitions/Alias" - }, - "description": "The aliases for property names." - } - }, - "description": "The resource type aliases definition." - }, - "DataPolicyManifestProperties": { - "properties": { - "namespaces": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The list of namespaces for the data policy manifest." - }, - "policyMode": { - "type": "string", - "description": "The policy mode of the data policy manifest." - }, - "isBuiltInOnly": { - "type": "boolean", - "description": "A value indicating whether policy mode is allowed only in built-in definitions." - }, - "resourceTypeAliases": { - "type": "array", - "items": { - "$ref": "#/definitions/ResourceTypeAliases" - }, - "description": "An array of resource type aliases." - }, - "effects": { - "type": "array", - "items": { - "$ref": "#/definitions/DataEffect" - }, - "description": "The effect definition." - }, - "fieldValues": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The non-alias field accessor values that can be used in the policy rule." - }, - "resourceFunctions": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/DataManifestResourceFunctionsDefinition", - "description": "The resource functions definition specified in the data manifest." - } - }, - "description": "The properties of the data policy manifest." - }, - "DataPolicyManifest": { - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/DataPolicyManifestProperties", - "description": "The data policy manifest properties." - }, - "id": { - "readOnly": true, - "type": "string", - "description": "The ID of the data policy manifest." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "The name of the data policy manifest (it's the same as the Policy Mode)." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "The type of the resource (Microsoft.Authorization/dataPolicyManifests)." - } - }, - "description": "The data policy manifest.", - "x-ms-azure-resource": true - }, - "DataPolicyManifestListResult": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/DataPolicyManifest" - }, - "description": "An array of data policy manifests." - }, - "nextLink": { - "type": "string", - "description": "The URL to use for getting the next set of results." - } - }, - "description": "List of data policy manifests." - } - }, - "parameters": { - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "The API version to use for the operation." - }, - "DataPolicyManifestsFilterParameter": { - "name": "$filter", - "in": "query", - "required": false, - "type": "string", - "description": "The filter to apply on the operation. Valid values for $filter are: \"namespace eq '{value}'\". If $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is provided, the returned list only includes all data policy manifests that have a namespace matching the provided value.", - "x-ms-skip-url-encoding": true, - "x-ms-parameter-location": "method" - } - } -} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getDataPolicyManifest.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getDataPolicyManifest.json deleted file mode 100644 index 87692c83debc..000000000000 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getDataPolicyManifest.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "parameters": { - "api-version": "2021-06-01", - "policyMode": "Microsoft.KeyVault.Data" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "id": "/providers/Microsoft.Authorization/dataPolicyManifests/Microsoft.KeyVault.Data", - "type": "Microsoft.Authorization/dataPolicyManifests", - "name": "Microsoft.KeyVault.Data", - "properties": { - "namespaces": [ - "Microsoft.KeyVault" - ], - "policyMode": "Microsoft.KeyVault.Data", - "isBuiltInOnly": true, - "resourceTypeAliases": [ - { - "resourceType": "vaults/certificates", - "aliases": [ - { - "name": "Microsoft.KeyVault.Data/vaults/certificates/keyProperties.keyType", - "paths": [ - { - "path": "keyProperties.keyType", - "apiVersions": [ - "2019-01-01" - ] - } - ] - } - ] - } - ], - "effects": [ - { - "name": "Audit" - }, - { - "name": "Deny" - } - ], - "fieldValues": [ - "type" - ], - "resourceFunctions": { - "standard": [ - "subscription", - "resourceGroup" - ], - "custom": [ - { - "name": "vault", - "fullyQualifiedResourceType": "Microsoft.KeyVault/vaults", - "defaultProperties": [ - "location", - "tags" - ], - "allowCustomProperties": false - } - ] - } - } - } - } - } -} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifests.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifests.json deleted file mode 100644 index d1494ce2f284..000000000000 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifests.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "parameters": { - "api-version": "2021-06-01" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "value": [ - { - "id": "/providers/Microsoft.Authorization/dataPolicyManifests/Microsoft.KeyVault.Data", - "type": "Microsoft.Authorization/dataPolicyManifests", - "name": "Microsoft.KeyVault.Data", - "properties": { - "namespaces": [ - "Microsoft.KeyVault" - ], - "policyMode": "Microsoft.KeyVault.Data", - "isBuiltInOnly": true, - "resourceTypeAliases": [ - { - "resourceType": "vaults/certificates", - "aliases": [ - { - "name": "Microsoft.KeyVault.Data/vaults/certificates/keyProperties.keyType", - "paths": [ - { - "path": "keyProperties.keyType", - "apiVersions": [ - "2019-01-01" - ] - } - ] - } - ] - } - ], - "effects": [ - { - "name": "audit" - }, - { - "name": "deny" - } - ], - "fieldValues": [ - "type" - ], - "resourceFunctions": { - "standard": [ - "subscription", - "resourceGroup" - ], - "custom": [ - { - "name": "vault", - "fullyQualifiedResourceType": "Microsoft.KeyVault/vaults", - "defaultProperties": [ - "location", - "tags" - ], - "allowCustomProperties": false - } - ] - } - } - }, - { - "id": "/providers/Microsoft.Authorization/dataPolicyManifests/Microsoft.Kubernetes.Data", - "type": "Microsoft.Authorization/dataPolicyManifests", - "name": "Microsoft.Kubernetes.Data", - "properties": { - "namespaces": [ - "Microsoft.Kubernetes", - "Microsoft.ContainerService" - ], - "policyMode": "Microsoft.Kubernetes.Data", - "isBuiltInOnly": false, - "effects": [ - { - "name": "audit", - "detailsSchema": { - "type": "object", - "properties": { - "constraintTemplate": { - "type": "string", - "pattern": "^(?i)(https:\\/\\/raw\\.githubusercontent\\.com\\/){1}(.+)(\\.){1}(yaml|yml){1}$" - }, - "constraint": { - "type": "string", - "pattern": "^(?i)(https:\\/\\/raw\\.githubusercontent\\.com\\/){1}(.+)(\\.){1}(yaml|yml){1}$" - }, - "values": { - "type": "object", - "maxProperties": 10, - "additionalProperties": {} - } - }, - "required": [ - "constraintTemplate" - ], - "additionalProperties": false - } - } - ] - } - } - ] - } - } - } -} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifestsNamespaceFilter.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifestsNamespaceFilter.json deleted file mode 100644 index 6caa90bfced0..000000000000 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/listDataPolicyManifestsNamespaceFilter.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "parameters": { - "api-version": "2021-06-01", - "$filter": "namespace eq 'Microsoft.KeyVault'" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "value": [ - { - "id": "/providers/Microsoft.Authorization/dataPolicyManifests/Microsoft.KeyVault.Data", - "type": "Microsoft.Authorization/dataPolicyManifests", - "name": "Microsoft.KeyVault.Data", - "properties": { - "namespaces": [ - "Microsoft.KeyVault" - ], - "policyMode": "Microsoft.KeyVault.Data", - "isBuiltInOnly": true, - "resourceTypeAliases": [ - { - "resourceType": "vaults/certificates", - "aliases": [ - { - "name": "Microsoft.KeyVault.Data/vaults/certificates/keyProperties.keyType", - "paths": [ - { - "path": "keyProperties.keyType", - "apiVersions": [ - "2019-01-01" - ] - } - ] - } - ] - } - ], - "effects": [ - { - "name": "audit" - }, - { - "name": "deny" - } - ], - "fieldValues": [ - "type" - ], - "resourceFunctions": { - "standard": [ - "subscription", - "resourceGroup" - ], - "custom": [ - { - "name": "vault", - "fullyQualifiedResourceType": "Microsoft.KeyVault/vaults", - "defaultProperties": [ - "location", - "tags" - ], - "allowCustomProperties": false - } - ] - } - } - } - ] - } - } - } -} diff --git a/specification/resources/resource-manager/readme.go.md b/specification/resources/resource-manager/readme.go.md index 75467280330c..2909b89b6ebd 100644 --- a/specification/resources/resource-manager/readme.go.md +++ b/specification/resources/resource-manager/readme.go.md @@ -35,6 +35,7 @@ batch: - tag: package-features-2021-07 - tag: package-locks-2016-09 - tag: package-locks-2015-01 + - tag: package-policy-2021-06 - tag: package-policy-2020-09 - tag: package-policy-2020-03 - tag: package-policy-2019-09 @@ -133,6 +134,16 @@ namespace: locks output-folder: $(go-sdk-folder)/services/resources/mgmt/2015-01-01/locks ``` +### Tag: package-policy-2021-06 and go + +These settings apply only when `--tag=package-policy-2021-06 --go` is specified on the command line. +Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'package-policy-2021-06' && $(go) +namespace: policy +output-folder: $(go-sdk-folder)/services/preview/resources/mgmt/2021-06-01-preview/policy +``` + ### Tag: package-policy-2020-09 and go These settings apply only when `--tag=package-policy-2020-09 --go` is specified on the command line. diff --git a/specification/resources/resource-manager/readme.java.md b/specification/resources/resource-manager/readme.java.md index 20c5d927ae94..3028cce811ae 100644 --- a/specification/resources/resource-manager/readme.java.md +++ b/specification/resources/resource-manager/readme.java.md @@ -54,6 +54,7 @@ batch: - tag: package-features-2021-07 - tag: package-locks-2016-09 - tag: package-managedapplications-2019-07 + - tag: package-policy-2021-06 - tag: package-policy-2020-09 - tag: package-policy-2019-09 - tag: package-policy-2019-06 @@ -132,6 +133,24 @@ generate-interface: true fconfig: '{"moduleName": "ManagedApplications"}' ``` +### Tag: package-policy-2021-06 and java + +These settings apply only when `--tag=package-policy-2021-06 --java` is specified on the command line. +Please also specify `--azure-libraries-for-java-folder=`. + +``` yaml $(tag) == 'package-policy-2021-06' && $(java) && $(multiapi) +java: + namespace: com.microsoft.azure.management.policy.v2021_06_01 + output-folder: $(azure-libraries-for-java-folder)/sdk/policy/mgmt-v2021_06_01 +regenerate-manager: true +generate-interface: true +fconfig: '{"moduleName": "Policy"}' +directive: + from: policyAssignments.json + where: $.definitions.PolicyAssignmentProperties.properties.scope + transform: $['x-ms-client-name'] = 'scopeProperty' +``` + ### Tag: package-policy-2020-09 and java These settings apply only when `--tag=package-policy-2020-09 --java` is specified on the command line. diff --git a/specification/resources/resource-manager/readme.md b/specification/resources/resource-manager/readme.md index 409929e8b230..87cdff9fd496 100644 --- a/specification/resources/resource-manager/readme.md +++ b/specification/resources/resource-manager/readme.md @@ -64,13 +64,13 @@ tag: package-deploymentscripts-2020-10 tag: package-templatespecs-2021-03-preview ``` -### Tag: package-policy-2020-09 +### Tag: package-policy-2021-06 These settings apply only when `--tag=package-policy-2021-06` is specified on the command line. ``` yaml $(tag) == 'package-policy-2021-06' input-file: -- Microsoft.Authorization/stable/2021-06-01/dataPolicyManifests.json +- Microsoft.Authorization/stable/2020-09-01/dataPolicyManifests.json - Microsoft.Authorization/stable/2021-06-01/policyAssignments.json - Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json - Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json diff --git a/specification/resources/resource-manager/readme.python.md b/specification/resources/resource-manager/readme.python.md index 13bfe914cb74..927122fd83b4 100644 --- a/specification/resources/resource-manager/readme.python.md +++ b/specification/resources/resource-manager/readme.python.md @@ -27,6 +27,7 @@ batch: - tag: package-locks-2015-01 - multiapiscript-locks: true - tag: package-managedapplications-2018-06 + - tag: package-policy-2021-06 - tag: package-policy-2020-09 - tag: package-policy-2019-09 - tag: package-policy-2019-06 @@ -197,6 +198,16 @@ namespace: azure.mgmt.resource.managedapplications output-folder: $(python-sdks-folder)/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications ``` +### Tag: package-policy-2021-06 and python + +These settings apply only when `--tag=package-policy-2021-06 --python` is specified on the command line. +Please also specify `--python-sdks-folder=`. + +``` yaml $(tag) == 'package-policy-2021-06' +namespace: azure.mgmt.resource.policy.v2021_06_01 +output-folder: $(python-sdks-folder)/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01 +``` + ### Tag: package-policy-2020-09 and python These settings apply only when `--tag=package-policy-2020-09 --python` is specified on the command line. From d27c85cd5689d5906c4b39dab96a7328e9be665e Mon Sep 17 00:00:00 2001 From: Cale Carter Date: Fri, 6 Aug 2021 15:54:09 -0700 Subject: [PATCH 6/8] Update to support patch for assignments and system data --- .../updatePolicyAssignmentWithIdentity.json | 48 +++++++ ...pdatePolicyAssignmentWithIdentityById.json | 46 +++++++ ...icyAssignmentWithUserAssignedIdentity.json | 55 ++++++++ .../stable/2021-06-01/policyAssignments.json | 118 ++++++++++++++++++ .../stable/2021-06-01/policyDefinitions.json | 5 + .../2021-06-01/policySetDefinitions.json | 5 + 6 files changed, 277 insertions(+) create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/updatePolicyAssignmentWithIdentity.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/updatePolicyAssignmentWithIdentityById.json create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/updatePolicyAssignmentWithUserAssignedIdentity.json diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/updatePolicyAssignmentWithIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/updatePolicyAssignmentWithIdentity.json new file mode 100644 index 000000000000..a3c1208e8541 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/updatePolicyAssignmentWithIdentity.json @@ -0,0 +1,48 @@ +{ + "parameters": { + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyAssignmentName": "EnforceNaming", + "api-version": "2021-06-01", + "parameters": { + "location": "eastus", + "identity": { + "type": "SystemAssigned" + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "enforcementMode": "Default", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "eastus", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "name": "EnforceNaming" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/updatePolicyAssignmentWithIdentityById.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/updatePolicyAssignmentWithIdentityById.json new file mode 100644 index 000000000000..1272273109f1 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/updatePolicyAssignmentWithIdentityById.json @@ -0,0 +1,46 @@ +{ + "parameters": { + "policyAssignmentId": "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", + "api-version": "2021-06-01", + "parameters": { + "identity": { + "type": "SystemAssigned" + }, + "location": "eastus" + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce storage account SKU", + "description": "Allow only storage accounts of SKU Standard_GRS or Standard_LRS to be created", + "metadata": { + "assignedBy": "Cheapskate Boss" + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "notScopes": [], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "enforcementMode": "Default" + }, + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "eastus", + "id": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", + "type": "Microsoft.Authorization/policyAssignments", + "name": "LowCostStorage" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/updatePolicyAssignmentWithUserAssignedIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/updatePolicyAssignmentWithUserAssignedIdentity.json new file mode 100644 index 000000000000..5e510aec2244 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/updatePolicyAssignmentWithUserAssignedIdentity.json @@ -0,0 +1,55 @@ +{ + "parameters": { + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyAssignmentName": "EnforceNaming", + "api-version": "2021-06-01", + "parameters": { + "location": "eastus", + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {} + } + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "displayName": "Enforce resource naming rules", + "description": "Force resource names to begin with given DeptA and end with -LC", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "enforcementMode": "Default", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": { + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "clientId": "4bee2b8a-1bee-47c2-90e9-404241551135" + } + } + }, + "location": "eastus", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "name": "EnforceNaming" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json index 3bf7147d4e90..0a88c10caa22 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json @@ -205,6 +205,58 @@ } } } + }, + "patch": { + "tags": [ + "PolicyAssignments" + ], + "operationId": "PolicyAssignments_Update", + "summary": "Updates a policy assignment.", + "description": " This operation updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group.", + "x-ms-examples": { + "Create or update a policy assignment with a system assigned identity": { + "$ref": "./examples/updatePolicyAssignmentWithIdentity.json" + }, + "Create or update a policy assignment with a user assigned identity": { + "$ref": "./examples/updatePolicyAssignmentWithUserAssignedIdentity.json" + } + }, + "parameters": [ + { + "name": "policyAssignmentId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the policy assignment to update. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'.", + "x-ms-skip-url-encoding": true + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyAssignmentUpdate" + }, + "description": "Parameters for policy assignment patch request." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns information about the policy assignment.", + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments": { @@ -582,6 +634,55 @@ } } } + }, + "patch":{ + "tags": [ + "PolicyAssignments" + ], + "operationId": "PolicyAssignments_UpdateById", + "summary": "Updates a policy assignment.", + "description": "This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all resources contained in that scope. For example, when you assign a policy to a resource group that policy applies to all resources in the group. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'.", + "x-ms-examples": { + "Update policy assignment with a managed identity by ID": { + "$ref": "./examples/updatePolicyAssignmentWithIdentityById.json" + } + }, + "parameters": [ + { + "name": "policyAssignmentId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the policy assignment to update. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'.", + "x-ms-skip-url-encoding": true + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyAssignmentUpdate" + }, + "description": "Parameters for policy assignment patch request." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns information about the policy assignment.", + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } } } }, @@ -723,6 +824,11 @@ "identity": { "$ref": "#/definitions/Identity", "description": "The managed identity associated with the policy assignment." + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData", + "readOnly": true, + "description": "The system metadata relating to this resource." } }, "description": "The policy assignment.", @@ -805,6 +911,18 @@ } }, "description": "Identity for the resource. Policy assignments support a maximum of one identity. That is either a system assigned identity or a single user assigned identity." + }, + "PolicyAssignmentUpdate":{ + "properties": { + "location": { + "type": "string", + "description": "The location of the policy assignment. Only required when utilizing managed identity." + }, + "identity": { + "$ref": "#/definitions/Identity", + "description": "The managed identity associated with the policy assignment." + } + } } }, "parameters": { diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json index f28c808366bd..91e32c41f0c6 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json @@ -628,6 +628,11 @@ "readOnly": true, "type": "string", "description": "The type of the resource (Microsoft.Authorization/policyDefinitions)." + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData", + "readOnly": true, + "description": "The system metadata relating to this resource." } }, "description": "The policy definition.", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json index f87952766d8d..37fc417b421f 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json @@ -641,6 +641,11 @@ "readOnly": true, "type": "string", "description": "The type of the resource (Microsoft.Authorization/policySetDefinitions)." + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData", + "readOnly": true, + "description": "The system metadata relating to this resource." } }, "description": "The policy set definition.", From 4f01306756734dcb6b714ddfdfb9835314e5fc8e Mon Sep 17 00:00:00 2001 From: Cale Carter Date: Fri, 6 Aug 2021 16:16:31 -0700 Subject: [PATCH 7/8] Updated based on tool analysis --- .../examples/createPolicyAssignment.json | 2 +- .../stable/2021-06-01/policyAssignments.json | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignment.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignment.json index 7d2665242886..36e9c79044fd 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignment.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/createPolicyAssignment.json @@ -22,7 +22,7 @@ "nonComplianceMessages": [ { "message": "Resource names must start with 'DeptA' and end with '-LC'." - } + } ] } } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json index 0a88c10caa22..6a2bd202aa8d 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json @@ -223,13 +223,20 @@ }, "parameters": [ { - "name": "policyAssignmentId", + "name": "scope", "in": "path", "required": true, "type": "string", - "description": "The ID of the policy assignment to update. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'.", + "description": "The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'", "x-ms-skip-url-encoding": true }, + { + "name": "policyAssignmentName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy assignment." + }, { "name": "parameters", "in": "body", @@ -635,7 +642,7 @@ } } }, - "patch":{ + "patch": { "tags": [ "PolicyAssignments" ], @@ -912,7 +919,8 @@ }, "description": "Identity for the resource. Policy assignments support a maximum of one identity. That is either a system assigned identity or a single user assigned identity." }, - "PolicyAssignmentUpdate":{ + "PolicyAssignmentUpdate": { + "type": "object", "properties": { "location": { "type": "string", From 8e60c3c5c3e24d492b4b497270f123c6dce88aaf Mon Sep 17 00:00:00 2001 From: Cale Carter Date: Wed, 11 Aug 2021 16:17:33 -0700 Subject: [PATCH 8/8] updated based on feedback --- .../stable/2021-06-01/policyAssignments.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json index 6a2bd202aa8d..774fbb3c0d9d 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyAssignments.json @@ -214,10 +214,10 @@ "summary": "Updates a policy assignment.", "description": " This operation updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group.", "x-ms-examples": { - "Create or update a policy assignment with a system assigned identity": { + "Update a policy assignment with a system assigned identity": { "$ref": "./examples/updatePolicyAssignmentWithIdentity.json" }, - "Create or update a policy assignment with a user assigned identity": { + "Update a policy assignment with a user assigned identity": { "$ref": "./examples/updatePolicyAssignmentWithUserAssignedIdentity.json" } },