From 6f7362459a13a70e814943b07dc04feb421d408a Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 27 Oct 2025 10:43:48 +0800 Subject: [PATCH 01/45] convert without /{policyAssignmentId} path --- .../PolicyAssignment.tsp | 125 ++ .../PolicyDefinition.tsp | 244 ++++ .../PolicyDefinitionVersion.tsp | 254 ++++ .../PolicySetDefinition.tsp | 283 +++++ .../PolicySetDefinitionVersion.tsp | 297 +++++ .../back-compatible.tsp | 141 +++ .../2025-03-01/acquirePolicyToken.json | 64 + .../acquirePolicyTokenAtManagementGroup.json | 64 + .../createOrUpdatePolicyDefinition.json | 97 ++ ...rUpdatePolicyDefinitionAdvancedParams.json | 124 ++ ...datePolicyDefinitionAtManagementGroup.json | 97 ++ ...ExternalEvaluationEnforcementSettings.json | 109 ++ ...createOrUpdatePolicyDefinitionVersion.json | 140 ++ ...icyDefinitionVersionAtManagementGroup.json | 140 ++ .../createOrUpdatePolicySetDefinition.json | 162 +++ ...ePolicySetDefinitionAtManagementGroup.json | 137 ++ ...ateOrUpdatePolicySetDefinitionVersion.json | 163 +++ ...SetDefinitionVersionAtManagementGroup.json | 135 ++ ...OrUpdatePolicySetDefinitionWithGroups.json | 198 +++ ...DefinitionWithGroupsAtManagementGroup.json | 196 +++ .../2025-03-01/createPolicyAssignment.json | 68 + ...PolicyAssignmentNonComplianceMessages.json | 63 + ...PolicyAssignmentWithEnrollEnforcement.json | 59 + .../createPolicyAssignmentWithIdentity.json | 69 + .../createPolicyAssignmentWithOverrides.json | 86 ++ ...PolicyAssignmentWithResourceSelectors.json | 70 + ...icyAssignmentWithUserAssignedIdentity.json | 76 ++ ...atePolicyAssignmentWithoutEnforcement.json | 59 + .../2025-03-01/deletePolicyAssignment.json | 42 + .../2025-03-01/deletePolicyDefinition.json | 17 + ...letePolicyDefinitionAtManagementGroup.json | 17 + .../deletePolicyDefinitionVersion.json | 18 + ...icyDefinitionVersionAtManagementGroup.json | 18 + .../2025-03-01/deletePolicySetDefinition.json | 17 + ...ePolicySetDefinitionAtManagementGroup.json | 17 + .../deletePolicySetDefinitionVersion.json | 18 + ...SetDefinitionVersionAtManagementGroup.json | 18 + .../getBuiltInPolicySetDefinition.json | 84 ++ .../getBuiltInPolicySetDefinitionVersion.json | 81 ++ .../getBuiltinPolicyDefinition.json | 59 + .../getBuiltinPolicyDefinitionVersion.json | 56 + .../2025-03-01/getPolicyAssignment.json | 40 + .../getPolicyAssignmentWithIdentity.json | 46 + .../getPolicyAssignmentWithOverrides.json | 47 + ...PolicyAssignmentWithResourceSelectors.json | 46 + ...icyAssignmentWithUserAssignedIdentity.json | 50 + .../2025-03-01/getPolicyDefinition.json | 60 + .../getPolicyDefinitionAtManagementGroup.json | 60 + .../getPolicyDefinitionVersion.json | 57 + ...icyDefinitionVersionAtManagementGroup.json | 57 + .../2025-03-01/getPolicySetDefinition.json | 77 ++ ...tPolicySetDefinitionAtManagementGroup.json | 59 + .../getPolicySetDefinitionVersion.json | 74 ++ ...SetDefinitionVersionAtManagementGroup.json | 56 + ...istAllBuiltInPolicyDefinitionVersions.json | 107 ++ ...AllBuiltInPolicySetDefinitionVersions.json | 83 ++ .../listAllPolicyDefinitionVersions.json | 101 ++ ...cyDefinitionVersionsByManagementGroup.json | 101 ++ .../listAllPolicySetDefinitionVersions.json | 58 + ...etDefinitionVersionsByManagementGroup.json | 125 ++ .../listBuiltInPolicyDefinitionVersions.json | 108 ++ .../listBuiltInPolicyDefinitions.json | 147 +++ ...istBuiltInPolicySetDefinitionVersions.json | 84 ++ .../listBuiltInPolicySetDefinitions.json | 87 ++ ...listPolicyAssignmentsForResourceGroup.json | 66 + .../listPolicyDefinitionVersions.json | 102 ++ ...cyDefinitionVersionsByManagementGroup.json | 102 ++ .../2025-03-01/listPolicyDefinitions.json | 145 +++ ...istPolicyDefinitionsByManagementGroup.json | 108 ++ .../listPolicySetDefinitionVersions.json | 59 + ...etDefinitionVersionsByManagementGroup.json | 59 + .../2025-03-01/listPolicySetDefinitions.json | 133 ++ ...PolicySetDefinitionsByManagementGroup.json | 131 ++ .../updatePolicyAssignmentWithIdentity.json | 52 + .../updatePolicyAssignmentWithOverrides.json | 66 + ...PolicyAssignmentWithResourceSelectors.json | 64 + ...icyAssignmentWithUserAssignedIdentity.json | 59 + .../Authorization.Management/main.tsp | 46 + .../Authorization.Management/models.tsp | 1122 +++++++++++++++++ .../Authorization.Management/routes.tsp | 143 +++ .../Authorization.Management/tspconfig.yaml | 13 + 81 files changed, 8382 insertions(+) create mode 100644 specification/resources/Authorization.Management/PolicyAssignment.tsp create mode 100644 specification/resources/Authorization.Management/PolicyDefinition.tsp create mode 100644 specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp create mode 100644 specification/resources/Authorization.Management/PolicySetDefinition.tsp create mode 100644 specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp create mode 100644 specification/resources/Authorization.Management/back-compatible.tsp create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyToken.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyTokenAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinition.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAdvancedParams.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersion.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinition.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersion.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroups.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignment.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentNonComplianceMessages.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithEnrollEnforcement.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithIdentity.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithOverrides.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithResourceSelectors.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithUserAssignedIdentity.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithoutEnforcement.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyAssignment.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinition.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersion.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersionAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinition.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersion.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersionAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinition.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinitionVersion.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinition.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinitionVersion.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignment.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithIdentity.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithOverrides.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithResourceSelectors.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithUserAssignedIdentity.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinition.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersion.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersionAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinition.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersion.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersionAtManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicyDefinitionVersions.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicySetDefinitionVersions.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersions.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersionsByManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersions.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersionsByManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitionVersions.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitions.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitionVersions.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitions.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForResourceGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersions.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersionsByManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitions.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionsByManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersions.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersionsByManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitions.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionsByManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithIdentity.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithOverrides.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithResourceSelectors.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithUserAssignedIdentity.json create mode 100644 specification/resources/Authorization.Management/main.tsp create mode 100644 specification/resources/Authorization.Management/models.tsp create mode 100644 specification/resources/Authorization.Management/routes.tsp create mode 100644 specification/resources/Authorization.Management/tspconfig.yaml diff --git a/specification/resources/Authorization.Management/PolicyAssignment.tsp b/specification/resources/Authorization.Management/PolicyAssignment.tsp new file mode 100644 index 000000000000..80b5b0ba179c --- /dev/null +++ b/specification/resources/Authorization.Management/PolicyAssignment.tsp @@ -0,0 +1,125 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.Authorization; +/** + * The policy assignment. + */ +@extensionResource +model PolicyAssignment + is Azure.ResourceManager.ExtensionResource { + ...ResourceNameParameter< + Resource = PolicyAssignment, + KeyName = "policyAssignmentName", + SegmentName = "policyAssignments", + NamePattern = "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + >; + + /** + * The location of the policy assignment. Only required when utilizing managed identity. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + location?: string; + + /** + * The managed identity associated with the policy assignment. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + identity?: Identity; +} + +@armResourceOperations +interface PolicyAssignments { + /** + * This operation retrieves a single policy assignment, given its name and the scope it was created at. + */ + get is Extension.Read< + Extension.ScopeParameter, + PolicyAssignment, + Parameters = { + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + } + >; + + /** + * 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. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility" + create is Extension.CreateOrReplaceSync< + Extension.ScopeParameter, + PolicyAssignment, + Response = ArmResourceCreatedSyncResponse + >; + + /** + * 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. + */ + @patch(#{ implicitOptionality: false }) + update is Extension.CustomPatchSync< + Extension.ScopeParameter, + PolicyAssignment, + PatchModel = PolicyAssignmentUpdate + >; + + /** + * 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}'. + */ + delete is Extension.DeleteSync< + Extension.ScopeParameter, + PolicyAssignment, + Response = ArmResponse | ArmDeletedNoContentResponse + >; + + /** + * 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. + */ + listForResourceGroup is Extension.ListByTarget< + Extension.ScopeParameter, + PolicyAssignment, + Parameters = { + ...SubscriptionIdParameter; + ...ResourceGroupParameter; + + /** + * 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}. + */ + @query("$filter") + $filter?: string; + + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} + +@@doc(PolicyAssignment.name, "The name of the policy assignment to get."); +@@doc(PolicyAssignment.properties, "Properties for the policy assignment."); +@@doc(PolicyAssignments.create::parameters.resource, + "Parameters for the policy assignment." +); +@@doc(PolicyAssignments.update::parameters.properties, + "Parameters for policy assignment patch request." +); diff --git a/specification/resources/Authorization.Management/PolicyDefinition.tsp b/specification/resources/Authorization.Management/PolicyDefinition.tsp new file mode 100644 index 000000000000..1262416c850c --- /dev/null +++ b/specification/resources/Authorization.Management/PolicyDefinition.tsp @@ -0,0 +1,244 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.Authorization; +/** + * The policy definition. + */ +@subscriptionResource +model PolicyDefinition + is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = PolicyDefinition, + KeyName = "policyDefinitionName", + SegmentName = "policyDefinitions", + NamePattern = "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + >; +} + +alias PolicyDefinitionOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + ...SubscriptionIdParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + }, + {}, + { + /** The name of the policy definition to get. */ + @path + @segment("policyDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policyDefinitionName: string; + } +>; + +@armResourceOperations +interface PolicyDefinitions { + /** + * This operation retrieves the policy definition in the given subscription with the given name. + */ + get is PolicyDefinitionOps.Read; + + /** + * This operation creates or updates a policy definition in the given subscription with the given name. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility" + createOrUpdate is PolicyDefinitionOps.CreateOrUpdateSync< + PolicyDefinition, + Response = ArmResourceCreatedSyncResponse + >; + + /** + * This operation deletes the policy definition in the given subscription with the given name. + */ + delete is PolicyDefinitionOps.DeleteSync; + + /** + * 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}. + */ + list is PolicyDefinitionOps.List< + PolicyDefinition, + Parameters = { + /** + * 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}. + */ + @query("$filter") + $filter?: string; + + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} +alias PolicyDefinitionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + }, + {}, + { + /** The name of the built-in policy definition to get. */ + @path + @segment("policyDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policyDefinitionName: string; + } +>; + +@armResourceOperations +interface PolicyDefinitionOperationGroup { + /** + * This operation retrieves the built-in policy definition with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitions_GetBuiltIn") + getBuiltIn is PolicyDefinitionOperationGroupOps.Read; + + /** + * 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}. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitions_ListBuiltIn") + listBuiltIn is PolicyDefinitionOperationGroupOps.List< + PolicyDefinition, + Parameters = { + /** + * 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}. + */ + @query("$filter") + $filter?: string; + + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} +alias PolicyDefinitionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Management"; + + /** The ID of the management group. */ + @path + @segment("managementGroups") + @key + managementGroupId: string; + }, + { + ...Extension.ExtensionProviderNamespace; + }, + { + ...Extension.ExtensionProviderNamespace; + + /** The name of the policy definition to get. */ + @path + @segment("policyDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policyDefinitionName: string; + } +>; + +@armResourceOperations +interface PolicyDefinitionOperationGroup { + /** + * This operation retrieves the policy definition in the given management group with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitions_GetAtManagementGroup") + getAtManagementGroup is PolicyDefinitionOperationGroupOps.Read< + Extension.ManagementGroup, + PolicyDefinition + >; + + /** + * This operation creates or updates a policy definition in the given management group with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility" + @operationId("PolicyDefinitions_CreateOrUpdateAtManagementGroup") + createOrUpdateAtManagementGroup is PolicyDefinitionOperationGroupOps.CreateOrUpdateSync< + Extension.ManagementGroup, + PolicyDefinition, + Response = ArmResourceCreatedSyncResponse + >; + + /** + * This operation deletes the policy definition in the given management group with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitions_DeleteAtManagementGroup") + deleteAtManagementGroup is PolicyDefinitionOperationGroupOps.DeleteSync< + Extension.ManagementGroup, + PolicyDefinition + >; + + /** + * 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}. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitions_ListByManagementGroup") + listByManagementGroup is PolicyDefinitionOperationGroupOps.List< + Extension.ManagementGroup, + PolicyDefinition, + Parameters = { + /** + * 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}. + */ + @query("$filter") + $filter?: string; + + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} + +@@doc(PolicyDefinition.name, "The name of the policy definition to get."); +@@doc(PolicyDefinition.properties, "The policy definition properties."); +@@doc(PolicyDefinitions.createOrUpdate::parameters.resource, + "The policy definition properties." +); +@@doc(PolicyDefinitionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, + "The policy definition properties." +); diff --git a/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp b/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp new file mode 100644 index 000000000000..59871cf8f1f5 --- /dev/null +++ b/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp @@ -0,0 +1,254 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; +import "./PolicyDefinition.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.Authorization; +/** + * The ID of the policy definition version. + */ +@subscriptionResource +@parentResource(PolicyDefinition) +model PolicyDefinitionVersion + is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = PolicyDefinitionVersion, + KeyName = "policyDefinitionVersion", + SegmentName = "versions", + NamePattern = "^\\d+\\.\\d+\\.\\d+$" + >; +} + +alias PolicyDefinitionVersionOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + ...SubscriptionIdParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + + /** The name of the policy definition. */ + @path + @segment("policyDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policyDefinitionName: string; + }, + {}, + { + /** The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number */ + @path + @segment("versions") + @key + @pattern("^\\d+\\.\\d+\\.\\d+$") + policyDefinitionVersion: string; + } +>; + +@armResourceOperations +interface PolicyDefinitionVersions { + /** + * This operation retrieves the policy definition version in the given subscription with the given name. + */ + get is PolicyDefinitionVersionOps.Read; + + /** + * This operation creates or updates a policy definition in the given subscription with the given name. + */ + createOrUpdate is PolicyDefinitionVersionOps.CreateOrUpdateSync; + + /** + * This operation deletes the policy definition version in the given subscription with the given name. + */ + delete is PolicyDefinitionVersionOps.DeleteSync; + + /** + * This operation retrieves a list of all the policy definition versions for the given policy definition. + */ + list is PolicyDefinitionVersionOps.List< + PolicyDefinitionVersion, + Parameters = { + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} +alias PolicyDefinitionVersionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + + /** The name of the policy definition. */ + @path + @segment("policyDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policyDefinitionName: string; + }, + {}, + { + /** The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number */ + @path + @segment("versions") + @key + @pattern("^\\d+\\.\\d+\\.\\d+$") + policyDefinitionVersion: string; + } +>; + +@armResourceOperations +interface PolicyDefinitionVersionOperationGroup { + /** + * This operation retrieves the built-in policy definition version with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitionVersions_GetBuiltIn") + getBuiltIn is PolicyDefinitionVersionOperationGroupOps.Read; + + /** + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitionVersions_ListBuiltIn") + listBuiltIn is PolicyDefinitionVersionOperationGroupOps.List< + PolicyDefinitionVersion, + Parameters = { + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} +alias PolicyDefinitionVersionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Management"; + + /** The name of the management group. The name is case insensitive. */ + @path + @segment("managementGroups") + @key + managementGroupName: string; + }, + { + ...Extension.ExtensionProviderNamespace; + + /** The name of the policy definition. */ + @path + @segment("policyDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policyDefinitionName: string; + }, + { + ...Extension.ExtensionProviderNamespace; + + /** The name of the policy definition. */ + @path + @segment("policyDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policyDefinitionName: string; + + /** The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number */ + @path + @segment("versions") + @key + @pattern("^\\d+\\.\\d+\\.\\d+$") + policyDefinitionVersion: string; + } +>; + +@armResourceOperations +interface PolicyDefinitionVersionOperationGroup { + /** + * This operation retrieves the policy definition version in the given management group with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitionVersions_GetAtManagementGroup") + getAtManagementGroup is PolicyDefinitionVersionOperationGroupOps.Read< + Extension.ManagementGroup, + PolicyDefinitionVersion + >; + + /** + * This operation creates or updates a policy definition version in the given management group with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitionVersions_CreateOrUpdateAtManagementGroup") + createOrUpdateAtManagementGroup is PolicyDefinitionVersionOperationGroupOps.CreateOrUpdateSync< + Extension.ManagementGroup, + PolicyDefinitionVersion + >; + + /** + * This operation deletes the policy definition in the given management group with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitionVersions_DeleteAtManagementGroup") + deleteAtManagementGroup is PolicyDefinitionVersionOperationGroupOps.DeleteSync< + Extension.ManagementGroup, + PolicyDefinitionVersion + >; + + /** + * This operation retrieves a list of all the policy definition versions for the given policy definition in the given management group. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitionVersions_ListByManagementGroup") + listByManagementGroup is PolicyDefinitionVersionOperationGroupOps.List< + Extension.ManagementGroup, + PolicyDefinitionVersion, + Parameters = { + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} + +@@doc(PolicyDefinitionVersion.name, + "The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number" +); +@@doc(PolicyDefinitionVersion.properties, + "The policy definition version properties." +); +@@doc(PolicyDefinitionVersions.createOrUpdate::parameters.resource, + "The policy definition properties." +); +@@doc(PolicyDefinitionVersionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, + "The policy definition properties." +); diff --git a/specification/resources/Authorization.Management/PolicySetDefinition.tsp b/specification/resources/Authorization.Management/PolicySetDefinition.tsp new file mode 100644 index 000000000000..3cedb1beae3f --- /dev/null +++ b/specification/resources/Authorization.Management/PolicySetDefinition.tsp @@ -0,0 +1,283 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.Authorization; +/** + * The policy set definition. + */ +@subscriptionResource +model PolicySetDefinition + is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = PolicySetDefinition, + KeyName = "policySetDefinitionName", + SegmentName = "policySetDefinitions", + NamePattern = "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + >; +} + +alias PolicySetDefinitionOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + ...SubscriptionIdParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + }, + {}, + { + /** The name of the policy set definition to get. */ + @path + @segment("policySetDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policySetDefinitionName: string; + } +>; + +@armResourceOperations +interface PolicySetDefinitions { + /** + * This operation retrieves the policy set definition in the given subscription with the given name. + */ + get is PolicySetDefinitionOps.Read< + PolicySetDefinition, + Parameters = { + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + } + >; + + /** + * This operation creates or updates a policy set definition in the given subscription with the given name. + */ + createOrUpdate is PolicySetDefinitionOps.CreateOrUpdateSync; + + /** + * This operation deletes the policy set definition in the given subscription with the given name. + */ + delete is PolicySetDefinitionOps.DeleteSync; + + /** + * 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}. + */ + list is PolicySetDefinitionOps.List< + PolicySetDefinition, + Parameters = { + /** + * 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}. + */ + @query("$filter") + $filter?: string; + + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} +alias PolicySetDefinitionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + }, + {}, + { + /** The name of the policy set definition to get. */ + @path + @segment("policySetDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policySetDefinitionName: string; + } +>; + +@armResourceOperations +interface PolicySetDefinitionOperationGroup { + /** + * This operation retrieves the built-in policy set definition with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicySetDefinitions_GetBuiltIn") + getBuiltIn is PolicySetDefinitionOperationGroupOps.Read< + PolicySetDefinition, + Parameters = { + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + } + >; + + /** + * 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}. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicySetDefinitions_ListBuiltIn") + listBuiltIn is PolicySetDefinitionOperationGroupOps.List< + PolicySetDefinition, + Parameters = { + /** + * 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}. + */ + @query("$filter") + $filter?: string; + + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} +alias PolicySetDefinitionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Management"; + + /** The ID of the management group. */ + @path + @segment("managementGroups") + @key + managementGroupId: string; + }, + { + ...Extension.ExtensionProviderNamespace; + }, + { + ...Extension.ExtensionProviderNamespace; + + /** The name of the policy set definition to get. */ + @path + @segment("policySetDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policySetDefinitionName: string; + } +>; + +@armResourceOperations +interface PolicySetDefinitionOperationGroup { + /** + * This operation retrieves the policy set definition in the given management group with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicySetDefinitions_GetAtManagementGroup") + getAtManagementGroup is PolicySetDefinitionOperationGroupOps.Read< + Extension.ManagementGroup, + PolicySetDefinition, + Parameters = { + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + } + >; + + /** + * This operation creates or updates a policy set definition in the given management group with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicySetDefinitions_CreateOrUpdateAtManagementGroup") + createOrUpdateAtManagementGroup is PolicySetDefinitionOperationGroupOps.CreateOrUpdateSync< + Extension.ManagementGroup, + PolicySetDefinition + >; + + /** + * This operation deletes the policy set definition in the given management group with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicySetDefinitions_DeleteAtManagementGroup") + deleteAtManagementGroup is PolicySetDefinitionOperationGroupOps.DeleteSync< + Extension.ManagementGroup, + PolicySetDefinition + >; + + /** + * 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}. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicySetDefinitions_ListByManagementGroup") + listByManagementGroup is PolicySetDefinitionOperationGroupOps.List< + Extension.ManagementGroup, + PolicySetDefinition, + Parameters = { + /** + * 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}. + */ + @query("$filter") + $filter?: string; + + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} + +@@doc(PolicySetDefinition.name, + "The name of the policy set definition to get." +); +@@doc(PolicySetDefinition.properties, "The policy set definition properties."); +@@doc(PolicySetDefinitions.createOrUpdate::parameters.resource, + "The policy set definition properties." +); +@@doc(PolicySetDefinitionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, + "The policy set definition properties." +); diff --git a/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp b/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp new file mode 100644 index 000000000000..595344427727 --- /dev/null +++ b/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp @@ -0,0 +1,297 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; +import "./PolicySetDefinition.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.Authorization; +/** + * The policy set definition version. + */ +@subscriptionResource +@parentResource(PolicySetDefinition) +model PolicySetDefinitionVersion + is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = PolicySetDefinitionVersion, + KeyName = "policyDefinitionVersion", + SegmentName = "versions", + NamePattern = "^\\d+\\.\\d+\\.\\d+$" + >; +} + +alias PolicySetDefinitionVersionOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + ...SubscriptionIdParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + + /** The name of the policy set definition. */ + @path + @segment("policySetDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policySetDefinitionName: string; + }, + {}, + { + /** The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number */ + @path + @segment("versions") + @key + @pattern("^\\d+\\.\\d+\\.\\d+$") + policyDefinitionVersion: string; + } +>; + +@armResourceOperations +interface PolicySetDefinitionVersions { + /** + * This operation retrieves the policy set definition version in the given subscription with the given name and version. + */ + get is PolicySetDefinitionVersionOps.Read< + PolicySetDefinitionVersion, + Parameters = { + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + } + >; + + /** + * This operation creates or updates a policy set definition version in the given subscription with the given name and version. + */ + createOrUpdate is PolicySetDefinitionVersionOps.CreateOrUpdateSync; + + /** + * This operation deletes the policy set definition version in the given subscription with the given name and version. + */ + delete is PolicySetDefinitionVersionOps.DeleteSync; + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set definition. + */ + list is PolicySetDefinitionVersionOps.List< + PolicySetDefinitionVersion, + Parameters = { + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} +alias PolicySetDefinitionVersionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + + /** The name of the policy set definition. */ + @path + @segment("policySetDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policySetDefinitionName: string; + }, + {}, + { + /** The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number */ + @path + @segment("versions") + @key + @pattern("^\\d+\\.\\d+\\.\\d+$") + policyDefinitionVersion: string; + } +>; + +@armResourceOperations +interface PolicySetDefinitionVersionOperationGroup { + /** + * This operation retrieves the built-in policy set definition version with the given name and version. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicySetDefinitionVersions_GetBuiltIn") + getBuiltIn is PolicySetDefinitionVersionOperationGroupOps.Read< + PolicySetDefinitionVersion, + Parameters = { + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + } + >; + + /** + * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy set definition. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicySetDefinitionVersions_ListBuiltIn") + listBuiltIn is PolicySetDefinitionVersionOperationGroupOps.List< + PolicySetDefinitionVersion, + Parameters = { + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} +alias PolicySetDefinitionVersionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Management"; + + /** The name of the management group. The name is case insensitive. */ + @path + @segment("managementGroups") + @key + managementGroupName: string; + }, + { + ...Extension.ExtensionProviderNamespace; + + /** The name of the policy set definition. */ + @path + @segment("policySetDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policySetDefinitionName: string; + }, + { + ...Extension.ExtensionProviderNamespace; + + /** The name of the policy set definition. */ + @path + @segment("policySetDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policySetDefinitionName: string; + + /** The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number */ + @path + @segment("versions") + @key + @pattern("^\\d+\\.\\d+\\.\\d+$") + policyDefinitionVersion: string; + } +>; + +@armResourceOperations +interface PolicySetDefinitionVersionOperationGroup { + /** + * This operation retrieves the policy set definition version in the given management group with the given name and version. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicySetDefinitionVersions_GetAtManagementGroup") + getAtManagementGroup is PolicySetDefinitionVersionOperationGroupOps.Read< + Extension.ManagementGroup, + PolicySetDefinitionVersion, + Parameters = { + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + } + >; + + /** + * This operation creates or updates a policy set definition version in the given management group with the given name and version. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicySetDefinitionVersions_CreateOrUpdateAtManagementGroup") + createOrUpdateAtManagementGroup is PolicySetDefinitionVersionOperationGroupOps.CreateOrUpdateSync< + Extension.ManagementGroup, + PolicySetDefinitionVersion + >; + + /** + * This operation deletes the policy set definition version in the given management group with the given name and version. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicySetDefinitionVersions_DeleteAtManagementGroup") + deleteAtManagementGroup is PolicySetDefinitionVersionOperationGroupOps.DeleteSync< + Extension.ManagementGroup, + PolicySetDefinitionVersion + >; + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set definition in a given management group. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicySetDefinitionVersions_ListByManagementGroup") + listByManagementGroup is PolicySetDefinitionVersionOperationGroupOps.List< + Extension.ManagementGroup, + PolicySetDefinitionVersion, + Parameters = { + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; +} + +@@doc(PolicySetDefinitionVersion.name, + "The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number" +); +@@doc(PolicySetDefinitionVersion.properties, + "The policy set definition version properties." +); +@@doc(PolicySetDefinitionVersions.createOrUpdate::parameters.resource, + "The policy set definition properties." +); +@@doc(PolicySetDefinitionVersionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, + "The policy set definition version properties." +); diff --git a/specification/resources/Authorization.Management/back-compatible.tsp b/specification/resources/Authorization.Management/back-compatible.tsp new file mode 100644 index 000000000000..7f02a2c20e3d --- /dev/null +++ b/specification/resources/Authorization.Management/back-compatible.tsp @@ -0,0 +1,141 @@ +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using Microsoft.Authorization; + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." +@@Legacy.flattenProperty(PolicyAssignmentUpdate.properties); + +@@clientName(PolicyAssignments.create::parameters.resource, "parameters"); +@@clientName(PolicyAssignments.update::parameters.properties, "parameters"); +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." +@@Legacy.flattenProperty(PolicyAssignment.properties); + +@@clientName(PolicyDefinitions.createOrUpdate::parameters.resource, + "parameters" +); +@@clientLocation(PolicyDefinitionOperationGroup.getBuiltIn, PolicyDefinitions); +@@clientLocation(PolicyDefinitionOperationGroup.listBuiltIn, PolicyDefinitions); +@@clientLocation(PolicyDefinitionOperationGroup.getAtManagementGroup, + PolicyDefinitions +); +@@clientLocation(PolicyDefinitionOperationGroup.createOrUpdateAtManagementGroup, + PolicyDefinitions +); +@@clientName(PolicyDefinitionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, + "parameters" +); +@@clientLocation(PolicyDefinitionOperationGroup.deleteAtManagementGroup, + PolicyDefinitions +); +@@clientLocation(PolicyDefinitionOperationGroup.listByManagementGroup, + PolicyDefinitions +); +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." +@@Legacy.flattenProperty(PolicyDefinition.properties); + +@@clientName(PolicyDefinitionVersions.createOrUpdate::parameters.resource, + "parameters" +); +@@clientLocation(PolicyDefinitionVersionOperationGroup.getBuiltIn, + PolicyDefinitionVersions +); +@@clientLocation(PolicyDefinitionVersionOperationGroup.listBuiltIn, + PolicyDefinitionVersions +); +@@clientLocation(PolicyDefinitionVersionOperationGroup.getAtManagementGroup, + PolicyDefinitionVersions +); +@@clientLocation(PolicyDefinitionVersionOperationGroup.createOrUpdateAtManagementGroup, + PolicyDefinitionVersions +); +@@clientName(PolicyDefinitionVersionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, + "parameters" +); +@@clientLocation(PolicyDefinitionVersionOperationGroup.deleteAtManagementGroup, + PolicyDefinitionVersions +); +@@clientLocation(PolicyDefinitionVersionOperationGroup.listByManagementGroup, + PolicyDefinitionVersions +); +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." +@@Legacy.flattenProperty(PolicyDefinitionVersion.properties); + +@@clientName(PolicySetDefinitions.createOrUpdate::parameters.resource, + "parameters" +); +@@clientLocation(PolicySetDefinitionOperationGroup.getBuiltIn, + PolicySetDefinitions +); +@@clientLocation(PolicySetDefinitionOperationGroup.listBuiltIn, + PolicySetDefinitions +); +@@clientLocation(PolicySetDefinitionOperationGroup.getAtManagementGroup, + PolicySetDefinitions +); +@@clientLocation(PolicySetDefinitionOperationGroup.createOrUpdateAtManagementGroup, + PolicySetDefinitions +); +@@clientName(PolicySetDefinitionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, + "parameters" +); +@@clientLocation(PolicySetDefinitionOperationGroup.deleteAtManagementGroup, + PolicySetDefinitions +); +@@clientLocation(PolicySetDefinitionOperationGroup.listByManagementGroup, + PolicySetDefinitions +); +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." +@@Legacy.flattenProperty(PolicySetDefinition.properties); + +@@clientName(PolicySetDefinitionVersions.createOrUpdate::parameters.resource, + "parameters" +); +@@clientLocation(PolicySetDefinitionVersionOperationGroup.getBuiltIn, + PolicySetDefinitionVersions +); +@@clientLocation(PolicySetDefinitionVersionOperationGroup.listBuiltIn, + PolicySetDefinitionVersions +); +@@clientLocation(PolicySetDefinitionVersionOperationGroup.getAtManagementGroup, + PolicySetDefinitionVersions +); +@@clientLocation(PolicySetDefinitionVersionOperationGroup.createOrUpdateAtManagementGroup, + PolicySetDefinitionVersions +); +@@clientName(PolicySetDefinitionVersionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, + "parameters" +); +@@clientLocation(PolicySetDefinitionVersionOperationGroup.deleteAtManagementGroup, + PolicySetDefinitionVersions +); +@@clientLocation(PolicySetDefinitionVersionOperationGroup.listByManagementGroup, + PolicySetDefinitionVersions +); +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." +@@Legacy.flattenProperty(PolicySetDefinitionVersion.properties); + +@@clientLocation(PolicyDefinitionVersionsOperationGroup.listAllBuiltins, + PolicyDefinitionVersions +); +@@clientLocation(PolicyDefinitionVersionsOperationGroup.listAllAtManagementGroup, + PolicyDefinitionVersions +); +@@clientLocation(PolicyDefinitionVersionsOperationGroup.listAll, + PolicyDefinitionVersions +); + +@@clientLocation(PolicySetDefinitionVersionsOperationGroup.listAllBuiltins, + PolicySetDefinitionVersions +); +@@clientLocation(PolicySetDefinitionVersionsOperationGroup.listAllAtManagementGroup, + PolicySetDefinitionVersions +); +@@clientLocation(PolicySetDefinitionVersionsOperationGroup.listAll, + PolicySetDefinitionVersions +); + +@@clientLocation(PolicyTokensOperationGroup.acquire, "PolicyTokens"); +@@clientLocation(PolicyTokensOperationGroup.acquireAtManagementGroup, + "PolicyTokens" +); diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyToken.json b/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyToken.json new file mode 100644 index 000000000000..55224011df71 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyToken.json @@ -0,0 +1,64 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "operation": { + "httpMethod": "delete", + "uri": "https://management.azure.com/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM?api-version=2024-01-01" + } + }, + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "expiration": "2025-01-01T21:30:00.00Z", + "result": "Succeeded", + "results": [ + { + "claims": { + "date": "2025-01-01T19:30:00.00Z", + "double": 0.99, + "int": 2, + "isValid": false, + "string": "testString", + "testArray": [ + "Apple", + "Banana", + "Cherry" + ], + "testObject": { + "name": "Complex Object", + "id": 12345, + "details": { + "createdBy": "John Doe", + "createdDate": "2024-12-13T12:00:00Z", + "metadata": { + "isActive": true, + "tags": [ + "example", + "test", + "object" + ], + "version": "1.0.0" + } + } + } + }, + "expiration": "2025-01-01T21:30:00.00Z", + "message": "Coin flip successful (success probability: '1').", + "policyInfo": { + "policyAssignmentId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/3f2def86", + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/5ed64d02" + }, + "result": "Succeeded" + } + ], + "token": "PoP 7zmVse52pjMKPQd5m2uiNjz5UV2pZ.LPGtRiTeuCDBomEVbzj9kIaL9odEmlNv4D9VzyrQLTAyv4HHnUR7oNytWnL.AQrZ5bSGAQZzr8eySqvugzrD-ceRVL311SL3Nn6f-4c9kgPgU_u1ArXQKW25QCxMlsAuWmaE", + "tokenId": "0da8a969-c660-4de0-a6a4-b2034d4325e4" + } + } + }, + "operationId": "PolicyTokens_Acquire", + "title": "Acquire a policy token" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyTokenAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyTokenAtManagementGroup.json new file mode 100644 index 000000000000..10bf0ebdddac --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyTokenAtManagementGroup.json @@ -0,0 +1,64 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup", + "parameters": { + "operation": { + "httpMethod": "delete", + "uri": "https://management.azure.com/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/roleAssignments/00000000-0000-0000-0000-000000000000?api-version=2022-04-01" + } + } + }, + "responses": { + "200": { + "body": { + "expiration": "2025-01-01T21:30:00.00Z", + "result": "Succeeded", + "results": [ + { + "claims": { + "date": "2025-01-01T19:30:00.00Z", + "double": 0.99, + "int": 2, + "isValid": false, + "string": "testString", + "testArray": [ + "Apple", + "Banana", + "Cherry" + ], + "testObject": { + "name": "Complex Object", + "id": 12345, + "details": { + "createdBy": "John Doe", + "createdDate": "2024-12-13T12:00:00Z", + "metadata": { + "isActive": true, + "tags": [ + "example", + "test", + "object" + ], + "version": "1.0.0" + } + } + } + }, + "expiration": "2025-01-01T21:30:00.00Z", + "message": "Coin flip successful (success probability: '1').", + "policyInfo": { + "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/3f2def86", + "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/5ed64d02" + }, + "result": "Succeeded" + } + ], + "token": "PoP 7zmVse52pjMKPQd5m2uiNjz5UV2pZ.LPGtRiTeuCDBomEVbzj9kIaL9odEmlNv4D9VzyrQLTAyv4HHnUR7oNytWnL.AQrZ5bSGAQZzr8eySqvugzrD-ceRVL311SL3Nn6f-4c9kgPgU_u1ArXQKW25QCxMlsAuWmaE", + "tokenId": "0da8a969-c660-4de0-a6a4-b2034d4325e4" + } + } + }, + "operationId": "PolicyTokens_AcquireAtManagementGroup", + "title": "Acquire a policy token at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinition.json new file mode 100644 index 000000000000..26f7da793872 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinition.json @@ -0,0 +1,97 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'", + "displayName": "Enforce resource naming convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + } + } + }, + "policyDefinitionName": "ResourceNaming", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "201": { + "body": { + "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitions_CreateOrUpdate", + "title": "Create or update a policy definition" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAdvancedParams.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAdvancedParams.json new file mode 100644 index 000000000000..f9239d2b5b43 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAdvancedParams.json @@ -0,0 +1,124 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "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", + "displayName": "Event Hubs should have diagnostic logging enabled", + "metadata": { + "category": "Event Hub" + }, + "mode": "Indexed", + "parameters": { + "requiredRetentionDays": { + "type": "Integer", + "allowedValues": [ + 0, + 30, + 90, + 180, + 365 + ], + "defaultValue": 365, + "metadata": { + "description": "The required diagnostic logs retention in days", + "displayName": "Required retention (days)" + } + } + }, + "policyRule": { + "if": { + "equals": "Microsoft.EventHub/namespaces", + "field": "type" + }, + "then": { + "effect": "AuditIfNotExists", + "details": { + "type": "Microsoft.Insights/diagnosticSettings", + "existenceCondition": { + "allOf": [ + { + "equals": "true", + "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled" + }, + { + "equals": "[parameters('requiredRetentionDays')]", + "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days" + } + ] + } + } + } + } + } + }, + "policyDefinitionName": "EventHubDiagnosticLogs", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "201": { + "body": { + "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "properties": { + "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", + "displayName": "Event Hubs should have diagnostic logging enabled", + "metadata": { + "category": "Event Hub" + }, + "mode": "Indexed", + "parameters": { + "requiredRetentionDays": { + "type": "Integer", + "allowedValues": [ + 0, + 30, + 90, + 180, + 365 + ], + "defaultValue": 365, + "metadata": { + "description": "The required diagnostic logs retention in days", + "displayName": "Required retention (days)" + } + } + }, + "policyRule": { + "if": { + "equals": "Microsoft.EventHub/namespaces", + "field": "type" + }, + "then": { + "effect": "AuditIfNotExists", + "details": { + "type": "Microsoft.Insights/diagnosticSettings", + "existenceCondition": { + "allOf": [ + { + "equals": "true", + "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled" + }, + { + "equals": "[parameters('requiredRetentionDays')]", + "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days" + } + ] + } + } + } + }, + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitions_CreateOrUpdate", + "title": "Create or update a policy definition with advanced parameters" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAtManagementGroup.json new file mode 100644 index 000000000000..26792ec19424 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAtManagementGroup.json @@ -0,0 +1,97 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup", + "parameters": { + "properties": { + "description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'", + "displayName": "Enforce resource naming convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + } + } + }, + "policyDefinitionName": "ResourceNaming" + }, + "responses": { + "201": { + "body": { + "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitions_CreateOrUpdateAtManagementGroup", + "title": "Create or update a policy definition at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json new file mode 100644 index 000000000000..27b5e3fe17f2 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json @@ -0,0 +1,109 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "description": "Randomly disable VM allocation in eastus by having policy rule reference the outcome of invoking an external endpoint using the CoinFlip endpoint that returns random values.", + "displayName": "Randomize VM Allocation", + "externalEvaluationEnforcementSettings": { + "endpointSettings": { + "kind": "CoinFlip", + "details": { + "successProbability": 0.5 + } + }, + "missingTokenAction": "audit", + "roleDefinitionIds": [ + "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/roleDefinitions/f0cc2aea-b517-48f6-8f9e-0c01c687907b" + ] + }, + "metadata": { + "category": "VM" + }, + "mode": "Indexed", + "policyRule": { + "if": { + "allOf": [ + { + "equals": "Microsoft.Compute/virtualMachines", + "field": "type" + }, + { + "equals": "eastus", + "field": "location" + }, + { + "equals": "false", + "value": "[claims().isValid]" + } + ] + }, + "then": { + "effect": "deny" + } + } + } + }, + "policyDefinitionName": "RandomizeVMAllocation", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "201": { + "body": { + "name": "RandomizeVMAllocation", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/RandomizeVMAllocation", + "properties": { + "description": "Randomly disable VM allocation in eastus by having policy rule reference the outcome of invoking an external endpoint using the CoinFlip endpoint that returns random values.", + "displayName": "Randomize VM Allocation", + "externalEvaluationEnforcementSettings": { + "endpointSettings": { + "kind": "CoinFlip", + "details": { + "successProbability": 0.5 + } + }, + "missingTokenAction": "audit", + "roleDefinitionIds": [ + "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/roleDefinitions/f0cc2aea-b517-48f6-8f9e-0c01c687907b" + ] + }, + "metadata": { + "category": "VM" + }, + "mode": "Indexed", + "policyRule": { + "if": { + "allOf": [ + { + "equals": "Microsoft.Compute/virtualMachines", + "field": "type" + }, + { + "equals": "eastus", + "field": "location" + }, + { + "equals": "false", + "value": "[claims().isValid]" + } + ] + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitions_CreateOrUpdate", + "title": "Create or update a policy definition with external evaluation enforcement settings" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersion.json new file mode 100644 index 000000000000..7708577e7050 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersion.json @@ -0,0 +1,140 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'", + "displayName": "Enforce resource naming convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "version": "1.2.1" + } + }, + "policyDefinitionName": "ResourceNaming", + "policyDefinitionVersion": "1.2.1", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + "headers": {} + }, + "201": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_CreateOrUpdate", + "title": "Create or update a policy definition version" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json new file mode 100644 index 000000000000..306d67d647bc --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json @@ -0,0 +1,140 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup", + "parameters": { + "properties": { + "description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'", + "displayName": "Enforce resource naming convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "version": "1.2.1" + } + }, + "policyDefinitionName": "ResourceNaming", + "policyDefinitionVersion": "1.2.1" + }, + "responses": { + "200": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + "headers": {} + }, + "201": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_CreateOrUpdateAtManagementGroup", + "title": "Create or update a policy definition version at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinition.json new file mode 100644 index 000000000000..bffdea526a52 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinition.json @@ -0,0 +1,162 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "parameters": { + "namePrefix": { + "type": "String", + "defaultValue": "myPrefix", + "metadata": { + "displayName": "Prefix to enforce on resource names" + } + } + }, + "policyDefinitions": [ + { + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "parameters": { + "prefix": { + "value": "[parameters('namePrefix')]" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ] + } + }, + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "parameters": { + "namePrefix": { + "type": "String", + "defaultValue": "myPrefix", + "metadata": { + "displayName": "Prefix to enforce on resource names" + } + } + }, + "policyDefinitions": [ + { + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "parameters": { + "prefix": { + "value": "[parameters('namePrefix')]" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ] + } + }, + "headers": {} + }, + "201": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "parameters": { + "namePrefix": { + "type": "String", + "defaultValue": "myPrefix", + "metadata": { + "displayName": "Prefix to enforce on resource names" + } + } + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "[parameters('namePrefix')]" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitions_CreateOrUpdate", + "title": "Create or update a policy set definition" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionAtManagementGroup.json new file mode 100644 index 000000000000..5ff8fbff589c --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionAtManagementGroup.json @@ -0,0 +1,137 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup", + "parameters": { + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ] + } + }, + "policySetDefinitionName": "CostManagement" + }, + "responses": { + "200": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ] + } + }, + "headers": {} + }, + "201": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitions_CreateOrUpdateAtManagementGroup", + "title": "Create or update a policy set definition at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersion.json new file mode 100644 index 000000000000..bf70d659dd85 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersion.json @@ -0,0 +1,163 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "parameters": { + "namePrefix": { + "type": "String", + "defaultValue": "myPrefix", + "metadata": { + "displayName": "Prefix to enforce on resource names" + } + } + }, + "policyDefinitions": [ + { + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "parameters": { + "prefix": { + "value": "[parameters('namePrefix')]" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1" + } + }, + "policyDefinitionVersion": "1.2.1", + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "parameters": { + "namePrefix": { + "type": "String", + "defaultValue": "myPrefix", + "metadata": { + "displayName": "Prefix to enforce on resource names" + } + } + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "[parameters('namePrefix')]" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1" + } + }, + "headers": {} + }, + "201": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "parameters": { + "namePrefix": { + "type": "String", + "defaultValue": "myPrefix", + "metadata": { + "displayName": "Prefix to enforce on resource names" + } + } + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "[parameters('namePrefix')]" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1" + } + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_CreateOrUpdate", + "title": "Create or update a policy set definition version" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json new file mode 100644 index 000000000000..7d6a17966ac7 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json @@ -0,0 +1,135 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup", + "parameters": { + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1" + } + }, + "policyDefinitionVersion": "1.2.1", + "policySetDefinitionName": "CostManagement" + }, + "responses": { + "200": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ] + } + }, + "headers": {} + }, + "201": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1" + } + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_CreateOrUpdateAtManagementGroup", + "title": "Create or update a policy set definition version at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroups.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroups.json new file mode 100644 index 000000000000..2c7c7c47f274 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroups.json @@ -0,0 +1,198 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" + }, + { + "name": "Organizational", + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" + } + ], + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ] + } + }, + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" + }, + { + "name": "Organizational", + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" + } + ], + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + }, + "201": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" + }, + { + "name": "Organizational", + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" + } + ], + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitions_CreateOrUpdate", + "title": "Create or update a policy set definition with groups" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json new file mode 100644 index 000000000000..983d0406a78f --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json @@ -0,0 +1,196 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup", + "parameters": { + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" + }, + { + "name": "Organizational", + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" + } + ], + "policyDefinitions": [ + { + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ] + } + }, + "policySetDefinitionName": "CostManagement" + }, + "responses": { + "200": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" + }, + { + "name": "Organizational", + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" + } + ], + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + }, + "201": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" + }, + { + "name": "Organizational", + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" + } + ], + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitions_CreateOrUpdateAtManagementGroup", + "title": "Create or update a policy set definition with groups at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignment.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignment.json new file mode 100644 index 000000000000..243abed228a3 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignment.json @@ -0,0 +1,68 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "displayName": "Enforce resource naming rules", + "metadata": { + "assignedBy": "Special Someone" + }, + "nonComplianceMessages": [ + { + "message": "Resource names must start with 'DeptA' and end with '-LC'." + } + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming" + } + }, + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "201": { + "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", + "metadata": { + "assignedBy": "Special Someone" + }, + "nonComplianceMessages": [ + { + "message": "Resource names must start with 'DeptA' and end with '-LC'." + } + ], + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentNonComplianceMessages.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentNonComplianceMessages.json new file mode 100644 index 000000000000..c0e43c884d36 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentNonComplianceMessages.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "displayName": "Enforce security policies", + "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" + } + ], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/securityInitiative" + } + }, + "policyAssignmentName": "securityInitAssignment", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "201": { + "body": { + "name": "securityInitAssignment", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/securityInitAssignment", + "properties": { + "definitionVersion": "1.*.*", + "displayName": "Enforce security policies", + "enforcementMode": "Default", + "instanceId": "b7e0f8a9-1c2d-4e3f-8b4c-5d6e7f8a9b0c", + "metadata": { + "assignedBy": "User 1" + }, + "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" + } + ], + "notScopes": [], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/securityInitiative", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment with multiple non-compliance messages" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithEnrollEnforcement.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithEnrollEnforcement.json new file mode 100644 index 000000000000..ccd3fbe569f0 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithEnrollEnforcement.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Enroll", + "metadata": { + "assignedBy": "Special Someone" + }, + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming" + } + }, + "policyAssignmentName": "EnforceNamingEnroll", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "201": { + "body": { + "name": "EnforceNamingEnroll", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNamingEnroll", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Enroll", + "instanceId": "f2b3c4d5-e6f7-8a9b-0c1d-2e3f4a5b6c7d", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment to enforce policy effect only on enrolled resources during resource creation or update." +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithIdentity.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithIdentity.json new file mode 100644 index 000000000000..70d3cdf3bd99 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithIdentity.json @@ -0,0 +1,69 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "identity": { + "type": "SystemAssigned" + }, + "location": "eastus", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "metadata": { + "assignedBy": "Foo Bar" + }, + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming" + } + }, + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "201": { + "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "eastus", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment with a system assigned identity" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithOverrides.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithOverrides.json new file mode 100644 index 000000000000..31083b1610f6 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithOverrides.json @@ -0,0 +1,86 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "metadata": { + "assignedBy": "Special Someone" + }, + "overrides": [ + { + "kind": "policyEffect", + "selectors": [ + { + "in": [ + "Limit_Skus", + "Limit_Locations" + ], + "kind": "policyDefinitionReferenceId" + } + ], + "value": "Audit" + }, + { + "kind": "definitionVersion", + "selectors": [ + { + "in": [ + "eastUSEuap", + "centralUSEuap" + ], + "kind": "resourceLocation" + } + ], + "value": "2.*.*" + } + ], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement" + } + }, + "policyAssignmentName": "CostManagement", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "201": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", + "properties": { + "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "enforcementMode": "Default", + "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "overrides": [ + { + "kind": "policyEffect", + "selectors": [ + { + "in": [ + "Limit_Skus", + "Limit_Locations" + ], + "kind": "policyDefinitionReferenceId" + } + ], + "value": "Audit" + } + ], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment with overrides" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithResourceSelectors.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithResourceSelectors.json new file mode 100644 index 000000000000..aeadc8c0a574 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithResourceSelectors.json @@ -0,0 +1,70 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "description": "Limit the resource location and resource SKU", + "displayName": "Limit the resource location and resource SKU", + "metadata": { + "assignedBy": "Special Someone" + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "resourceSelectors": [ + { + "name": "SDPRegions", + "selectors": [ + { + "in": [ + "eastus2euap", + "centraluseuap" + ], + "kind": "resourceLocation" + } + ] + } + ] + } + }, + "policyAssignmentName": "CostManagement", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "201": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", + "properties": { + "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "enforcementMode": "Default", + "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "resourceSelectors": [ + { + "name": "SDPRegions", + "selectors": [ + { + "in": [ + "eastus2euap", + "centraluseuap" + ], + "kind": "resourceLocation" + } + ] + } + ], + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment with resource selectors" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithUserAssignedIdentity.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithUserAssignedIdentity.json new file mode 100644 index 000000000000..df3df157eaf0 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithUserAssignedIdentity.json @@ -0,0 +1,76 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {} + } + }, + "location": "eastus", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "metadata": { + "assignedBy": "Foo Bar" + }, + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming" + } + }, + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "201": { + "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": { + "clientId": "4bee2b8a-1bee-47c2-90e9-404241551135", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a" + } + } + }, + "location": "eastus", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment with a user assigned identity" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithoutEnforcement.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithoutEnforcement.json new file mode 100644 index 000000000000..7b9e3835e5ac --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithoutEnforcement.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "displayName": "Enforce resource naming rules", + "enforcementMode": "DoNotEnforce", + "metadata": { + "assignedBy": "Special Someone" + }, + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming" + } + }, + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "201": { + "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "DoNotEnforce", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment without enforcing policy effect during resource creation or update." +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyAssignment.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyAssignment.json new file mode 100644 index 000000000000..0b0aec2eb7e5 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyAssignment.json @@ -0,0 +1,42 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + }, + "204": { + "headers": {} + } + }, + "operationId": "PolicyAssignments_Delete", + "title": "Delete a policy assignment" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinition.json new file mode 100644 index 000000000000..49cdbd81ca7f --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinition.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyDefinitionName": "ResourceNaming", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "headers": {} + }, + "204": { + "headers": {} + } + }, + "operationId": "PolicyDefinitions_Delete", + "title": "Delete a policy definition" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionAtManagementGroup.json new file mode 100644 index 000000000000..a63edec5bb8b --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionAtManagementGroup.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup", + "policyDefinitionName": "ResourceNaming" + }, + "responses": { + "200": { + "headers": {} + }, + "204": { + "headers": {} + } + }, + "operationId": "PolicyDefinitions_DeleteAtManagementGroup", + "title": "Delete a policy definition at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersion.json new file mode 100644 index 000000000000..67bf3397408f --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersion.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyDefinitionName": "ResourceNaming", + "policyDefinitionVersion": "1.2.1", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "headers": {} + }, + "204": { + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_Delete", + "title": "Delete a policy definition version" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersionAtManagementGroup.json new file mode 100644 index 000000000000..d1b603fbee14 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersionAtManagementGroup.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup", + "policyDefinitionName": "ResourceNaming", + "policyDefinitionVersion": "1.2.1" + }, + "responses": { + "200": { + "headers": {} + }, + "204": { + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_DeleteAtManagementGroup", + "title": "Delete a policy definition version at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinition.json new file mode 100644 index 000000000000..915664cd424b --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinition.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "headers": {} + }, + "204": { + "headers": {} + } + }, + "operationId": "PolicySetDefinitions_Delete", + "title": "Delete a policy set definition" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionAtManagementGroup.json new file mode 100644 index 000000000000..0c0ff632e3c1 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionAtManagementGroup.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup", + "policySetDefinitionName": "CostManagement" + }, + "responses": { + "200": { + "headers": {} + }, + "204": { + "headers": {} + } + }, + "operationId": "PolicySetDefinitions_DeleteAtManagementGroup", + "title": "Delete a policy set definition at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersion.json new file mode 100644 index 000000000000..a7bc7c87c14c --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersion.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyDefinitionVersion": "1.2.1", + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "headers": {} + }, + "204": { + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_Delete", + "title": "Delete a policy set definition version" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersionAtManagementGroup.json new file mode 100644 index 000000000000..32de492108ca --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersionAtManagementGroup.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup", + "policyDefinitionVersion": "1.2.1", + "policySetDefinitionName": "CostManagement" + }, + "responses": { + "200": { + "headers": {} + }, + "204": { + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_DeleteAtManagementGroup", + "title": "Delete a policy set definition version at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinition.json new file mode 100644 index 000000000000..1fe221c2b56a --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinition.json @@ -0,0 +1,84 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8" + }, + "responses": { + "200": { + "body": { + "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "properties": { + "description": "Monitor all the available security recommendations in Azure Security Center. This is the default policy for Azure Security Center.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", + "metadata": { + "category": "Security Center" + }, + "parameters": {}, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", + "policyDefinitionReferenceId": "RefId1" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", + "policyDefinitionReferenceId": "RefId2" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", + "policyDefinitionReferenceId": "RefId3" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "policyDefinitionReferenceId": "RefId4" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", + "policyDefinitionReferenceId": "RefId5" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", + "policyDefinitionReferenceId": "RefId6" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionReferenceId": "RefId7" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", + "policyDefinitionReferenceId": "RefId8" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", + "policyDefinitionReferenceId": "RefId9" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", + "policyDefinitionReferenceId": "RefId10" + } + ], + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitions_GetBuiltIn", + "title": "Retrieve a built-in policy set definition" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinitionVersion.json new file mode 100644 index 000000000000..14cec4f95d9a --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinitionVersion.json @@ -0,0 +1,81 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyDefinitionVersion": "1.2.1", + "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8" + }, + "responses": { + "200": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8/versions/1.2.1", + "properties": { + "description": "Monitor all the available security recommendations in Azure Security Center. This is the default policy for Azure Security Center.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", + "metadata": { + "category": "Security Center" + }, + "parameters": {}, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", + "policyDefinitionReferenceId": "RefId1" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", + "policyDefinitionReferenceId": "RefId2" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", + "policyDefinitionReferenceId": "RefId3" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "policyDefinitionReferenceId": "RefId4" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", + "policyDefinitionReferenceId": "RefId5" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", + "policyDefinitionReferenceId": "RefId6" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionReferenceId": "RefId7" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", + "policyDefinitionReferenceId": "RefId8" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", + "policyDefinitionReferenceId": "RefId9" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", + "policyDefinitionReferenceId": "RefId10" + } + ], + "policyType": "BuiltIn", + "version": "1.2.1" + } + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_GetBuiltIn", + "title": "Retrieve a built-in policy set definition version" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinition.json new file mode 100644 index 000000000000..6d9b43953bc1 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinition.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyDefinitionName": "7433c107-6db4-4ad1-b57a-a76dce0154a1", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "properties": { + "description": "This policy enables you to specify a set of storage account SKUs that your organization can deploy.", + "displayName": "Allowed storage account SKUs", + "mode": "All", + "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": [ + { + "equals": "Microsoft.Storage/storageAccounts", + "field": "type" + }, + { + "not": { + "field": "Microsoft.Storage/storageAccounts/sku.name", + "in": "[parameters('listOfAllowedSKUs')]" + } + } + ] + }, + "then": { + "effect": "Deny" + } + }, + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitions_GetBuiltIn", + "title": "Retrieve a built-in policy definition" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinitionVersion.json new file mode 100644 index 000000000000..46698887940e --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinitionVersion.json @@ -0,0 +1,56 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyDefinitionName": "7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionVersion": "1.2.1", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1/versions/1.2.1", + "properties": { + "description": "This policy enables you to specify a set of storage account SKUs that your organization can deploy.", + "displayName": "Allowed storage account SKUs", + "mode": "All", + "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": [ + { + "equals": "Microsoft.Storage/storageAccounts", + "field": "type" + }, + { + "not": { + "field": "Microsoft.Storage/storageAccounts/sku.name", + "in": "[parameters('listOfAllowedSKUs')]" + } + } + ] + }, + "then": { + "effect": "Deny" + } + }, + "policyType": "BuiltIn", + "version": "1.2.1" + } + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_GetBuiltIn", + "title": "Retrieve a built-in policy definition version" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignment.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignment.json new file mode 100644 index 000000000000..5467d8386dbc --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignment.json @@ -0,0 +1,40 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Get", + "title": "Retrieve a policy assignment" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithIdentity.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithIdentity.json new file mode 100644 index 000000000000..48b503c9f581 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithIdentity.json @@ -0,0 +1,46 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "westus", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Get", + "title": "Retrieve a policy assignment with a system assigned identity" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithOverrides.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithOverrides.json new file mode 100644 index 000000000000..3ea5b505f0e7 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithOverrides.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyAssignmentName": "CostManagement", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", + "properties": { + "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "enforcementMode": "Default", + "instanceId": "d2f3a4b5-c6d7-8e9f-0a1b-2c3d4e5f6a7b", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "overrides": [ + { + "kind": "policyEffect", + "selectors": [ + { + "in": [ + "Limit_Skus", + "Limit_Locations" + ], + "kind": "policyDefinitionReferenceId" + } + ], + "value": "Audit" + } + ], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Get", + "title": "Retrieve a policy assignment with overrides" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithResourceSelectors.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithResourceSelectors.json new file mode 100644 index 000000000000..b7e13b371e15 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithResourceSelectors.json @@ -0,0 +1,46 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyAssignmentName": "CostManagement", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", + "properties": { + "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "enforcementMode": "Default", + "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "resourceSelectors": [ + { + "name": "SDPRegions", + "selectors": [ + { + "in": [ + "eastus2euap", + "centraluseuap" + ], + "kind": "resourceLocation" + } + ] + } + ], + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Get", + "title": "Retrieve a policy assignment with resource selectors" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithUserAssignedIdentity.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithUserAssignedIdentity.json new file mode 100644 index 000000000000..74b5f55d479b --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithUserAssignedIdentity.json @@ -0,0 +1,50 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": { + "clientId": "4bee2b8a-1bee-47c2-90e9-404241551135", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a" + } + } + }, + "location": "westus", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Get", + "title": "Retrieve a policy assignment with a user assigned identity" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinition.json new file mode 100644 index 000000000000..4e8ea6fe3cee --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinition.json @@ -0,0 +1,60 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyDefinitionName": "ResourceNaming", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitions_Get", + "title": "Retrieve a policy definition" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionAtManagementGroup.json new file mode 100644 index 000000000000..65dbdd836421 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionAtManagementGroup.json @@ -0,0 +1,60 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup", + "policyDefinitionName": "ResourceNaming" + }, + "responses": { + "200": { + "body": { + "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitions_GetAtManagementGroup", + "title": "Retrieve a policy definition at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersion.json new file mode 100644 index 000000000000..66cda99709b3 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersion.json @@ -0,0 +1,57 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyDefinitionName": "ResourceNaming", + "policyDefinitionVersion": "1.2.1", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_Get", + "title": "Retrieve a policy definition version" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersionAtManagementGroup.json new file mode 100644 index 000000000000..4c16dccfc26b --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersionAtManagementGroup.json @@ -0,0 +1,57 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup", + "policyDefinitionName": "ResourceNaming", + "policyDefinitionVersion": "1.2.1" + }, + "responses": { + "200": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_GetAtManagementGroup", + "title": "Retrieve a policy definition version at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinition.json new file mode 100644 index 000000000000..8db62a1c57fb --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinition.json @@ -0,0 +1,77 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" + }, + { + "name": "Organizational", + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" + } + ], + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitions_Get", + "title": "Retrieve a policy set definition" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionAtManagementGroup.json new file mode 100644 index 000000000000..4f9ab846cb46 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionAtManagementGroup.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup", + "policySetDefinitionName": "CostManagement" + }, + "responses": { + "200": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitions_GetAtManagementGroup", + "title": "Retrieve a policy set definition at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersion.json new file mode 100644 index 000000000000..d9272fd34cc1 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersion.json @@ -0,0 +1,74 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyDefinitionVersion": "1.2.1", + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitionGroups": [ + { + "name": "CostSaving", + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" + }, + { + "name": "Organizational", + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" + } + ], + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "groupNames": [ + "CostSaving" + ], + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "groupNames": [ + "Organizational" + ], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1" + } + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_Get", + "title": "Retrieve a policy set definition version" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersionAtManagementGroup.json new file mode 100644 index 000000000000..826f0432d400 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersionAtManagementGroup.json @@ -0,0 +1,56 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup", + "policyDefinitionVersion": "1.2.1", + "policySetDefinitionName": "CostManagement" + }, + "responses": { + "200": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1" + } + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_GetAtManagementGroup", + "title": "Retrieve a policy set definition version at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicyDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicyDefinitionVersions.json new file mode 100644 index 000000000000..bebb17de9e83 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicyDefinitionVersions.json @@ -0,0 +1,107 @@ +{ + "parameters": { + "api-version": "2025-03-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.2.1", + "properties": { + "description": "Audit DB level audit setting for SQL databases", + "displayName": "Audit SQL DB Level Audit Setting", + "mode": "All", + "parameters": { + "setting": { + "type": "String", + "allowedValues": [ + "enabled", + "disabled" + ], + "metadata": { + "displayName": "Audit Setting" + } + } + }, + "policyRule": { + "if": { + "equals": "Microsoft.Sql/servers/databases", + "field": "type" + }, + "then": { + "effect": "AuditIfNotExists", + "details": { + "name": "default", + "type": "Microsoft.Sql/servers/databases/auditingSettings", + "existenceCondition": { + "allOf": [ + { + "equals": "[parameters('setting')]", + "field": "Microsoft.Sql/auditingSettings.state" + } + ] + } + } + } + }, + "policyType": "BuiltIn", + "version": "1.2.1" + } + }, + { + "name": "1.0.0", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.0.0", + "properties": { + "description": "Audit DB level audit setting for SQL databases", + "displayName": "Audit SQL DB Level Audit Setting", + "mode": "All", + "parameters": { + "setting": { + "type": "String", + "allowedValues": [ + "enabled", + "disabled", + "default" + ], + "metadata": { + "displayName": "Audit Setting" + } + } + }, + "policyRule": { + "if": { + "equals": "Microsoft.Sql/servers/databases", + "field": "type" + }, + "then": { + "effect": "AuditIfNotExists", + "details": { + "name": "default", + "type": "Microsoft.Sql/servers/databases/auditingSettings", + "existenceCondition": { + "allOf": [ + { + "equals": "[parameters('setting')]", + "field": "Microsoft.Sql/auditingSettings.state" + } + ] + } + } + } + }, + "policyType": "BuiltIn", + "version": "1.0.0" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_ListAllBuiltins", + "title": "List all built-in policy definition versions" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicySetDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicySetDefinitionVersions.json new file mode 100644 index 000000000000..fbf0d29d94d9 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicySetDefinitionVersions.json @@ -0,0 +1,83 @@ +{ + "parameters": { + "api-version": "2025-03-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8/versions/1.2.1", + "properties": { + "description": "Monitor all the available security recommendations in Azure Security Center. This is the default policy for Azure Security Center.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", + "metadata": { + "category": "Security Center" + }, + "parameters": {}, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", + "policyDefinitionReferenceId": "RefId1" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", + "policyDefinitionReferenceId": "RefId2" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", + "policyDefinitionReferenceId": "RefId3" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "policyDefinitionReferenceId": "RefId4" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", + "policyDefinitionReferenceId": "RefId5" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", + "policyDefinitionReferenceId": "RefId6" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionReferenceId": "RefId7" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", + "policyDefinitionReferenceId": "RefId8" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", + "policyDefinitionReferenceId": "RefId9" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", + "policyDefinitionReferenceId": "RefId10" + } + ], + "policyType": "BuiltIn", + "version": "1.2.1" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_ListAllBuiltins", + "title": "List all built-in policy definition versions" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersions.json new file mode 100644 index 000000000000..67bfe118798d --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersions.json @@ -0,0 +1,101 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + { + "name": "1.0.0", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/versions/1.0.0", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '-*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.0.0" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_ListAll", + "title": "List all policy definition versions at subscription" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersionsByManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersionsByManagementGroup.json new file mode 100644 index 000000000000..45169dc442e6 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersionsByManagementGroup.json @@ -0,0 +1,101 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + { + "name": "1.0.0", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.0.0", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '-*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_ListAllAtManagementGroup", + "title": "List all policy definition versions at management group" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersions.json new file mode 100644 index 000000000000..68249cec5ec6 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersions.json @@ -0,0 +1,58 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_ListAll", + "title": "List all policy definition versions at subscription" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersionsByManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersionsByManagementGroup.json new file mode 100644 index 000000000000..2a935fe20fda --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersionsByManagementGroup.json @@ -0,0 +1,125 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8/versoins/1.2.1", + "properties": { + "description": "Monitor all the available security recommendations in Azure Security Center. This is the default policy for Azure Security Center.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", + "metadata": { + "category": "Security Center" + }, + "parameters": {}, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", + "policyDefinitionReferenceId": "RefId1" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", + "policyDefinitionReferenceId": "RefId2" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", + "policyDefinitionReferenceId": "RefId3" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "policyDefinitionReferenceId": "RefId4" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", + "policyDefinitionReferenceId": "RefId5" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", + "policyDefinitionReferenceId": "RefId6" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionReferenceId": "RefId7" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", + "policyDefinitionReferenceId": "RefId8" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", + "policyDefinitionReferenceId": "RefId9" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", + "policyDefinitionReferenceId": "RefId10" + } + ], + "policyType": "BuiltIn", + "version": "1.2.1" + } + }, + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_ListAllAtManagementGroup", + "title": "List all policy definition versions at management group" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitionVersions.json new file mode 100644 index 000000000000..ba43bfd53722 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitionVersions.json @@ -0,0 +1,108 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyDefinitionName": "06a78e20-9358-41c9-923c-fb736d382a12" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.2.1", + "properties": { + "description": "Audit DB level audit setting for SQL databases", + "displayName": "Audit SQL DB Level Audit Setting", + "mode": "All", + "parameters": { + "setting": { + "type": "String", + "allowedValues": [ + "enabled", + "disabled" + ], + "metadata": { + "displayName": "Audit Setting" + } + } + }, + "policyRule": { + "if": { + "equals": "Microsoft.Sql/servers/databases", + "field": "type" + }, + "then": { + "effect": "AuditIfNotExists", + "details": { + "name": "default", + "type": "Microsoft.Sql/servers/databases/auditingSettings", + "existenceCondition": { + "allOf": [ + { + "equals": "[parameters('setting')]", + "field": "Microsoft.Sql/auditingSettings.state" + } + ] + } + } + } + }, + "policyType": "BuiltIn", + "version": "1.2.1" + } + }, + { + "name": "1.0.0", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.0.0", + "properties": { + "description": "Audit DB level audit setting for SQL databases", + "displayName": "Audit SQL DB Level Audit Setting", + "mode": "All", + "parameters": { + "setting": { + "type": "String", + "allowedValues": [ + "enabled", + "disabled", + "default" + ], + "metadata": { + "displayName": "Audit Setting" + } + } + }, + "policyRule": { + "if": { + "equals": "Microsoft.Sql/servers/databases", + "field": "type" + }, + "then": { + "effect": "AuditIfNotExists", + "details": { + "name": "default", + "type": "Microsoft.Sql/servers/databases/auditingSettings", + "existenceCondition": { + "allOf": [ + { + "equals": "[parameters('setting')]", + "field": "Microsoft.Sql/auditingSettings.state" + } + ] + } + } + } + }, + "policyType": "BuiltIn", + "version": "1.0.0" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_ListBuiltIn", + "title": "List built-in policy definition versions" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitions.json new file mode 100644 index 000000000000..7029261063c5 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitions.json @@ -0,0 +1,147 @@ +{ + "parameters": { + "api-version": "2025-03-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "06a78e20-9358-41c9-923c-fb736d382a12", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12", + "properties": { + "description": "Audit DB level audit setting for SQL databases", + "displayName": "Audit SQL DB Level Audit Setting", + "mode": "All", + "parameters": { + "setting": { + "type": "String", + "allowedValues": [ + "enabled", + "disabled" + ], + "metadata": { + "displayName": "Audit Setting" + } + } + }, + "policyRule": { + "if": { + "equals": "Microsoft.Sql/servers/databases", + "field": "type" + }, + "then": { + "effect": "AuditIfNotExists", + "details": { + "name": "default", + "type": "Microsoft.Sql/servers/databases/auditingSettings", + "existenceCondition": { + "allOf": [ + { + "equals": "[parameters('setting')]", + "field": "Microsoft.Sql/auditingSettings.state" + } + ] + } + } + } + }, + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + { + "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "properties": { + "description": "This policy enables you to specify a set of storage account SKUs that your organization can deploy.", + "displayName": "Allowed storage account SKUs", + "mode": "All", + "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": [ + { + "equals": "Microsoft.Storage/storageAccounts", + "field": "type" + }, + { + "not": { + "field": "Microsoft.Storage/storageAccounts/sku.name", + "in": "[parameters('listOfAllowedSKUs')]" + } + } + ] + }, + "then": { + "effect": "Deny" + } + }, + "policyType": "Static", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + { + "name": "abeed54a-73c5-441d-8a8c-6b5e7a0c299e", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/abeed54a-73c5-441d-8a8c-6b5e7a0c299e", + "properties": { + "description": "Audit certificates that are stored in Azure Key Vault, that expire within 'X' number of days.", + "displayName": "Audit KeyVault certificates that expire within specified number of days", + "metadata": { + "category": "KeyVault DataPlane" + }, + "mode": "Microsoft.KeyVault.Data", + "parameters": { + "daysToExpire": { + "type": "Integer", + "metadata": { + "description": "The number of days for a certificate to expire.", + "displayName": "Days to expire" + } + } + }, + "policyRule": { + "if": { + "field": "Microsoft.KeyVault.Data/vaults/certificates/attributes/expiresOn", + "lessOrEquals": "[addDays(utcNow(), parameters('daysToExpire'))]" + }, + "then": { + "effect": "audit" + } + }, + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitions_ListBuiltIn", + "title": "List built-in policy definitions" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitionVersions.json new file mode 100644 index 000000000000..8643aac0aa7b --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitionVersions.json @@ -0,0 +1,84 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8/versions/1.2.1", + "properties": { + "description": "Monitor all the available security recommendations in Azure Security Center. This is the default policy for Azure Security Center.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", + "metadata": { + "category": "Security Center" + }, + "parameters": {}, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", + "policyDefinitionReferenceId": "RefId1" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", + "policyDefinitionReferenceId": "RefId2" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", + "policyDefinitionReferenceId": "RefId3" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "policyDefinitionReferenceId": "RefId4" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", + "policyDefinitionReferenceId": "RefId5" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", + "policyDefinitionReferenceId": "RefId6" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionReferenceId": "RefId7" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", + "policyDefinitionReferenceId": "RefId8" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", + "policyDefinitionReferenceId": "RefId9" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", + "policyDefinitionReferenceId": "RefId10" + } + ], + "policyType": "BuiltIn", + "version": "1.2.1" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_ListBuiltIn", + "title": "List built-in policy set definitions" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitions.json new file mode 100644 index 000000000000..df961fa91ffc --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitions.json @@ -0,0 +1,87 @@ +{ + "parameters": { + "api-version": "2025-03-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "properties": { + "description": "Monitor all the available security recommendations in Azure Security Center. This is the default policy for Azure Security Center.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", + "metadata": { + "category": "Security Center" + }, + "parameters": {}, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", + "policyDefinitionReferenceId": "RefId1" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", + "policyDefinitionReferenceId": "RefId2" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", + "policyDefinitionReferenceId": "RefId3" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "policyDefinitionReferenceId": "RefId4" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", + "policyDefinitionReferenceId": "RefId5" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", + "policyDefinitionReferenceId": "RefId6" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionReferenceId": "RefId7" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", + "policyDefinitionReferenceId": "RefId8" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", + "policyDefinitionReferenceId": "RefId9" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", + "policyDefinitionReferenceId": "RefId10" + } + ], + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitions_ListBuiltIn", + "title": "List built-in policy set definitions" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForResourceGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForResourceGroup.json new file mode 100644 index 000000000000..ee3d8d6c905d --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForResourceGroup.json @@ -0,0 +1,66 @@ +{ + "parameters": { + "$expand": "LatestDefinitionVersion, EffectiveDefinitionVersion", + "$filter": "atScope()", + "api-version": "2025-03-01", + "resourceGroupName": "TestResourceGroup", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "TestCostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup/providers/Microsoft.Authorization/policyAssignments/TestCostManagement", + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "eastus", + "properties": { + "description": "Minimize the risk of accidental cost overruns", + "definitionVersion": "1.*.*", + "displayName": "Storage Cost Management", + "effectiveDefinitionVersion": "1.0.0", + "instanceId": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d", + "latestDefinitionVersion": "1.0.0", + "metadata": { + "category": "Cost Management" + }, + "notScopes": [], + "parameters": { + "allowedSkus": { + "value": "Standard_A1" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/storageSkus", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup" + } + }, + { + "name": "TestTagEnforcement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup/providers/Microsoft.Authorization/policyAssignments/TestTagEnforcement", + "properties": { + "description": "Ensure a given tag key and value are present on all resources", + "definitionVersion": "1.*.*", + "displayName": "Enforces a tag key and value", + "effectiveDefinitionVersion": "1.0.0", + "instanceId": "f0b1c2d3-e4f5-6a7b-8c9d-0e1f2a3b4c5d", + "latestDefinitionVersion": "1.0.0", + "notScopes": [], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/TagKeyValue", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_ListForResourceGroup", + "title": "List policy assignments that apply to a resource group" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersions.json new file mode 100644 index 000000000000..b8612332966e --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersions.json @@ -0,0 +1,102 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policyDefinitionName": "ResourceNaming", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + { + "name": "1.0.0", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/versions/1.0.0", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '-*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.0.0" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_List", + "title": "List policy definition versions by subscription" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersionsByManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersionsByManagementGroup.json new file mode 100644 index 000000000000..7daf7235b616 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersionsByManagementGroup.json @@ -0,0 +1,102 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup", + "policyDefinitionName": "ResourceNaming" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + { + "name": "1.0.0", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.0.0", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '-*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitionVersions_ListByManagementGroup", + "title": "List policy definition versions by management group" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitions.json new file mode 100644 index 000000000000..67e7da322dc2 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitions.json @@ -0,0 +1,145 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "properties": { + "description": "This policy enables you to specify a set of storage account SKUs that your organization can deploy.", + "displayName": "Allowed storage account SKUs", + "mode": "All", + "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": [ + { + "equals": "Microsoft.Storage/storageAccounts", + "field": "type" + }, + { + "not": { + "field": "Microsoft.Storage/storageAccounts/sku.name", + "in": "[parameters('listOfAllowedSKUs')]" + } + } + ] + }, + "then": { + "effect": "Deny" + } + }, + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + { + "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + { + "name": "AuditSoonToExpireCerts", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/AuditSoonToExpireCerts", + "properties": { + "description": "Audit certificates that are stored in Azure Key Vault, that expire within 'X' number of days.", + "displayName": "Audit KeyVault certificates that expire within specified number of days", + "metadata": { + "category": "KeyVault DataPlane" + }, + "mode": "Microsoft.KeyVault.Data", + "parameters": { + "daysToExpire": { + "type": "Integer", + "metadata": { + "description": "The number of days for a certificate to expire.", + "displayName": "Days to expire" + } + } + }, + "policyRule": { + "if": { + "field": "Microsoft.KeyVault.Data/vaults/certificates/attributes/expiresOn", + "lessOrEquals": "[addDays(utcNow(), parameters('daysToExpire'))]" + }, + "then": { + "effect": "audit" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitions_List", + "title": "List policy definitions by subscription" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionsByManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionsByManagementGroup.json new file mode 100644 index 000000000000..73f65687c6b9 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionsByManagementGroup.json @@ -0,0 +1,108 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "properties": { + "description": "This policy enables you to specify a set of storage account SKUs that your organization can deploy.", + "displayName": "Allowed storage account SKUs", + "mode": "All", + "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": [ + { + "equals": "Microsoft.Storage/storageAccounts", + "field": "type" + }, + { + "not": { + "field": "Microsoft.Storage/storageAccounts/sku.name", + "in": "[parameters('listOfAllowedSKUs')]" + } + } + ] + }, + "then": { + "effect": "Deny" + } + }, + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + { + "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", + "parameters": { + "prefix": { + "type": "String", + "metadata": { + "description": "Resource name prefix", + "displayName": "Prefix" + } + }, + "suffix": { + "type": "String", + "metadata": { + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicyDefinitions_ListByManagementGroup", + "title": "List policy definitions by management group" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersions.json new file mode 100644 index 000000000000..0deb73fda9e4 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersions.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_List", + "title": "List policy set definitions" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersionsByManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersionsByManagementGroup.json new file mode 100644 index 000000000000..9d488bb3c3e0 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersionsByManagementGroup.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup", + "policySetDefinitionName": "CostManagement" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1" + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitionVersions_ListByManagementGroup", + "title": "List policy set definitions at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitions.json new file mode 100644 index 000000000000..0915005995f6 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitions.json @@ -0,0 +1,133 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "properties": { + "description": "Monitor all the available security recommendations in Azure Security Center. This is the default policy for Azure Security Center.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", + "metadata": { + "category": "Security Center" + }, + "parameters": {}, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", + "policyDefinitionReferenceId": "RefId1" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", + "policyDefinitionReferenceId": "RefId2" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", + "policyDefinitionReferenceId": "RefId3" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "policyDefinitionReferenceId": "RefId4" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", + "policyDefinitionReferenceId": "RefId5" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", + "policyDefinitionReferenceId": "RefId6" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionReferenceId": "RefId7" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", + "policyDefinitionReferenceId": "RefId8" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", + "policyDefinitionReferenceId": "RefId9" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", + "policyDefinitionReferenceId": "RefId10" + } + ], + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitions_List", + "title": "List policy set definitions" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionsByManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionsByManagementGroup.json new file mode 100644 index 000000000000..a79ea0839ca4 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionsByManagementGroup.json @@ -0,0 +1,131 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "properties": { + "description": "Monitor all the available security recommendations in Azure Security Center. This is the default policy for Azure Security Center.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", + "metadata": { + "category": "Security Center" + }, + "parameters": {}, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", + "policyDefinitionReferenceId": "RefId1" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", + "policyDefinitionReferenceId": "RefId2" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", + "policyDefinitionReferenceId": "RefId3" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "policyDefinitionReferenceId": "RefId4" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", + "policyDefinitionReferenceId": "RefId5" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", + "policyDefinitionReferenceId": "RefId6" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionReferenceId": "RefId7" + }, + { + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", + "policyDefinitionReferenceId": "RefId8" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", + "policyDefinitionReferenceId": "RefId9" + }, + { + "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", + "policyDefinitionReferenceId": "RefId10" + } + ], + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + { + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "properties": { + "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", + "metadata": { + "category": "Cost Management" + }, + "policyDefinitions": [ + { + "definitionVersion": "1.*.*", + "parameters": { + "listOfAllowedSKUs": { + "value": [ + "Standard_GRS", + "Standard_LRS" + ] + } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" + }, + { + "definitionVersion": "1.*.*", + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" + } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + } + ] + }, + "headers": {} + } + }, + "operationId": "PolicySetDefinitions_ListByManagementGroup", + "title": "List policy set definitions at management group level" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithIdentity.json b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithIdentity.json new file mode 100644 index 000000000000..2806e9f52481 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithIdentity.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "identity": { + "type": "SystemAssigned" + }, + "location": "eastus" + }, + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "eastus", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Update", + "title": "Update a policy assignment with a system assigned identity" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithOverrides.json b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithOverrides.json new file mode 100644 index 000000000000..7964dc6d36d0 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithOverrides.json @@ -0,0 +1,66 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "overrides": [ + { + "kind": "policyEffect", + "selectors": [ + { + "in": [ + "Limit_Skus", + "Limit_Locations" + ], + "kind": "policyDefinitionReferenceId" + } + ], + "value": "Audit" + } + ] + } + }, + "policyAssignmentName": "CostManagement", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", + "properties": { + "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "enforcementMode": "Default", + "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "overrides": [ + { + "kind": "policyEffect", + "selectors": [ + { + "in": [ + "Limit_Skus", + "Limit_Locations" + ], + "kind": "policyDefinitionReferenceId" + } + ], + "value": "Audit" + } + ], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Update", + "title": "Update a policy assignment with overrides" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithResourceSelectors.json b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithResourceSelectors.json new file mode 100644 index 000000000000..8a3752cbe1c0 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithResourceSelectors.json @@ -0,0 +1,64 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "properties": { + "resourceSelectors": [ + { + "name": "SDPRegions", + "selectors": [ + { + "in": [ + "eastus2euap", + "centraluseuap" + ], + "kind": "resourceLocation" + } + ] + } + ] + } + }, + "policyAssignmentName": "CostManagement", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", + "properties": { + "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "enforcementMode": "Default", + "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "resourceSelectors": [ + { + "name": "SDPRegions", + "selectors": [ + { + "in": [ + "eastus2euap", + "centraluseuap" + ], + "kind": "resourceLocation" + } + ] + } + ], + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Update", + "title": "Update a policy assignment with resource selectors" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithUserAssignedIdentity.json b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithUserAssignedIdentity.json new file mode 100644 index 000000000000..108c030bbe76 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithUserAssignedIdentity.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "api-version": "2025-03-01", + "parameters": { + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {} + } + }, + "location": "eastus" + }, + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + }, + "responses": { + "200": { + "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": { + "clientId": "4bee2b8a-1bee-47c2-90e9-404241551135", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a" + } + } + }, + "location": "eastus", + "properties": { + "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", + "metadata": { + "assignedBy": "Special Someone" + }, + "notScopes": [], + "parameters": { + "prefix": { + "value": "DeptA" + }, + "suffix": { + "value": "-LC" + } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} + } + }, + "operationId": "PolicyAssignments_Update", + "title": "Update a policy assignment with a user assigned identity" +} \ No newline at end of file diff --git a/specification/resources/Authorization.Management/main.tsp b/specification/resources/Authorization.Management/main.tsp new file mode 100644 index 000000000000..cf5bf3cd116d --- /dev/null +++ b/specification/resources/Authorization.Management/main.tsp @@ -0,0 +1,46 @@ +/** + * PLEASE DO NOT REMOVE - USED FOR CONVERTER METRICS + * Generated by package: @autorest/openapi-to-typespec + * Parameters used: + * isFullCompatible: true + * guessResourceKey: false + * Version: 0.11.12 + * Date: 2025-10-27T02:40:16.533Z + */ +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "./models.tsp"; +import "./back-compatible.tsp"; +import "./PolicyAssignment.tsp"; +import "./PolicyDefinition.tsp"; +import "./PolicyDefinitionVersion.tsp"; +import "./PolicySetDefinition.tsp"; +import "./PolicySetDefinitionVersion.tsp"; +import "./routes.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager.Foundations; +using Azure.Core; +using Azure.ResourceManager; +using TypeSpec.Versioning; +/** + * To manage and control access to your resources, you can define customized policies and assign them at a scope. + */ +@armProviderNamespace +@service(#{ title: "PolicyClient" }) +@versioned(Versions) +@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) +namespace Microsoft.Authorization; + +/** + * The available API versions. + */ +enum Versions { + /** + * The 2025-03-01 API version. + */ + v2025_03_01: "2025-03-01", +} diff --git a/specification/resources/Authorization.Management/models.tsp b/specification/resources/Authorization.Management/models.tsp new file mode 100644 index 000000000000..664cdadc156a --- /dev/null +++ b/specification/resources/Authorization.Management/models.tsp @@ -0,0 +1,1122 @@ +import "@typespec/rest"; +import "@typespec/http"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; + +namespace Microsoft.Authorization; + +/** + * The policy assignment enforcement mode. Possible values are Default, DoNotEnforce, and Enroll + */ +union EnforcementMode { + string, + + /** + * The policy effect is enforced during resource creation or update. + */ + Default: "Default", + + /** + * The policy effect is not enforced during resource creation or update. + */ + DoNotEnforce: "DoNotEnforce", + + /** + * The policy effect is not enforced during resource creation or update until the resource or scope of the resource is enrolled to the assignment instance. Enrollment occurs upon deployment of the policy enrollment resource. + */ + Enroll: "Enroll", +} + +/** + * The selector kind. + */ +union SelectorKind { + string, + + /** + * The selector kind to filter policies by the resource location. + */ + resourceLocation: "resourceLocation", + + /** + * The selector kind to filter policies by the resource type. + */ + resourceType: "resourceType", + + /** + * The selector kind to filter policies by the resource without location. + */ + resourceWithoutLocation: "resourceWithoutLocation", + + /** + * The selector kind to filter policies by the policy definition reference ID. + */ + policyDefinitionReferenceId: "policyDefinitionReferenceId", +} + +/** + * The override kind. + */ +union OverrideKind { + string, + + /** + * It will override the policy effect type. + */ + policyEffect: "policyEffect", + + /** + * It will override the definition version property value of the policy assignment. + */ + definitionVersion: "definitionVersion", +} + +/** + * The type of policy assignment. Possible values are NotSpecified, System, SystemHidden, and Custom. Immutable. + */ +union AssignmentType { + string, + + /** + * NotSpecified + */ + NotSpecified: "NotSpecified", + + /** + * System + */ + System: "System", + + /** + * SystemHidden + */ + SystemHidden: "SystemHidden", + + /** + * Custom + */ + Custom: "Custom", +} + +/** + * The type of identity that created the resource. + */ +union CreatedByType { + string, + + /** + * User + */ + User: "User", + + /** + * Application + */ + Application: "Application", + + /** + * ManagedIdentity + */ + ManagedIdentity: "ManagedIdentity", + + /** + * Key + */ + Key: "Key", +} + +/** + * The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. + */ +union PolicyType { + string, + + /** + * NotSpecified + */ + NotSpecified: "NotSpecified", + + /** + * BuiltIn + */ + BuiltIn: "BuiltIn", + + /** + * Custom + */ + Custom: "Custom", + + /** + * Static + */ + Static: "Static", +} + +/** + * The data type of the parameter. + */ +union ParameterType { + string, + + /** + * String + */ + String: "String", + + /** + * Array + */ + Array: "Array", + + /** + * Object + */ + Object: "Object", + + /** + * Boolean + */ + Boolean: "Boolean", + + /** + * Integer + */ + Integer: "Integer", + + /** + * Float + */ + Float: "Float", + + /** + * DateTime + */ + DateTime: "DateTime", +} + +/** + * The result of the completed token acquisition operation. Possible values are Succeeded and Failed. + */ +union PolicyTokenResult { + string, + + /** + * Succeeded + */ + Succeeded: "Succeeded", + + /** + * Failed + */ + Failed: "Failed", +} + +/** + * The result of the external endpoint. Possible values are Succeeded and Failed. + */ +union ExternalEndpointResult { + string, + + /** + * Succeeded + */ + Succeeded: "Succeeded", + + /** + * Failed + */ + Failed: "Failed", +} + +/** + * The identity type. This is the only required field when adding a system or user assigned identity to a resource. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "For backward compatibility" +enum ResourceIdentityType { + /** + * Indicates that a system assigned identity is associated with the resource. + */ + SystemAssigned, + + /** + * Indicates that a system assigned identity is associated with the resource. + */ + UserAssigned, + + /** + * Indicates that no identity is associated with the resource or that the existing identity should be removed. + */ + None, +} + +/** + * The policy assignment properties. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "For backward compatibility" +model PolicyAssignmentProperties { + /** + * The display name of the policy assignment. + */ + displayName?: string; + + /** + * The ID of the policy definition or policy set definition being assigned. + */ + policyDefinitionId?: string; + + /** + * The version of the policy definition to use. + */ + definitionVersion?: string; + + /** + * The latest version of the policy definition available. This is only present if requested via the $expand query parameter. + */ + @visibility(Lifecycle.Read) + latestDefinitionVersion?: string; + + /** + * The effective version of the policy definition in use. This is only present if requested via the $expand query parameter. + */ + @visibility(Lifecycle.Read) + effectiveDefinitionVersion?: string; + + /** + * The scope for the policy assignment. + */ + @visibility(Lifecycle.Read) + scope?: string; + + /** + * The policy's excluded scopes. + */ + notScopes?: string[]; + + /** + * The parameter values for the assigned policy rule. The keys are the parameter names. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" + parameters?: Record; + + /** + * This message will be part of response in case of policy violation. + */ + description?: string; + + /** + * The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. + */ + metadata?: unknown; + + /** + * The policy assignment enforcement mode. Possible values are Default, DoNotEnforce, and Enroll + */ + enforcementMode?: EnforcementMode = EnforcementMode.Default; + + /** + * The messages that describe why a resource is non-compliant with the policy. + */ + @identifiers(#["message", "policyDefinitionReferenceId"]) + nonComplianceMessages?: NonComplianceMessage[]; + + /** + * The resource selector list to filter policies by resource properties. + */ + @identifiers(#[]) + resourceSelectors?: ResourceSelector[]; + + /** + * The policy property value override. + */ + @identifiers(#[]) + overrides?: Override[]; + + /** + * The type of policy assignment. Possible values are NotSpecified, System, SystemHidden, and Custom. Immutable. + */ + assignmentType?: AssignmentType; + + /** + * The instance ID of the policy assignment. This ID only and always changes when the assignment is deleted and recreated. + */ + @visibility(Lifecycle.Read) + instanceId?: string; +} + +/** + * The value of a parameter. + */ +model ParameterValuesValue { + /** + * The value of the parameter. + */ + value?: unknown; +} + +/** + * 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. + */ +model NonComplianceMessage { + /** + * 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. + */ + message: string; + + /** + * 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. + */ + policyDefinitionReferenceId?: string; +} + +/** + * The resource selector to filter policies by resource properties. + */ +model ResourceSelector { + /** + * The name of the resource selector. + */ + name?: string; + + /** + * The list of the selector expressions. + */ + @identifiers(#[]) + selectors?: Selector[]; +} + +/** + * The selector expression. + */ +model Selector { + /** + * The selector kind. + */ + kind?: SelectorKind; + + /** + * The list of values to filter in. + */ + in?: string[]; + + /** + * The list of values to filter out. + */ + notIn?: string[]; +} + +/** + * The policy property value override. + */ +model Override { + /** + * The override kind. + */ + kind?: OverrideKind; + + /** + * The value to override the policy property. + */ + value?: string; + + /** + * The list of the selector expressions. + */ + @identifiers(#[]) + selectors?: Selector[]; +} + +/** + * 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. + */ +model Identity { + /** + * The principal ID of the resource identity. This property will only be provided for a system assigned identity + */ + @visibility(Lifecycle.Read) + principalId?: string; + + /** + * The tenant ID of the resource identity. This property will only be provided for a system assigned identity + */ + @visibility(Lifecycle.Read) + tenantId?: string; + + /** + * The identity type. This is the only required field when adding a system or user assigned identity to a resource. + */ + type?: ResourceIdentityType; + + /** + * 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}'. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" + userAssignedIdentities?: Record; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +model UserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + */ + @visibility(Lifecycle.Read) + principalId?: string; + + /** + * The client id of user assigned identity. + */ + @visibility(Lifecycle.Read) + clientId?: string; +} + +/** + * The policy assignment for Patch request. + */ +model PolicyAssignmentUpdate { + /** + * The policy assignment properties for Patch request. + */ + properties?: PolicyAssignmentUpdateProperties; + + /** + * The location of the policy assignment. Only required when utilizing managed identity. + */ + location?: string; + + /** + * The managed identity associated with the policy assignment. + */ + identity?: Identity; +} + +/** + * The policy assignment properties for Patch request. + */ +model PolicyAssignmentUpdateProperties { + /** + * The resource selector list to filter policies by resource properties. + */ + @identifiers(#[]) + resourceSelectors?: ResourceSelector[]; + + /** + * The policy property value override. + */ + @identifiers(#[]) + overrides?: Override[]; +} + +/** + * The policy definition properties. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "For backward compatibility" +model PolicyDefinitionProperties { + /** + * The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. + */ + policyType?: PolicyType; + + /** + * The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. + */ + mode?: string = "Indexed"; + + /** + * The display name of the policy definition. + */ + displayName?: string; + + /** + * The policy definition description. + */ + description?: string; + + /** + * The policy rule. + */ + policyRule?: unknown; + + /** + * The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. + */ + metadata?: unknown; + + /** + * The parameter definitions for parameters used in the policy rule. The keys are the parameter names. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" + parameters?: Record; + + /** + * The policy definition version in #.#.# format. + */ + version?: string; + + /** + * A list of available versions for this policy definition. + */ + versions?: string[]; + + /** + * The details of the source of external evaluation results required by the policy during enforcement evaluation. + */ + externalEvaluationEnforcementSettings?: ExternalEvaluationEnforcementSettings; +} + +/** + * The definition of a parameter that can be provided to the policy. + */ +model ParameterDefinitionsValue { + /** + * The data type of the parameter. + */ + type?: ParameterType; + + /** + * The allowed values for the parameter. + */ + @identifiers(#[]) + allowedValues?: unknown[]; + + /** + * The default value for the parameter if no value is provided. + */ + defaultValue?: unknown; + + /** + * Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/. + */ + schema?: unknown; + + /** + * General metadata for the parameter. + */ + metadata?: ParameterDefinitionsValueMetadata; +} + +/** + * General metadata for the parameter. + */ +model ParameterDefinitionsValueMetadata { + ...Record; + + /** + * The display name for the parameter. + */ + displayName?: string; + + /** + * The description of the parameter. + */ + description?: string; + + /** + * Used when assigning the policy definition through the portal. Provides a context aware list of values for the user to choose from. + */ + strongType?: string; + + /** + * 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. + */ + assignPermissions?: boolean; +} + +/** + * The details of the source of external evaluation results required by the policy during enforcement evaluation. + */ +model ExternalEvaluationEnforcementSettings { + /** + * What to do when evaluating an enforcement policy that requires an external evaluation and the token is missing. Possible values are Audit and Deny and language expressions are supported. + */ + missingTokenAction?: string; + + /** + * The lifespan of the endpoint invocation result after which it's no longer valid. Value is expected to follow the ISO 8601 duration format and language expressions are supported. + */ + resultLifespan?: string; + + /** + * The settings of an external endpoint providing evaluation results. + */ + endpointSettings?: ExternalEvaluationEndpointSettings; + + /** + * An array of the role definition Ids the assignment's MSI will need in order to invoke the endpoint. + */ + roleDefinitionIds?: string[]; +} + +/** + * The settings of an external endpoint providing evaluation results. + */ +model ExternalEvaluationEndpointSettings { + /** + * The kind of the endpoint. + */ + kind?: string; + + /** + * The details of the endpoint. + */ + details?: unknown; +} + +/** + * The policy definition properties. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "For backward compatibility" +model PolicyDefinitionVersionProperties { + /** + * The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. + */ + policyType?: PolicyType; + + /** + * The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. + */ + mode?: string = "Indexed"; + + /** + * The display name of the policy definition. + */ + displayName?: string; + + /** + * The policy definition description. + */ + description?: string; + + /** + * The policy rule. + */ + policyRule?: unknown; + + /** + * The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. + */ + metadata?: unknown; + + /** + * The parameter definitions for parameters used in the policy rule. The keys are the parameter names. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" + parameters?: Record; + + /** + * The policy definition version in #.#.# format. + */ + version?: string; + + /** + * The details of the source of external evaluation results required by the policy during enforcement evaluation. + */ + externalEvaluationEnforcementSettings?: ExternalEvaluationEnforcementSettings; +} + +/** + * The policy set definition properties. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "For backward compatibility" +model PolicySetDefinitionProperties { + /** + * The type of policy set definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. + */ + policyType?: PolicyType; + + /** + * The display name of the policy set definition. + */ + displayName?: string; + + /** + * The policy set definition description. + */ + description?: string; + + /** + * The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. + */ + metadata?: unknown; + + /** + * The policy set definition parameters that can be used in policy definition references. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" + parameters?: Record; + + /** + * An array of policy definition references. + */ + @identifiers(#["policyDefinitionReferenceId"]) + policyDefinitions: PolicyDefinitionReference[]; + + /** + * The metadata describing groups of policy definition references within the policy set definition. + */ + @identifiers(#["name"]) + policyDefinitionGroups?: PolicyDefinitionGroup[]; + + /** + * The policy set definition version in #.#.# format. + */ + version?: string; + + /** + * A list of available versions for this policy set definition. + */ + versions?: string[]; +} + +/** + * The policy definition reference. + */ +model PolicyDefinitionReference { + /** + * The ID of the policy definition or policy set definition. + */ + policyDefinitionId: string; + + /** + * The version of the policy definition to use. + */ + definitionVersion?: string; + + /** + * The latest version of the policy definition available. This is only present if requested via the $expand query parameter. + */ + @visibility(Lifecycle.Read) + latestDefinitionVersion?: string; + + /** + * The effective version of the policy definition in use. This is only present if requested via the $expand query parameter. + */ + @visibility(Lifecycle.Read) + effectiveDefinitionVersion?: string; + + /** + * The parameter values for the referenced policy rule. The keys are the parameter names. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" + parameters?: Record; + + /** + * A unique id (within the policy set definition) for this policy definition reference. + */ + policyDefinitionReferenceId?: string; + + /** + * The name of the groups that this policy definition reference belongs to. + */ + groupNames?: string[]; +} + +/** + * The policy definition group. + */ +model PolicyDefinitionGroup { + /** + * The name of the group. + */ + name: string; + + /** + * The group's display name. + */ + displayName?: string; + + /** + * The group's category. + */ + category?: string; + + /** + * The group's description. + */ + description?: string; + + /** + * A resource ID of a resource that contains additional metadata about the group. + */ + additionalMetadataId?: string; +} + +/** + * The policy set definition properties. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "For backward compatibility" +model PolicySetDefinitionVersionProperties { + /** + * The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. + */ + policyType?: PolicyType; + + /** + * The display name of the policy set definition. + */ + displayName?: string; + + /** + * The policy set definition description. + */ + description?: string; + + /** + * The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. + */ + metadata?: unknown; + + /** + * The policy set definition parameters that can be used in policy definition references. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" + parameters?: Record; + + /** + * An array of policy definition references. + */ + @identifiers(#["policyDefinitionReferenceId"]) + policyDefinitions: PolicyDefinitionReference[]; + + /** + * The metadata describing groups of policy definition references within the policy set definition. + */ + @identifiers(#["name"]) + policyDefinitionGroups?: PolicyDefinitionGroup[]; + + /** + * The policy set definition version in #.#.# format. + */ + version?: string; +} + +/** + * The policy token request properties. + */ +model PolicyTokenRequest { + /** + * The resource operation to acquire a token for. + */ + operation: PolicyTokenOperation; + + /** + * The change reference. + */ + changeReference?: string; +} + +/** + * The resource operation to acquire a token for. + */ +model PolicyTokenOperation { + /** + * The request URI of the resource operation. + */ + uri: string; + + /** + * The http method of the resource operation. + */ + httpMethod: string; + + /** + * The payload of the resource operation. + */ + content?: unknown; +} + +/** + * The policy token response properties. + */ +model PolicyTokenResponse { + /** + * The result of the completed token acquisition operation. Possible values are Succeeded and Failed. + */ + result?: PolicyTokenResult; + + /** + * Status message with additional details about the token acquisition operation result. + */ + message?: string; + + /** + * The date and time after which the client can try to acquire a token again in the case of retry-able failures. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + retryAfter?: utcDateTime; + + /** + * An array of external evaluation endpoint invocation results. + */ + results?: ExternalEvaluationEndpointInvocationResult[]; + + /** + * The change reference associated with the operation for which the token is acquired. + */ + changeReference?: string; + + /** + * The issued policy token. + */ + token?: string; + + /** + * The unique Id assigned to the policy token. + */ + tokenId?: string; + + /** + * The expiration of the policy token. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expiration?: utcDateTime; +} + +/** + * The external evaluation endpoint invocation results. + */ +model ExternalEvaluationEndpointInvocationResult { + /** + * The details of the policy requiring the external endpoint invocation. + */ + policyInfo?: PolicyLogInfo; + + /** + * The result of the external endpoint. Possible values are Succeeded and Failed. + */ + result?: ExternalEndpointResult; + + /** + * The status message with additional details about the invocation result. + */ + message?: string; + + /** + * The date and time after which a failed endpoint invocation can be retried. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + retryAfter?: utcDateTime; + + /** + * The set of claims that will be attached to the policy token as an attestation for the result of the endpoint invocation. + */ + claims?: unknown; + + /** + * The expiration of the results. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expiration?: utcDateTime; +} + +/** + * The policy log info. + */ +model PolicyLogInfo { + /** + * The policy definition Id. + */ + policyDefinitionId?: string; + + /** + * The policy set definition Id. + */ + policySetDefinitionId?: string; + + /** + * The policy definition instance Id inside a policy set. + */ + policyDefinitionReferenceId?: string; + + /** + * The policy set definition name. + */ + policySetDefinitionName?: string; + + /** + * The policy set definition display name. + */ + policySetDefinitionDisplayName?: string; + + /** + * The policy set definition version. + */ + policySetDefinitionVersion?: string; + + /** + * The policy set definition category. + */ + policySetDefinitionCategory?: string; + + /** + * The policy definition name. + */ + policyDefinitionName?: string; + + /** + * The policy definition display name. + */ + policyDefinitionDisplayName?: string; + + /** + * The policy definition version. + */ + policyDefinitionVersion?: string; + + /** + * The policy definition action. + */ + policyDefinitionEffect?: string; + + /** + * An array of policy definition group names. + */ + policyDefinitionGroupNames?: string[]; + + /** + * The policy assignment Id. + */ + policyAssignmentId?: string; + + /** + * The policy assignment name. + */ + policyAssignmentName?: string; + + /** + * The policy assignment display name. + */ + policyAssignmentDisplayName?: string; + + /** + * The policy assignment version. + */ + policyAssignmentVersion?: string; + + /** + * The policy assignment scope. + */ + policyAssignmentScope?: string; + + /** + * The resource location. + */ + resourceLocation?: string; + + /** + * The management group ancestors. + */ + ancestors?: string; + + /** + * The policy compliance reason code. + */ + complianceReasonCode?: string; + + /** + * An array of policy exemption Ids. + */ + policyExemptionIds?: string[]; +} diff --git a/specification/resources/Authorization.Management/routes.tsp b/specification/resources/Authorization.Management/routes.tsp new file mode 100644 index 000000000000..09cf231e8a04 --- /dev/null +++ b/specification/resources/Authorization.Management/routes.tsp @@ -0,0 +1,143 @@ +// FIXME: Operations in this file are not detected as a resource operation, please confirm the conversion result manually + +import "@azure-tools/typespec-azure-core"; +import "@typespec/rest"; +import "./models.tsp"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using TypeSpec.OpenAPI; + +namespace Microsoft.Authorization; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" +interface PolicyDefinitionVersionsOperationGroup { + /** + * This operation lists all the built-in policy definition versions for all built-in policy definitions. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @summary("Lists all built-in policy definition versions.") + @operationId("PolicyDefinitionVersions_ListAllBuiltins") + @autoRoute + @action("listPolicyDefinitionVersions") + listAllBuiltins is ArmProviderActionSync>; + /** + * This operation lists all the policy definition versions for all policy definitions at the management group scope. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @summary("Lists all policy definition versions at management group scope.") + @operationId("PolicyDefinitionVersions_ListAllAtManagementGroup") + @autoRoute + @action("listPolicyDefinitionVersions") + listAllAtManagementGroup is ArmProviderActionSync< + Response = ResourceListResult, + Parameters = { + /** + * The name of the management group. The name is case insensitive. + */ + @maxLength(90) + @minLength(1) + @path + @segment("managementGroups") + managementGroupName: string; + } + >; + /** + * This operation lists all the policy definition versions for all policy definitions within a subscription. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @summary("Lists all policy definition versions within a subscription.") + @operationId("PolicyDefinitionVersions_ListAll") + @autoRoute + @action("listPolicyDefinitionVersions") + listAll is ArmProviderActionSync< + Response = ResourceListResult, + Scope = SubscriptionActionScope + >; +} + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" +interface PolicySetDefinitionVersionsOperationGroup { + /** + * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @summary("Lists all built-in policy set definition versions.") + @operationId("PolicySetDefinitionVersions_ListAllBuiltins") + @autoRoute + @action("listPolicySetDefinitionVersions") + listAllBuiltins is ArmProviderActionSync>; + /** + * This operation lists all the policy set definition versions for all policy set definitions at the management group scope. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @summary("Lists all policy set definition versions at management group scope.") + @operationId("PolicySetDefinitionVersions_ListAllAtManagementGroup") + @autoRoute + @action("listPolicySetDefinitionVersions") + listAllAtManagementGroup is ArmProviderActionSync< + Response = ResourceListResult, + Parameters = { + /** + * The name of the management group. The name is case insensitive. + */ + @maxLength(90) + @minLength(1) + @path + @segment("managementGroups") + managementGroupName: string; + } + >; + /** + * This operation lists all the policy set definition versions for all policy set definitions within a subscription. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @summary("Lists all policy set definition versions within a subscription.") + @operationId("PolicySetDefinitionVersions_ListAll") + @autoRoute + @action("listPolicySetDefinitionVersions") + listAll is ArmProviderActionSync< + Response = ResourceListResult, + Scope = SubscriptionActionScope + >; +} + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" +interface PolicyTokensOperationGroup { + /** + * This operation acquires a policy token in the given subscription for the given request body. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @summary("Acquires a policy token.") + @operationId("PolicyTokens_Acquire") + @autoRoute + @action("acquirePolicyToken") + acquire is ArmProviderActionSync< + Request = PolicyTokenRequest, + Response = PolicyTokenResponse, + Scope = SubscriptionActionScope + >; + /** + * This operation acquires a policy token in the given management group for the given request body. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @summary("Acquires a policy token at management group level.") + @operationId("PolicyTokens_AcquireAtManagementGroup") + @autoRoute + @action("acquirePolicyToken") + acquireAtManagementGroup is ArmProviderActionSync< + Request = PolicyTokenRequest, + Response = PolicyTokenResponse, + Parameters = { + /** + * The name of the management group. + */ + @path + @segment("managementGroups") + managementGroupName: string; + } + >; +} diff --git a/specification/resources/Authorization.Management/tspconfig.yaml b/specification/resources/Authorization.Management/tspconfig.yaml new file mode 100644 index 000000000000..d581d59ac0f0 --- /dev/null +++ b/specification/resources/Authorization.Management/tspconfig.yaml @@ -0,0 +1,13 @@ +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + omit-unreachable-types: true + emitter-output-dir: "{project-root}/.." + azure-resource-provider-folder: "resource-manager" + output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" + emit-lro-options: "all" + examples-dir: "{project-root}/examples" +linter: + extends: + - "@azure-tools/typespec-azure-rulesets/resource-manager" From a9e2626623157c8fa3adf624860c96b66d6063b2 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 29 Oct 2025 13:59:33 +0800 Subject: [PATCH 02/45] tspconfig --- .../Authorization.Management/tspconfig.yaml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/specification/resources/Authorization.Management/tspconfig.yaml b/specification/resources/Authorization.Management/tspconfig.yaml index d581d59ac0f0..7d12b3f9e78c 100644 --- a/specification/resources/Authorization.Management/tspconfig.yaml +++ b/specification/resources/Authorization.Management/tspconfig.yaml @@ -1,3 +1,6 @@ +parameters: + "service-dir": + default: "sdk/resources" emit: - "@azure-tools/typespec-autorest" options: @@ -8,6 +11,39 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" + "@azure-tools/typespec-csharp": + emitter-output-dir: "{output-dir}/{service-dir}/{namespace}" + flavor: azure + clear-output-folder: true + model-namespace: true + namespace: "Azure.ResourceManager.Resources.Policy" + "@azure-tools/typespec-python": + emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-resources-policy" + namespace: "azure.mgmt.resources.policy" + generate-test: true + generate-sample: true + flavor: "azure" + "@azure-tools/typespec-java": + emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-resources-policy" + namespace: "com.azure.resourcemanager.resources.policy" + service-name: "Policy" + flavor: azure + "@azure-tools/typespec-ts": + emitter-output-dir: "{output-dir}/{service-dir}/arm-resourcespolicy" + flavor: azure + experimental-extensible-enums: true + package-details: + name: "@azure/arm-resourcespolicy" + "@azure-tools/typespec-go": + service-dir: "sdk/resourcemanager/resources/armpolicy" + emitter-output-dir: "{output-dir}/{service-dir}/resources/armpolicy" + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/resources/armpolicy" + fix-const-stuttering: true + flavor: "azure" + generate-samples: true + generate-fakes: true + head-as-boolean: true + inject-spans: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" From b05c3724d4baa97ae7855b797e6a0d93b87945c2 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 29 Oct 2025 14:00:29 +0800 Subject: [PATCH 03/45] prettier --- .../examples/2025-03-01/acquirePolicyToken.json | 2 +- .../2025-03-01/acquirePolicyTokenAtManagementGroup.json | 2 +- .../examples/2025-03-01/createOrUpdatePolicyDefinition.json | 2 +- .../createOrUpdatePolicyDefinitionAdvancedParams.json | 2 +- .../createOrUpdatePolicyDefinitionAtManagementGroup.json | 2 +- ...tePolicyDefinitionExternalEvaluationEnforcementSettings.json | 2 +- .../2025-03-01/createOrUpdatePolicyDefinitionVersion.json | 2 +- .../createOrUpdatePolicyDefinitionVersionAtManagementGroup.json | 2 +- .../examples/2025-03-01/createOrUpdatePolicySetDefinition.json | 2 +- .../createOrUpdatePolicySetDefinitionAtManagementGroup.json | 2 +- .../2025-03-01/createOrUpdatePolicySetDefinitionVersion.json | 2 +- ...eateOrUpdatePolicySetDefinitionVersionAtManagementGroup.json | 2 +- .../2025-03-01/createOrUpdatePolicySetDefinitionWithGroups.json | 2 +- ...eOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json | 2 +- .../examples/2025-03-01/createPolicyAssignment.json | 2 +- .../2025-03-01/createPolicyAssignmentNonComplianceMessages.json | 2 +- .../2025-03-01/createPolicyAssignmentWithEnrollEnforcement.json | 2 +- .../examples/2025-03-01/createPolicyAssignmentWithIdentity.json | 2 +- .../2025-03-01/createPolicyAssignmentWithOverrides.json | 2 +- .../2025-03-01/createPolicyAssignmentWithResourceSelectors.json | 2 +- .../createPolicyAssignmentWithUserAssignedIdentity.json | 2 +- .../2025-03-01/createPolicyAssignmentWithoutEnforcement.json | 2 +- .../examples/2025-03-01/deletePolicyAssignment.json | 2 +- .../examples/2025-03-01/deletePolicyDefinition.json | 2 +- .../2025-03-01/deletePolicyDefinitionAtManagementGroup.json | 2 +- .../examples/2025-03-01/deletePolicyDefinitionVersion.json | 2 +- .../deletePolicyDefinitionVersionAtManagementGroup.json | 2 +- .../examples/2025-03-01/deletePolicySetDefinition.json | 2 +- .../2025-03-01/deletePolicySetDefinitionAtManagementGroup.json | 2 +- .../examples/2025-03-01/deletePolicySetDefinitionVersion.json | 2 +- .../deletePolicySetDefinitionVersionAtManagementGroup.json | 2 +- .../examples/2025-03-01/getBuiltInPolicySetDefinition.json | 2 +- .../2025-03-01/getBuiltInPolicySetDefinitionVersion.json | 2 +- .../examples/2025-03-01/getBuiltinPolicyDefinition.json | 2 +- .../examples/2025-03-01/getBuiltinPolicyDefinitionVersion.json | 2 +- .../examples/2025-03-01/getPolicyAssignment.json | 2 +- .../examples/2025-03-01/getPolicyAssignmentWithIdentity.json | 2 +- .../examples/2025-03-01/getPolicyAssignmentWithOverrides.json | 2 +- .../2025-03-01/getPolicyAssignmentWithResourceSelectors.json | 2 +- .../2025-03-01/getPolicyAssignmentWithUserAssignedIdentity.json | 2 +- .../examples/2025-03-01/getPolicyDefinition.json | 2 +- .../2025-03-01/getPolicyDefinitionAtManagementGroup.json | 2 +- .../examples/2025-03-01/getPolicyDefinitionVersion.json | 2 +- .../2025-03-01/getPolicyDefinitionVersionAtManagementGroup.json | 2 +- .../examples/2025-03-01/getPolicySetDefinition.json | 2 +- .../2025-03-01/getPolicySetDefinitionAtManagementGroup.json | 2 +- .../examples/2025-03-01/getPolicySetDefinitionVersion.json | 2 +- .../getPolicySetDefinitionVersionAtManagementGroup.json | 2 +- .../2025-03-01/listAllBuiltInPolicyDefinitionVersions.json | 2 +- .../2025-03-01/listAllBuiltInPolicySetDefinitionVersions.json | 2 +- .../examples/2025-03-01/listAllPolicyDefinitionVersions.json | 2 +- .../listAllPolicyDefinitionVersionsByManagementGroup.json | 2 +- .../examples/2025-03-01/listAllPolicySetDefinitionVersions.json | 2 +- .../listAllPolicySetDefinitionVersionsByManagementGroup.json | 2 +- .../2025-03-01/listBuiltInPolicyDefinitionVersions.json | 2 +- .../examples/2025-03-01/listBuiltInPolicyDefinitions.json | 2 +- .../2025-03-01/listBuiltInPolicySetDefinitionVersions.json | 2 +- .../examples/2025-03-01/listBuiltInPolicySetDefinitions.json | 2 +- .../2025-03-01/listPolicyAssignmentsForResourceGroup.json | 2 +- .../examples/2025-03-01/listPolicyDefinitionVersions.json | 2 +- .../listPolicyDefinitionVersionsByManagementGroup.json | 2 +- .../examples/2025-03-01/listPolicyDefinitions.json | 2 +- .../2025-03-01/listPolicyDefinitionsByManagementGroup.json | 2 +- .../examples/2025-03-01/listPolicySetDefinitionVersions.json | 2 +- .../listPolicySetDefinitionVersionsByManagementGroup.json | 2 +- .../examples/2025-03-01/listPolicySetDefinitions.json | 2 +- .../2025-03-01/listPolicySetDefinitionsByManagementGroup.json | 2 +- .../examples/2025-03-01/updatePolicyAssignmentWithIdentity.json | 2 +- .../2025-03-01/updatePolicyAssignmentWithOverrides.json | 2 +- .../2025-03-01/updatePolicyAssignmentWithResourceSelectors.json | 2 +- .../updatePolicyAssignmentWithUserAssignedIdentity.json | 2 +- 71 files changed, 71 insertions(+), 71 deletions(-) diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyToken.json b/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyToken.json index 55224011df71..b91d59b10de2 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyToken.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyToken.json @@ -61,4 +61,4 @@ }, "operationId": "PolicyTokens_Acquire", "title": "Acquire a policy token" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyTokenAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyTokenAtManagementGroup.json index 10bf0ebdddac..b4d77d1c792d 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyTokenAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/acquirePolicyTokenAtManagementGroup.json @@ -61,4 +61,4 @@ }, "operationId": "PolicyTokens_AcquireAtManagementGroup", "title": "Acquire a policy token at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinition.json index 26f7da793872..91438d92bc62 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinition.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinition.json @@ -94,4 +94,4 @@ }, "operationId": "PolicyDefinitions_CreateOrUpdate", "title": "Create or update a policy definition" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAdvancedParams.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAdvancedParams.json index f9239d2b5b43..58db388be568 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAdvancedParams.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAdvancedParams.json @@ -121,4 +121,4 @@ }, "operationId": "PolicyDefinitions_CreateOrUpdate", "title": "Create or update a policy definition with advanced parameters" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAtManagementGroup.json index 26792ec19424..140f26107013 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionAtManagementGroup.json @@ -94,4 +94,4 @@ }, "operationId": "PolicyDefinitions_CreateOrUpdateAtManagementGroup", "title": "Create or update a policy definition at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json index 27b5e3fe17f2..66a1862463c8 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json @@ -106,4 +106,4 @@ }, "operationId": "PolicyDefinitions_CreateOrUpdate", "title": "Create or update a policy definition with external evaluation enforcement settings" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersion.json index 7708577e7050..5bbb045374f8 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersion.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersion.json @@ -137,4 +137,4 @@ }, "operationId": "PolicyDefinitionVersions_CreateOrUpdate", "title": "Create or update a policy definition version" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json index 306d67d647bc..ccc91d11b970 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json @@ -137,4 +137,4 @@ }, "operationId": "PolicyDefinitionVersions_CreateOrUpdateAtManagementGroup", "title": "Create or update a policy definition version at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinition.json index bffdea526a52..0dd02b6ce0ba 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinition.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinition.json @@ -159,4 +159,4 @@ }, "operationId": "PolicySetDefinitions_CreateOrUpdate", "title": "Create or update a policy set definition" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionAtManagementGroup.json index 5ff8fbff589c..adf5a31305ef 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionAtManagementGroup.json @@ -134,4 +134,4 @@ }, "operationId": "PolicySetDefinitions_CreateOrUpdateAtManagementGroup", "title": "Create or update a policy set definition at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersion.json index bf70d659dd85..f1aa0608b1db 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersion.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersion.json @@ -160,4 +160,4 @@ }, "operationId": "PolicySetDefinitionVersions_CreateOrUpdate", "title": "Create or update a policy set definition version" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json index 7d6a17966ac7..079604c3768d 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json @@ -132,4 +132,4 @@ }, "operationId": "PolicySetDefinitionVersions_CreateOrUpdateAtManagementGroup", "title": "Create or update a policy set definition version at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroups.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroups.json index 2c7c7c47f274..4bc6d042bb4a 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroups.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroups.json @@ -195,4 +195,4 @@ }, "operationId": "PolicySetDefinitions_CreateOrUpdate", "title": "Create or update a policy set definition with groups" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json index 983d0406a78f..e5e142d22577 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json @@ -193,4 +193,4 @@ }, "operationId": "PolicySetDefinitions_CreateOrUpdateAtManagementGroup", "title": "Create or update a policy set definition with groups at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignment.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignment.json index 243abed228a3..0d8381c1a2e1 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignment.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignment.json @@ -65,4 +65,4 @@ }, "operationId": "PolicyAssignments_Create", "title": "Create or update a policy assignment" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentNonComplianceMessages.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentNonComplianceMessages.json index c0e43c884d36..506a0db6ad8e 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentNonComplianceMessages.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentNonComplianceMessages.json @@ -60,4 +60,4 @@ }, "operationId": "PolicyAssignments_Create", "title": "Create or update a policy assignment with multiple non-compliance messages" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithEnrollEnforcement.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithEnrollEnforcement.json index ccd3fbe569f0..f14af10acda8 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithEnrollEnforcement.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithEnrollEnforcement.json @@ -56,4 +56,4 @@ }, "operationId": "PolicyAssignments_Create", "title": "Create or update a policy assignment to enforce policy effect only on enrolled resources during resource creation or update." -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithIdentity.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithIdentity.json index 70d3cdf3bd99..1ff9945511b9 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithIdentity.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithIdentity.json @@ -66,4 +66,4 @@ }, "operationId": "PolicyAssignments_Create", "title": "Create or update a policy assignment with a system assigned identity" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithOverrides.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithOverrides.json index 31083b1610f6..7ef5947130af 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithOverrides.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithOverrides.json @@ -83,4 +83,4 @@ }, "operationId": "PolicyAssignments_Create", "title": "Create or update a policy assignment with overrides" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithResourceSelectors.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithResourceSelectors.json index aeadc8c0a574..3bfb7303f6ec 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithResourceSelectors.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithResourceSelectors.json @@ -67,4 +67,4 @@ }, "operationId": "PolicyAssignments_Create", "title": "Create or update a policy assignment with resource selectors" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithUserAssignedIdentity.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithUserAssignedIdentity.json index df3df157eaf0..765add88100a 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithUserAssignedIdentity.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithUserAssignedIdentity.json @@ -73,4 +73,4 @@ }, "operationId": "PolicyAssignments_Create", "title": "Create or update a policy assignment with a user assigned identity" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithoutEnforcement.json b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithoutEnforcement.json index 7b9e3835e5ac..61d6cd45f59d 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithoutEnforcement.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/createPolicyAssignmentWithoutEnforcement.json @@ -56,4 +56,4 @@ }, "operationId": "PolicyAssignments_Create", "title": "Create or update a policy assignment without enforcing policy effect during resource creation or update." -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyAssignment.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyAssignment.json index 0b0aec2eb7e5..e03b67b96c17 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyAssignment.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyAssignment.json @@ -39,4 +39,4 @@ }, "operationId": "PolicyAssignments_Delete", "title": "Delete a policy assignment" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinition.json index 49cdbd81ca7f..7576285efdb7 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinition.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinition.json @@ -14,4 +14,4 @@ }, "operationId": "PolicyDefinitions_Delete", "title": "Delete a policy definition" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionAtManagementGroup.json index a63edec5bb8b..228df971b91a 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionAtManagementGroup.json @@ -14,4 +14,4 @@ }, "operationId": "PolicyDefinitions_DeleteAtManagementGroup", "title": "Delete a policy definition at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersion.json index 67bf3397408f..d41ae43ef4ce 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersion.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersion.json @@ -15,4 +15,4 @@ }, "operationId": "PolicyDefinitionVersions_Delete", "title": "Delete a policy definition version" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersionAtManagementGroup.json index d1b603fbee14..b841e31494c2 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersionAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicyDefinitionVersionAtManagementGroup.json @@ -15,4 +15,4 @@ }, "operationId": "PolicyDefinitionVersions_DeleteAtManagementGroup", "title": "Delete a policy definition version at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinition.json index 915664cd424b..93388f84fcd0 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinition.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinition.json @@ -14,4 +14,4 @@ }, "operationId": "PolicySetDefinitions_Delete", "title": "Delete a policy set definition" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionAtManagementGroup.json index 0c0ff632e3c1..18888ec78cf8 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionAtManagementGroup.json @@ -14,4 +14,4 @@ }, "operationId": "PolicySetDefinitions_DeleteAtManagementGroup", "title": "Delete a policy set definition at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersion.json index a7bc7c87c14c..29dc54f08816 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersion.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersion.json @@ -15,4 +15,4 @@ }, "operationId": "PolicySetDefinitionVersions_Delete", "title": "Delete a policy set definition version" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersionAtManagementGroup.json index 32de492108ca..cc00c62a0f06 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersionAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/deletePolicySetDefinitionVersionAtManagementGroup.json @@ -15,4 +15,4 @@ }, "operationId": "PolicySetDefinitionVersions_DeleteAtManagementGroup", "title": "Delete a policy set definition version at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinition.json index 1fe221c2b56a..e003a337577d 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinition.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinition.json @@ -81,4 +81,4 @@ }, "operationId": "PolicySetDefinitions_GetBuiltIn", "title": "Retrieve a built-in policy set definition" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinitionVersion.json index 14cec4f95d9a..1d9c1862f115 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinitionVersion.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltInPolicySetDefinitionVersion.json @@ -78,4 +78,4 @@ }, "operationId": "PolicySetDefinitionVersions_GetBuiltIn", "title": "Retrieve a built-in policy set definition version" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinition.json index 6d9b43953bc1..f15fa3d43eb8 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinition.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinition.json @@ -56,4 +56,4 @@ }, "operationId": "PolicyDefinitions_GetBuiltIn", "title": "Retrieve a built-in policy definition" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinitionVersion.json index 46698887940e..d45119a673f5 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinitionVersion.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getBuiltinPolicyDefinitionVersion.json @@ -53,4 +53,4 @@ }, "operationId": "PolicyDefinitionVersions_GetBuiltIn", "title": "Retrieve a built-in policy definition version" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignment.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignment.json index 5467d8386dbc..4936ef94da0e 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignment.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignment.json @@ -37,4 +37,4 @@ }, "operationId": "PolicyAssignments_Get", "title": "Retrieve a policy assignment" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithIdentity.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithIdentity.json index 48b503c9f581..70922a369ae3 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithIdentity.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithIdentity.json @@ -43,4 +43,4 @@ }, "operationId": "PolicyAssignments_Get", "title": "Retrieve a policy assignment with a system assigned identity" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithOverrides.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithOverrides.json index 3ea5b505f0e7..6bc9269cc071 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithOverrides.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithOverrides.json @@ -44,4 +44,4 @@ }, "operationId": "PolicyAssignments_Get", "title": "Retrieve a policy assignment with overrides" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithResourceSelectors.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithResourceSelectors.json index b7e13b371e15..beb9b1450275 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithResourceSelectors.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithResourceSelectors.json @@ -43,4 +43,4 @@ }, "operationId": "PolicyAssignments_Get", "title": "Retrieve a policy assignment with resource selectors" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithUserAssignedIdentity.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithUserAssignedIdentity.json index 74b5f55d479b..5def53d8ec6e 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithUserAssignedIdentity.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyAssignmentWithUserAssignedIdentity.json @@ -47,4 +47,4 @@ }, "operationId": "PolicyAssignments_Get", "title": "Retrieve a policy assignment with a user assigned identity" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinition.json index 4e8ea6fe3cee..667bd3d6c51e 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinition.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinition.json @@ -57,4 +57,4 @@ }, "operationId": "PolicyDefinitions_Get", "title": "Retrieve a policy definition" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionAtManagementGroup.json index 65dbdd836421..50d0ba4bc872 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionAtManagementGroup.json @@ -57,4 +57,4 @@ }, "operationId": "PolicyDefinitions_GetAtManagementGroup", "title": "Retrieve a policy definition at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersion.json index 66cda99709b3..e0daec7cb078 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersion.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersion.json @@ -54,4 +54,4 @@ }, "operationId": "PolicyDefinitionVersions_Get", "title": "Retrieve a policy definition version" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersionAtManagementGroup.json index 4c16dccfc26b..1c1ec84270d5 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersionAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicyDefinitionVersionAtManagementGroup.json @@ -54,4 +54,4 @@ }, "operationId": "PolicyDefinitionVersions_GetAtManagementGroup", "title": "Retrieve a policy definition version at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinition.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinition.json index 8db62a1c57fb..409a2fbc2e9f 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinition.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinition.json @@ -74,4 +74,4 @@ }, "operationId": "PolicySetDefinitions_Get", "title": "Retrieve a policy set definition" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionAtManagementGroup.json index 4f9ab846cb46..d6ecde4512b0 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionAtManagementGroup.json @@ -56,4 +56,4 @@ }, "operationId": "PolicySetDefinitions_GetAtManagementGroup", "title": "Retrieve a policy set definition at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersion.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersion.json index d9272fd34cc1..eefdf88946a5 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersion.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersion.json @@ -71,4 +71,4 @@ }, "operationId": "PolicySetDefinitionVersions_Get", "title": "Retrieve a policy set definition version" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersionAtManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersionAtManagementGroup.json index 826f0432d400..fb68c04d970b 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersionAtManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/getPolicySetDefinitionVersionAtManagementGroup.json @@ -53,4 +53,4 @@ }, "operationId": "PolicySetDefinitionVersions_GetAtManagementGroup", "title": "Retrieve a policy set definition version at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicyDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicyDefinitionVersions.json index bebb17de9e83..d2403a682723 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicyDefinitionVersions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicyDefinitionVersions.json @@ -104,4 +104,4 @@ }, "operationId": "PolicyDefinitionVersions_ListAllBuiltins", "title": "List all built-in policy definition versions" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicySetDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicySetDefinitionVersions.json index fbf0d29d94d9..cff066682229 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicySetDefinitionVersions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllBuiltInPolicySetDefinitionVersions.json @@ -80,4 +80,4 @@ }, "operationId": "PolicySetDefinitionVersions_ListAllBuiltins", "title": "List all built-in policy definition versions" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersions.json index 67bfe118798d..d9bc957c17f8 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersions.json @@ -98,4 +98,4 @@ }, "operationId": "PolicyDefinitionVersions_ListAll", "title": "List all policy definition versions at subscription" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersionsByManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersionsByManagementGroup.json index 45169dc442e6..bd600f72687b 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersionsByManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersionsByManagementGroup.json @@ -98,4 +98,4 @@ }, "operationId": "PolicyDefinitionVersions_ListAllAtManagementGroup", "title": "List all policy definition versions at management group" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersions.json index 68249cec5ec6..9f3b6356db16 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersions.json @@ -55,4 +55,4 @@ }, "operationId": "PolicySetDefinitionVersions_ListAll", "title": "List all policy definition versions at subscription" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersionsByManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersionsByManagementGroup.json index 2a935fe20fda..78a5b395bd2e 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersionsByManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicySetDefinitionVersionsByManagementGroup.json @@ -122,4 +122,4 @@ }, "operationId": "PolicySetDefinitionVersions_ListAllAtManagementGroup", "title": "List all policy definition versions at management group" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitionVersions.json index ba43bfd53722..0aac2071f496 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitionVersions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitionVersions.json @@ -105,4 +105,4 @@ }, "operationId": "PolicyDefinitionVersions_ListBuiltIn", "title": "List built-in policy definition versions" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitions.json index 7029261063c5..1b4c23e59536 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicyDefinitions.json @@ -144,4 +144,4 @@ }, "operationId": "PolicyDefinitions_ListBuiltIn", "title": "List built-in policy definitions" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitionVersions.json index 8643aac0aa7b..4f475cdaade9 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitionVersions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitionVersions.json @@ -81,4 +81,4 @@ }, "operationId": "PolicySetDefinitionVersions_ListBuiltIn", "title": "List built-in policy set definitions" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitions.json index df961fa91ffc..ed5ee47c8bc4 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listBuiltInPolicySetDefinitions.json @@ -84,4 +84,4 @@ }, "operationId": "PolicySetDefinitions_ListBuiltIn", "title": "List built-in policy set definitions" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForResourceGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForResourceGroup.json index ee3d8d6c905d..0f76fed8aea7 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForResourceGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForResourceGroup.json @@ -63,4 +63,4 @@ }, "operationId": "PolicyAssignments_ListForResourceGroup", "title": "List policy assignments that apply to a resource group" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersions.json index b8612332966e..8f89677cb450 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersions.json @@ -99,4 +99,4 @@ }, "operationId": "PolicyDefinitionVersions_List", "title": "List policy definition versions by subscription" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersionsByManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersionsByManagementGroup.json index 7daf7235b616..87ef147d5c7c 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersionsByManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersionsByManagementGroup.json @@ -99,4 +99,4 @@ }, "operationId": "PolicyDefinitionVersions_ListByManagementGroup", "title": "List policy definition versions by management group" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitions.json index 67e7da322dc2..9eafcde5e7b7 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitions.json @@ -142,4 +142,4 @@ }, "operationId": "PolicyDefinitions_List", "title": "List policy definitions by subscription" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionsByManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionsByManagementGroup.json index 73f65687c6b9..3367ff8c2f67 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionsByManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionsByManagementGroup.json @@ -105,4 +105,4 @@ }, "operationId": "PolicyDefinitions_ListByManagementGroup", "title": "List policy definitions by management group" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersions.json index 0deb73fda9e4..66d61cb56c09 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersions.json @@ -56,4 +56,4 @@ }, "operationId": "PolicySetDefinitionVersions_List", "title": "List policy set definitions" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersionsByManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersionsByManagementGroup.json index 9d488bb3c3e0..2d887eb2cbd0 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersionsByManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionVersionsByManagementGroup.json @@ -56,4 +56,4 @@ }, "operationId": "PolicySetDefinitionVersions_ListByManagementGroup", "title": "List policy set definitions at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitions.json index 0915005995f6..d330a3004a84 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitions.json @@ -130,4 +130,4 @@ }, "operationId": "PolicySetDefinitions_List", "title": "List policy set definitions" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionsByManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionsByManagementGroup.json index a79ea0839ca4..c13d482435c4 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionsByManagementGroup.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicySetDefinitionsByManagementGroup.json @@ -128,4 +128,4 @@ }, "operationId": "PolicySetDefinitions_ListByManagementGroup", "title": "List policy set definitions at management group level" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithIdentity.json b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithIdentity.json index 2806e9f52481..116b5227d41c 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithIdentity.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithIdentity.json @@ -49,4 +49,4 @@ }, "operationId": "PolicyAssignments_Update", "title": "Update a policy assignment with a system assigned identity" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithOverrides.json b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithOverrides.json index 7964dc6d36d0..84030547bf7e 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithOverrides.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithOverrides.json @@ -63,4 +63,4 @@ }, "operationId": "PolicyAssignments_Update", "title": "Update a policy assignment with overrides" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithResourceSelectors.json b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithResourceSelectors.json index 8a3752cbe1c0..4c6967ba9aec 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithResourceSelectors.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithResourceSelectors.json @@ -61,4 +61,4 @@ }, "operationId": "PolicyAssignments_Update", "title": "Update a policy assignment with resource selectors" -} \ No newline at end of file +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithUserAssignedIdentity.json b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithUserAssignedIdentity.json index 108c030bbe76..1b4d76996cb7 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithUserAssignedIdentity.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/updatePolicyAssignmentWithUserAssignedIdentity.json @@ -56,4 +56,4 @@ }, "operationId": "PolicyAssignments_Update", "title": "Update a policy assignment with a user assigned identity" -} \ No newline at end of file +} From 8fb7e4e71031602b839b32672085280f0b7bdcc3 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 29 Oct 2025 14:09:40 +0800 Subject: [PATCH 04/45] fix PolicyDefinition --- .../PolicyDefinition.tsp | 128 ++++++++---------- 1 file changed, 60 insertions(+), 68 deletions(-) diff --git a/specification/resources/Authorization.Management/PolicyDefinition.tsp b/specification/resources/Authorization.Management/PolicyDefinition.tsp index 1262416c850c..583cce3149e2 100644 --- a/specification/resources/Authorization.Management/PolicyDefinition.tsp +++ b/specification/resources/Authorization.Management/PolicyDefinition.tsp @@ -46,6 +46,58 @@ alias PolicyDefinitionOps = Azure.ResourceManager.Legacy.ExtensionOperations< } >; +alias PolicyDefinitionTenantOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + }, + {}, + { + /** The name of the built-in policy definition to get. */ + @path + @segment("policyDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policyDefinitionName: string; + } +>; + +alias PolicyDefinitionManagementGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Management"; + + /** The ID of the management group. */ + @path + @segment("managementGroups") + @key + managementGroupId: string; + }, + { + ...Extension.ExtensionProviderNamespace; + }, + { + ...Extension.ExtensionProviderNamespace; + + /** The name of the policy definition to get. */ + @path + @segment("policyDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policyDefinitionName: string; + } +>; + @armResourceOperations interface PolicyDefinitions { /** @@ -88,43 +140,20 @@ interface PolicyDefinitions { $top?: int32; } >; -} -alias PolicyDefinitionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< - { - ...ApiVersionParameter; - - /** the provider namespace */ - @path - @segment("providers") - @key - providerNamespace: "Microsoft.Authorization"; - }, - {}, - { - /** The name of the built-in policy definition to get. */ - @path - @segment("policyDefinitions") - @key - @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") - policyDefinitionName: string; - } ->; -@armResourceOperations -interface PolicyDefinitionOperationGroup { - /** + /** * This operation retrieves the built-in policy definition with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitions_GetBuiltIn") - getBuiltIn is PolicyDefinitionOperationGroupOps.Read; + getBuiltIn is PolicyDefinitionTenantOps.Read; /** * 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}. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitions_ListBuiltIn") - listBuiltIn is PolicyDefinitionOperationGroupOps.List< + listBuiltIn is PolicyDefinitionTenantOps.List< PolicyDefinition, Parameters = { /** @@ -142,47 +171,13 @@ interface PolicyDefinitionOperationGroup { $top?: int32; } >; -} -alias PolicyDefinitionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< - { - ...ApiVersionParameter; - /** the provider namespace */ - @path - @segment("providers") - @key - providerNamespace: "Microsoft.Management"; - - /** The ID of the management group. */ - @path - @segment("managementGroups") - @key - managementGroupId: string; - }, - { - ...Extension.ExtensionProviderNamespace; - }, - { - ...Extension.ExtensionProviderNamespace; - - /** The name of the policy definition to get. */ - @path - @segment("policyDefinitions") - @key - @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") - policyDefinitionName: string; - } ->; - -@armResourceOperations -interface PolicyDefinitionOperationGroup { /** * This operation retrieves the policy definition in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitions_GetAtManagementGroup") - getAtManagementGroup is PolicyDefinitionOperationGroupOps.Read< - Extension.ManagementGroup, + getAtManagementGroup is PolicyDefinitionManagementGroupOps.Read< PolicyDefinition >; @@ -192,8 +187,7 @@ interface PolicyDefinitionOperationGroup { #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility" @operationId("PolicyDefinitions_CreateOrUpdateAtManagementGroup") - createOrUpdateAtManagementGroup is PolicyDefinitionOperationGroupOps.CreateOrUpdateSync< - Extension.ManagementGroup, + createOrUpdateAtManagementGroup is PolicyDefinitionManagementGroupOps.CreateOrUpdateSync< PolicyDefinition, Response = ArmResourceCreatedSyncResponse >; @@ -203,8 +197,7 @@ interface PolicyDefinitionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitions_DeleteAtManagementGroup") - deleteAtManagementGroup is PolicyDefinitionOperationGroupOps.DeleteSync< - Extension.ManagementGroup, + deleteAtManagementGroup is PolicyDefinitionManagementGroupOps.DeleteSync< PolicyDefinition >; @@ -213,8 +206,7 @@ interface PolicyDefinitionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitions_ListByManagementGroup") - listByManagementGroup is PolicyDefinitionOperationGroupOps.List< - Extension.ManagementGroup, + listByManagementGroup is PolicyDefinitionManagementGroupOps.List< PolicyDefinition, Parameters = { /** @@ -239,6 +231,6 @@ interface PolicyDefinitionOperationGroup { @@doc(PolicyDefinitions.createOrUpdate::parameters.resource, "The policy definition properties." ); -@@doc(PolicyDefinitionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, +@@doc(PolicyDefinitions.createOrUpdateAtManagementGroup::parameters.resource, "The policy definition properties." ); From d95decccb83d77d409f8b8132775a0d30fa53b54 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 29 Oct 2025 14:20:50 +0800 Subject: [PATCH 05/45] fix PolicySetDefinitionVersion --- .../PolicySetDefinitionVersion.tsp | 168 +++++++++--------- 1 file changed, 80 insertions(+), 88 deletions(-) diff --git a/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp b/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp index 595344427727..411127fb3aac 100644 --- a/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp +++ b/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp @@ -55,6 +55,79 @@ alias PolicySetDefinitionVersionOps = Azure.ResourceManager.Legacy.ExtensionOper } >; +alias PolicySetDefinitionVersionTenantOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + + /** The name of the policy set definition. */ + @path + @segment("policySetDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policySetDefinitionName: string; + }, + {}, + { + /** The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number */ + @path + @segment("versions") + @key + @pattern("^\\d+\\.\\d+\\.\\d+$") + policyDefinitionVersion: string; + } +>; + +alias PolicySetDefinitionVersionManagementGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Management"; + + /** The name of the management group. The name is case insensitive. */ + @path + @segment("managementGroups") + @key + managementGroupName: string; + }, + { + ...Extension.ExtensionProviderNamespace; + + /** The name of the policy set definition. */ + @path + @segment("policySetDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policySetDefinitionName: string; + }, + { + ...Extension.ExtensionProviderNamespace; + + /** The name of the policy set definition. */ + @path + @segment("policySetDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policySetDefinitionName: string; + + /** The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number */ + @path + @segment("versions") + @key + @pattern("^\\d+\\.\\d+\\.\\d+$") + policyDefinitionVersion: string; + } +>; + @armResourceOperations interface PolicySetDefinitionVersions { /** @@ -102,43 +175,13 @@ interface PolicySetDefinitionVersions { $top?: int32; } >; -} -alias PolicySetDefinitionVersionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< - { - ...ApiVersionParameter; - - /** the provider namespace */ - @path - @segment("providers") - @key - providerNamespace: "Microsoft.Authorization"; - - /** The name of the policy set definition. */ - @path - @segment("policySetDefinitions") - @key - @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") - policySetDefinitionName: string; - }, - {}, - { - /** The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number */ - @path - @segment("versions") - @key - @pattern("^\\d+\\.\\d+\\.\\d+$") - policyDefinitionVersion: string; - } ->; -@armResourceOperations -interface PolicySetDefinitionVersionOperationGroup { /** * This operation retrieves the built-in policy set definition version with the given name and version. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitionVersions_GetBuiltIn") - getBuiltIn is PolicySetDefinitionVersionOperationGroupOps.Read< + getBuiltIn is PolicySetDefinitionVersionTenantOps.Read< PolicySetDefinitionVersion, Parameters = { /** @@ -154,7 +197,7 @@ interface PolicySetDefinitionVersionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitionVersions_ListBuiltIn") - listBuiltIn is PolicySetDefinitionVersionOperationGroupOps.List< + listBuiltIn is PolicySetDefinitionVersionTenantOps.List< PolicySetDefinitionVersion, Parameters = { /** @@ -172,61 +215,13 @@ interface PolicySetDefinitionVersionOperationGroup { $top?: int32; } >; -} -alias PolicySetDefinitionVersionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< - { - ...ApiVersionParameter; - - /** the provider namespace */ - @path - @segment("providers") - @key - providerNamespace: "Microsoft.Management"; - /** The name of the management group. The name is case insensitive. */ - @path - @segment("managementGroups") - @key - managementGroupName: string; - }, - { - ...Extension.ExtensionProviderNamespace; - - /** The name of the policy set definition. */ - @path - @segment("policySetDefinitions") - @key - @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") - policySetDefinitionName: string; - }, - { - ...Extension.ExtensionProviderNamespace; - - /** The name of the policy set definition. */ - @path - @segment("policySetDefinitions") - @key - @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") - policySetDefinitionName: string; - - /** The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number */ - @path - @segment("versions") - @key - @pattern("^\\d+\\.\\d+\\.\\d+$") - policyDefinitionVersion: string; - } ->; - -@armResourceOperations -interface PolicySetDefinitionVersionOperationGroup { /** * This operation retrieves the policy set definition version in the given management group with the given name and version. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitionVersions_GetAtManagementGroup") - getAtManagementGroup is PolicySetDefinitionVersionOperationGroupOps.Read< - Extension.ManagementGroup, + getAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.Read< PolicySetDefinitionVersion, Parameters = { /** @@ -242,8 +237,7 @@ interface PolicySetDefinitionVersionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitionVersions_CreateOrUpdateAtManagementGroup") - createOrUpdateAtManagementGroup is PolicySetDefinitionVersionOperationGroupOps.CreateOrUpdateSync< - Extension.ManagementGroup, + createOrUpdateAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.CreateOrUpdateSync< PolicySetDefinitionVersion >; @@ -252,8 +246,7 @@ interface PolicySetDefinitionVersionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitionVersions_DeleteAtManagementGroup") - deleteAtManagementGroup is PolicySetDefinitionVersionOperationGroupOps.DeleteSync< - Extension.ManagementGroup, + deleteAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.DeleteSync< PolicySetDefinitionVersion >; @@ -262,8 +255,7 @@ interface PolicySetDefinitionVersionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitionVersions_ListByManagementGroup") - listByManagementGroup is PolicySetDefinitionVersionOperationGroupOps.List< - Extension.ManagementGroup, + listByManagementGroup is PolicySetDefinitionVersionManagementGroupOps.List< PolicySetDefinitionVersion, Parameters = { /** @@ -292,6 +284,6 @@ interface PolicySetDefinitionVersionOperationGroup { @@doc(PolicySetDefinitionVersions.createOrUpdate::parameters.resource, "The policy set definition properties." ); -@@doc(PolicySetDefinitionVersionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, +@@doc(PolicySetDefinitionVersions.createOrUpdateAtManagementGroup::parameters.resource, "The policy set definition version properties." ); From a57417a2c7a1659db6ae4b937c5a0229df25a82c Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 29 Oct 2025 14:22:22 +0800 Subject: [PATCH 06/45] fix PolicyDefinitionVersion --- .../PolicyDefinitionVersion.tsp | 136 +++++++++--------- 1 file changed, 64 insertions(+), 72 deletions(-) diff --git a/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp b/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp index 59871cf8f1f5..c81ed8749d84 100644 --- a/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp +++ b/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp @@ -55,40 +55,7 @@ alias PolicyDefinitionVersionOps = Azure.ResourceManager.Legacy.ExtensionOperati } >; -@armResourceOperations -interface PolicyDefinitionVersions { - /** - * This operation retrieves the policy definition version in the given subscription with the given name. - */ - get is PolicyDefinitionVersionOps.Read; - - /** - * This operation creates or updates a policy definition in the given subscription with the given name. - */ - createOrUpdate is PolicyDefinitionVersionOps.CreateOrUpdateSync; - - /** - * This operation deletes the policy definition version in the given subscription with the given name. - */ - delete is PolicyDefinitionVersionOps.DeleteSync; - - /** - * This operation retrieves a list of all the policy definition versions for the given policy definition. - */ - list is PolicyDefinitionVersionOps.List< - PolicyDefinitionVersion, - Parameters = { - /** - * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - */ - @maxValue(1000) - @minValue(1) - @query("$top") - $top?: int32; - } - >; -} -alias PolicyDefinitionVersionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< +alias PolicyDefinitionVersionTenantOps = Azure.ResourceManager.Legacy.ExtensionOperations< { ...ApiVersionParameter; @@ -116,34 +83,7 @@ alias PolicyDefinitionVersionOperationGroupOps = Azure.ResourceManager.Legacy.Ex } >; -@armResourceOperations -interface PolicyDefinitionVersionOperationGroup { - /** - * This operation retrieves the built-in policy definition version with the given name. - */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitionVersions_GetBuiltIn") - getBuiltIn is PolicyDefinitionVersionOperationGroupOps.Read; - - /** - * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. - */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitionVersions_ListBuiltIn") - listBuiltIn is PolicyDefinitionVersionOperationGroupOps.List< - PolicyDefinitionVersion, - Parameters = { - /** - * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - */ - @maxValue(1000) - @minValue(1) - @query("$top") - $top?: int32; - } - >; -} -alias PolicyDefinitionVersionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< +alias PolicyDefinitionVersionManagementGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< { ...ApiVersionParameter; @@ -189,14 +129,69 @@ alias PolicyDefinitionVersionOperationGroupOps = Azure.ResourceManager.Legacy.Ex >; @armResourceOperations -interface PolicyDefinitionVersionOperationGroup { +interface PolicyDefinitionVersions { + /** + * This operation retrieves the policy definition version in the given subscription with the given name. + */ + get is PolicyDefinitionVersionOps.Read; + + /** + * This operation creates or updates a policy definition in the given subscription with the given name. + */ + createOrUpdate is PolicyDefinitionVersionOps.CreateOrUpdateSync; + + /** + * This operation deletes the policy definition version in the given subscription with the given name. + */ + delete is PolicyDefinitionVersionOps.DeleteSync; + + /** + * This operation retrieves a list of all the policy definition versions for the given policy definition. + */ + list is PolicyDefinitionVersionOps.List< + PolicyDefinitionVersion, + Parameters = { + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; + + /** + * This operation retrieves the built-in policy definition version with the given name. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitionVersions_GetBuiltIn") + getBuiltIn is PolicyDefinitionVersionTenantOps.Read; + + /** + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("PolicyDefinitionVersions_ListBuiltIn") + listBuiltIn is PolicyDefinitionVersionTenantOps.List< + PolicyDefinitionVersion, + Parameters = { + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; + } + >; + /** * This operation retrieves the policy definition version in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitionVersions_GetAtManagementGroup") - getAtManagementGroup is PolicyDefinitionVersionOperationGroupOps.Read< - Extension.ManagementGroup, + getAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.Read< PolicyDefinitionVersion >; @@ -205,8 +200,7 @@ interface PolicyDefinitionVersionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitionVersions_CreateOrUpdateAtManagementGroup") - createOrUpdateAtManagementGroup is PolicyDefinitionVersionOperationGroupOps.CreateOrUpdateSync< - Extension.ManagementGroup, + createOrUpdateAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.CreateOrUpdateSync< PolicyDefinitionVersion >; @@ -215,8 +209,7 @@ interface PolicyDefinitionVersionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitionVersions_DeleteAtManagementGroup") - deleteAtManagementGroup is PolicyDefinitionVersionOperationGroupOps.DeleteSync< - Extension.ManagementGroup, + deleteAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.DeleteSync< PolicyDefinitionVersion >; @@ -225,8 +218,7 @@ interface PolicyDefinitionVersionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitionVersions_ListByManagementGroup") - listByManagementGroup is PolicyDefinitionVersionOperationGroupOps.List< - Extension.ManagementGroup, + listByManagementGroup is PolicyDefinitionVersionManagementGroupOps.List< PolicyDefinitionVersion, Parameters = { /** @@ -249,6 +241,6 @@ interface PolicyDefinitionVersionOperationGroup { @@doc(PolicyDefinitionVersions.createOrUpdate::parameters.resource, "The policy definition properties." ); -@@doc(PolicyDefinitionVersionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, +@@doc(PolicyDefinitionVersions.createOrUpdateAtManagementGroup::parameters.resource, "The policy definition properties." ); From 2e03abd69151ac95d9058f1eb02609a7c3a4bfb6 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 29 Oct 2025 14:23:42 +0800 Subject: [PATCH 07/45] fix PolicySetDefinition --- .../PolicySetDefinition.tsp | 126 ++++++++---------- 1 file changed, 59 insertions(+), 67 deletions(-) diff --git a/specification/resources/Authorization.Management/PolicySetDefinition.tsp b/specification/resources/Authorization.Management/PolicySetDefinition.tsp index 3cedb1beae3f..bd78e5de9c5e 100644 --- a/specification/resources/Authorization.Management/PolicySetDefinition.tsp +++ b/specification/resources/Authorization.Management/PolicySetDefinition.tsp @@ -46,6 +46,58 @@ alias PolicySetDefinitionOps = Azure.ResourceManager.Legacy.ExtensionOperations< } >; +alias PolicySetDefinitionTenantOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + }, + {}, + { + /** The name of the policy set definition to get. */ + @path + @segment("policySetDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policySetDefinitionName: string; + } +>; + +alias PolicySetDefinitionManagementGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Management"; + + /** The ID of the management group. */ + @path + @segment("managementGroups") + @key + managementGroupId: string; + }, + { + ...Extension.ExtensionProviderNamespace; + }, + { + ...Extension.ExtensionProviderNamespace; + + /** The name of the policy set definition to get. */ + @path + @segment("policySetDefinitions") + @key + @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") + policySetDefinitionName: string; + } +>; + @armResourceOperations interface PolicySetDefinitions { /** @@ -99,36 +151,13 @@ interface PolicySetDefinitions { $top?: int32; } >; -} -alias PolicySetDefinitionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< - { - ...ApiVersionParameter; - - /** the provider namespace */ - @path - @segment("providers") - @key - providerNamespace: "Microsoft.Authorization"; - }, - {}, - { - /** The name of the policy set definition to get. */ - @path - @segment("policySetDefinitions") - @key - @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") - policySetDefinitionName: string; - } ->; -@armResourceOperations -interface PolicySetDefinitionOperationGroup { /** * This operation retrieves the built-in policy set definition with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitions_GetBuiltIn") - getBuiltIn is PolicySetDefinitionOperationGroupOps.Read< + getBuiltIn is PolicySetDefinitionTenantOps.Read< PolicySetDefinition, Parameters = { /** @@ -144,7 +173,7 @@ interface PolicySetDefinitionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitions_ListBuiltIn") - listBuiltIn is PolicySetDefinitionOperationGroupOps.List< + listBuiltIn is PolicySetDefinitionTenantOps.List< PolicySetDefinition, Parameters = { /** @@ -168,47 +197,13 @@ interface PolicySetDefinitionOperationGroup { $top?: int32; } >; -} -alias PolicySetDefinitionOperationGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< - { - ...ApiVersionParameter; - /** the provider namespace */ - @path - @segment("providers") - @key - providerNamespace: "Microsoft.Management"; - - /** The ID of the management group. */ - @path - @segment("managementGroups") - @key - managementGroupId: string; - }, - { - ...Extension.ExtensionProviderNamespace; - }, - { - ...Extension.ExtensionProviderNamespace; - - /** The name of the policy set definition to get. */ - @path - @segment("policySetDefinitions") - @key - @pattern("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$") - policySetDefinitionName: string; - } ->; - -@armResourceOperations -interface PolicySetDefinitionOperationGroup { /** * This operation retrieves the policy set definition in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitions_GetAtManagementGroup") - getAtManagementGroup is PolicySetDefinitionOperationGroupOps.Read< - Extension.ManagementGroup, + getAtManagementGroup is PolicySetDefinitionManagementGroupOps.Read< PolicySetDefinition, Parameters = { /** @@ -224,8 +219,7 @@ interface PolicySetDefinitionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitions_CreateOrUpdateAtManagementGroup") - createOrUpdateAtManagementGroup is PolicySetDefinitionOperationGroupOps.CreateOrUpdateSync< - Extension.ManagementGroup, + createOrUpdateAtManagementGroup is PolicySetDefinitionManagementGroupOps.CreateOrUpdateSync< PolicySetDefinition >; @@ -234,8 +228,7 @@ interface PolicySetDefinitionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitions_DeleteAtManagementGroup") - deleteAtManagementGroup is PolicySetDefinitionOperationGroupOps.DeleteSync< - Extension.ManagementGroup, + deleteAtManagementGroup is PolicySetDefinitionManagementGroupOps.DeleteSync< PolicySetDefinition >; @@ -244,8 +237,7 @@ interface PolicySetDefinitionOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitions_ListByManagementGroup") - listByManagementGroup is PolicySetDefinitionOperationGroupOps.List< - Extension.ManagementGroup, + listByManagementGroup is PolicySetDefinitionManagementGroupOps.List< PolicySetDefinition, Parameters = { /** @@ -278,6 +270,6 @@ interface PolicySetDefinitionOperationGroup { @@doc(PolicySetDefinitions.createOrUpdate::parameters.resource, "The policy set definition properties." ); -@@doc(PolicySetDefinitionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, +@@doc(PolicySetDefinitions.createOrUpdateAtManagementGroup::parameters.resource, "The policy set definition properties." ); From ecafb250f7c4a01382ba864a580eec0cec2dd884 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 29 Oct 2025 14:25:20 +0800 Subject: [PATCH 08/45] fix back-compatible --- .../back-compatible.tsp | 76 +------------------ 1 file changed, 4 insertions(+), 72 deletions(-) diff --git a/specification/resources/Authorization.Management/back-compatible.tsp b/specification/resources/Authorization.Management/back-compatible.tsp index 7f02a2c20e3d..505a41496c59 100644 --- a/specification/resources/Authorization.Management/back-compatible.tsp +++ b/specification/resources/Authorization.Management/back-compatible.tsp @@ -14,104 +14,36 @@ using Microsoft.Authorization; @@clientName(PolicyDefinitions.createOrUpdate::parameters.resource, "parameters" ); -@@clientLocation(PolicyDefinitionOperationGroup.getBuiltIn, PolicyDefinitions); -@@clientLocation(PolicyDefinitionOperationGroup.listBuiltIn, PolicyDefinitions); -@@clientLocation(PolicyDefinitionOperationGroup.getAtManagementGroup, - PolicyDefinitions -); -@@clientLocation(PolicyDefinitionOperationGroup.createOrUpdateAtManagementGroup, - PolicyDefinitions -); -@@clientName(PolicyDefinitionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, +@@clientName(PolicyDefinitions.createOrUpdateAtManagementGroup::parameters.resource, "parameters" ); -@@clientLocation(PolicyDefinitionOperationGroup.deleteAtManagementGroup, - PolicyDefinitions -); -@@clientLocation(PolicyDefinitionOperationGroup.listByManagementGroup, - PolicyDefinitions -); #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." @@Legacy.flattenProperty(PolicyDefinition.properties); @@clientName(PolicyDefinitionVersions.createOrUpdate::parameters.resource, "parameters" ); -@@clientLocation(PolicyDefinitionVersionOperationGroup.getBuiltIn, - PolicyDefinitionVersions -); -@@clientLocation(PolicyDefinitionVersionOperationGroup.listBuiltIn, - PolicyDefinitionVersions -); -@@clientLocation(PolicyDefinitionVersionOperationGroup.getAtManagementGroup, - PolicyDefinitionVersions -); -@@clientLocation(PolicyDefinitionVersionOperationGroup.createOrUpdateAtManagementGroup, - PolicyDefinitionVersions -); -@@clientName(PolicyDefinitionVersionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, +@@clientName(PolicyDefinitionVersions.createOrUpdateAtManagementGroup::parameters.resource, "parameters" ); -@@clientLocation(PolicyDefinitionVersionOperationGroup.deleteAtManagementGroup, - PolicyDefinitionVersions -); -@@clientLocation(PolicyDefinitionVersionOperationGroup.listByManagementGroup, - PolicyDefinitionVersions -); #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." @@Legacy.flattenProperty(PolicyDefinitionVersion.properties); @@clientName(PolicySetDefinitions.createOrUpdate::parameters.resource, "parameters" ); -@@clientLocation(PolicySetDefinitionOperationGroup.getBuiltIn, - PolicySetDefinitions -); -@@clientLocation(PolicySetDefinitionOperationGroup.listBuiltIn, - PolicySetDefinitions -); -@@clientLocation(PolicySetDefinitionOperationGroup.getAtManagementGroup, - PolicySetDefinitions -); -@@clientLocation(PolicySetDefinitionOperationGroup.createOrUpdateAtManagementGroup, - PolicySetDefinitions -); -@@clientName(PolicySetDefinitionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, +@@clientName(PolicySetDefinitions.createOrUpdateAtManagementGroup::parameters.resource, "parameters" ); -@@clientLocation(PolicySetDefinitionOperationGroup.deleteAtManagementGroup, - PolicySetDefinitions -); -@@clientLocation(PolicySetDefinitionOperationGroup.listByManagementGroup, - PolicySetDefinitions -); #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." @@Legacy.flattenProperty(PolicySetDefinition.properties); @@clientName(PolicySetDefinitionVersions.createOrUpdate::parameters.resource, "parameters" ); -@@clientLocation(PolicySetDefinitionVersionOperationGroup.getBuiltIn, - PolicySetDefinitionVersions -); -@@clientLocation(PolicySetDefinitionVersionOperationGroup.listBuiltIn, - PolicySetDefinitionVersions -); -@@clientLocation(PolicySetDefinitionVersionOperationGroup.getAtManagementGroup, - PolicySetDefinitionVersions -); -@@clientLocation(PolicySetDefinitionVersionOperationGroup.createOrUpdateAtManagementGroup, - PolicySetDefinitionVersions -); -@@clientName(PolicySetDefinitionVersionOperationGroup.createOrUpdateAtManagementGroup::parameters.resource, +@@clientName(PolicySetDefinitionVersions.createOrUpdateAtManagementGroup::parameters.resource, "parameters" ); -@@clientLocation(PolicySetDefinitionVersionOperationGroup.deleteAtManagementGroup, - PolicySetDefinitionVersions -); -@@clientLocation(PolicySetDefinitionVersionOperationGroup.listByManagementGroup, - PolicySetDefinitionVersions -); #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." @@Legacy.flattenProperty(PolicySetDefinitionVersion.properties); From 85eb40d60e9431fd49ac92e129951aebad233974 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 29 Oct 2025 14:25:33 +0800 Subject: [PATCH 09/45] format --- .../Authorization.Management/PolicyDefinition.tsp | 10 +++------- .../PolicyDefinitionVersion.tsp | 12 +++--------- .../Authorization.Management/PolicySetDefinition.tsp | 8 ++------ .../PolicySetDefinitionVersion.tsp | 8 ++------ 4 files changed, 10 insertions(+), 28 deletions(-) diff --git a/specification/resources/Authorization.Management/PolicyDefinition.tsp b/specification/resources/Authorization.Management/PolicyDefinition.tsp index 583cce3149e2..2039c7a64eac 100644 --- a/specification/resources/Authorization.Management/PolicyDefinition.tsp +++ b/specification/resources/Authorization.Management/PolicyDefinition.tsp @@ -141,7 +141,7 @@ interface PolicyDefinitions { } >; - /** + /** * This operation retrieves the built-in policy definition with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @@ -177,9 +177,7 @@ interface PolicyDefinitions { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitions_GetAtManagementGroup") - getAtManagementGroup is PolicyDefinitionManagementGroupOps.Read< - PolicyDefinition - >; + getAtManagementGroup is PolicyDefinitionManagementGroupOps.Read; /** * This operation creates or updates a policy definition in the given management group with the given name. @@ -197,9 +195,7 @@ interface PolicyDefinitions { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitions_DeleteAtManagementGroup") - deleteAtManagementGroup is PolicyDefinitionManagementGroupOps.DeleteSync< - PolicyDefinition - >; + deleteAtManagementGroup is PolicyDefinitionManagementGroupOps.DeleteSync; /** * 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}. diff --git a/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp b/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp index c81ed8749d84..f4451294fb1f 100644 --- a/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp +++ b/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp @@ -191,27 +191,21 @@ interface PolicyDefinitionVersions { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitionVersions_GetAtManagementGroup") - getAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.Read< - PolicyDefinitionVersion - >; + getAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.Read; /** * This operation creates or updates a policy definition version in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitionVersions_CreateOrUpdateAtManagementGroup") - createOrUpdateAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.CreateOrUpdateSync< - PolicyDefinitionVersion - >; + createOrUpdateAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.CreateOrUpdateSync; /** * This operation deletes the policy definition in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicyDefinitionVersions_DeleteAtManagementGroup") - deleteAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.DeleteSync< - PolicyDefinitionVersion - >; + deleteAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.DeleteSync; /** * This operation retrieves a list of all the policy definition versions for the given policy definition in the given management group. diff --git a/specification/resources/Authorization.Management/PolicySetDefinition.tsp b/specification/resources/Authorization.Management/PolicySetDefinition.tsp index bd78e5de9c5e..195e2e647472 100644 --- a/specification/resources/Authorization.Management/PolicySetDefinition.tsp +++ b/specification/resources/Authorization.Management/PolicySetDefinition.tsp @@ -219,18 +219,14 @@ interface PolicySetDefinitions { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitions_CreateOrUpdateAtManagementGroup") - createOrUpdateAtManagementGroup is PolicySetDefinitionManagementGroupOps.CreateOrUpdateSync< - PolicySetDefinition - >; + createOrUpdateAtManagementGroup is PolicySetDefinitionManagementGroupOps.CreateOrUpdateSync; /** * This operation deletes the policy set definition in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitions_DeleteAtManagementGroup") - deleteAtManagementGroup is PolicySetDefinitionManagementGroupOps.DeleteSync< - PolicySetDefinition - >; + deleteAtManagementGroup is PolicySetDefinitionManagementGroupOps.DeleteSync; /** * 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}. diff --git a/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp b/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp index 411127fb3aac..f3c0724ecee2 100644 --- a/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp +++ b/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp @@ -237,18 +237,14 @@ interface PolicySetDefinitionVersions { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitionVersions_CreateOrUpdateAtManagementGroup") - createOrUpdateAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.CreateOrUpdateSync< - PolicySetDefinitionVersion - >; + createOrUpdateAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.CreateOrUpdateSync; /** * This operation deletes the policy set definition version in the given management group with the given name and version. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @operationId("PolicySetDefinitionVersions_DeleteAtManagementGroup") - deleteAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.DeleteSync< - PolicySetDefinitionVersion - >; + deleteAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.DeleteSync; /** * This operation retrieves a list of all the policy set definition versions for the given policy set definition in a given management group. From 4857ebc60dc58bd14943841899b2ba35db1e5a4d Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 29 Oct 2025 14:26:54 +0800 Subject: [PATCH 10/45] fix model --- specification/resources/Authorization.Management/models.tsp | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/resources/Authorization.Management/models.tsp b/specification/resources/Authorization.Management/models.tsp index 664cdadc156a..800f37f05fda 100644 --- a/specification/resources/Authorization.Management/models.tsp +++ b/specification/resources/Authorization.Management/models.tsp @@ -578,7 +578,6 @@ model ParameterDefinitionsValue { /** * The allowed values for the parameter. */ - @identifiers(#[]) allowedValues?: unknown[]; /** From 998a2894b483486a7ca5a45e288e68c703021299 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 29 Oct 2025 14:37:36 +0800 Subject: [PATCH 11/45] fix warning --- .../Authorization.Management/PolicyAssignment.tsp | 1 - .../resources/Authorization.Management/main.tsp | 2 ++ .../resources/Authorization.Management/models.tsp | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/specification/resources/Authorization.Management/PolicyAssignment.tsp b/specification/resources/Authorization.Management/PolicyAssignment.tsp index 80b5b0ba179c..1843a153c490 100644 --- a/specification/resources/Authorization.Management/PolicyAssignment.tsp +++ b/specification/resources/Authorization.Management/PolicyAssignment.tsp @@ -13,7 +13,6 @@ namespace Microsoft.Authorization; /** * The policy assignment. */ -@extensionResource model PolicyAssignment is Azure.ResourceManager.ExtensionResource { ...ResourceNameParameter< diff --git a/specification/resources/Authorization.Management/main.tsp b/specification/resources/Authorization.Management/main.tsp index cf5bf3cd116d..6ff11e356484 100644 --- a/specification/resources/Authorization.Management/main.tsp +++ b/specification/resources/Authorization.Management/main.tsp @@ -26,6 +26,8 @@ using Azure.ResourceManager.Foundations; using Azure.Core; using Azure.ResourceManager; using TypeSpec.Versioning; + +#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "For backward compatibility" /** * To manage and control access to your resources, you can define customized policies and assign them at a scope. */ diff --git a/specification/resources/Authorization.Management/models.tsp b/specification/resources/Authorization.Management/models.tsp index 800f37f05fda..d3437fbbb63c 100644 --- a/specification/resources/Authorization.Management/models.tsp +++ b/specification/resources/Authorization.Management/models.tsp @@ -310,6 +310,7 @@ model PolicyAssignmentProperties { /** * The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" metadata?: unknown; /** @@ -354,6 +355,7 @@ model ParameterValuesValue { /** * The value of the parameter. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" value?: unknown; } @@ -537,11 +539,13 @@ model PolicyDefinitionProperties { /** * The policy rule. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" policyRule?: unknown; /** * The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" metadata?: unknown; /** @@ -583,11 +587,13 @@ model ParameterDefinitionsValue { /** * The default value for the parameter if no value is provided. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" defaultValue?: unknown; /** * Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" schema?: unknown; /** @@ -660,6 +666,7 @@ model ExternalEvaluationEndpointSettings { /** * The details of the endpoint. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" details?: unknown; } @@ -691,11 +698,13 @@ model PolicyDefinitionVersionProperties { /** * The policy rule. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" policyRule?: unknown; /** * The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" metadata?: unknown; /** @@ -738,6 +747,7 @@ model PolicySetDefinitionProperties { /** * The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" metadata?: unknown; /** @@ -865,6 +875,7 @@ model PolicySetDefinitionVersionProperties { /** * The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" metadata?: unknown; /** @@ -923,6 +934,7 @@ model PolicyTokenOperation { /** * The payload of the resource operation. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" content?: unknown; } @@ -949,6 +961,7 @@ model PolicyTokenResponse { /** * An array of external evaluation endpoint invocation results. */ + @OpenAPI.extension("x-ms-identifiers", #[]) results?: ExternalEvaluationEndpointInvocationResult[]; /** @@ -1001,6 +1014,7 @@ model ExternalEvaluationEndpointInvocationResult { /** * The set of claims that will be attached to the policy token as an attestation for the result of the endpoint invocation. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "For backward compatibility" claims?: unknown; /** From 163413bc00f8a4a6856bf28b47f06ffacf1ddd1e Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 29 Oct 2025 14:39:14 +0800 Subject: [PATCH 12/45] regen --- .../examples/acquirePolicyToken.json | 54 +- .../acquirePolicyTokenAtManagementGroup.json | 52 +- .../createOrUpdatePolicyDefinition.json | 98 +- ...rUpdatePolicyDefinitionAdvancedParams.json | 128 +- ...datePolicyDefinitionAtManagementGroup.json | 98 +- ...ExternalEvaluationEnforcementSettings.json | 110 +- ...createOrUpdatePolicyDefinitionVersion.json | 140 +- ...icyDefinitionVersionAtManagementGroup.json | 140 +- .../createOrUpdatePolicySetDefinition.json | 86 +- ...ePolicySetDefinitionAtManagementGroup.json | 82 +- ...ateOrUpdatePolicySetDefinitionVersion.json | 86 +- ...SetDefinitionVersionAtManagementGroup.json | 86 +- ...OrUpdatePolicySetDefinitionWithGroups.json | 116 +- ...DefinitionWithGroupsAtManagementGroup.json | 116 +- .../examples/createPolicyAssignment.json | 58 +- ...PolicyAssignmentNonComplianceMessages.json | 38 +- ...PolicyAssignmentWithEnrollEnforcement.json | 40 +- .../createPolicyAssignmentWithIdentity.json | 54 +- .../createPolicyAssignmentWithOverrides.json | 66 +- ...PolicyAssignmentWithResourceSelectors.json | 44 +- ...icyAssignmentWithUserAssignedIdentity.json | 62 +- ...atePolicyAssignmentWithoutEnforcement.json | 40 +- .../examples/deletePolicyAssignment.json | 30 +- .../examples/deletePolicyDefinition.json | 8 +- ...letePolicyDefinitionAtManagementGroup.json | 8 +- .../deletePolicyDefinitionVersion.json | 8 +- ...icyDefinitionVersionAtManagementGroup.json | 8 +- .../examples/deletePolicySetDefinition.json | 8 +- ...ePolicySetDefinitionAtManagementGroup.json | 8 +- .../deletePolicySetDefinitionVersion.json | 10 +- ...SetDefinitionVersionAtManagementGroup.json | 8 +- .../getBuiltInPolicySetDefinition.json | 54 +- .../getBuiltInPolicySetDefinitionVersion.json | 48 +- .../examples/getBuiltinPolicyDefinition.json | 42 +- .../getBuiltinPolicyDefinitionVersion.json | 34 +- .../examples/getPolicyAssignment.json | 32 +- .../getPolicyAssignmentWithIdentity.json | 44 +- .../getPolicyAssignmentWithOverrides.json | 40 +- ...PolicyAssignmentWithResourceSelectors.json | 36 +- ...icyAssignmentWithUserAssignedIdentity.json | 52 +- .../examples/getPolicyDefinition.json | 66 +- .../getPolicyDefinitionAtManagementGroup.json | 62 +- .../examples/getPolicyDefinitionVersion.json | 58 +- ...icyDefinitionVersionAtManagementGroup.json | 54 +- .../examples/getPolicySetDefinition.json | 48 +- ...tPolicySetDefinitionAtManagementGroup.json | 40 +- .../getPolicySetDefinitionVersion.json | 44 +- ...SetDefinitionVersionAtManagementGroup.json | 34 +- ...istAllBuiltInPolicyDefinitionVersions.json | 80 +- ...AllBuiltInPolicySetDefinitionVersions.json | 44 +- .../listAllPolicyDefinitionVersions.json | 60 +- ...cyDefinitionVersionsByManagementGroup.json | 94 +- .../listAllPolicySetDefinitionVersions.json | 34 +- ...etDefinitionVersionsByManagementGroup.json | 70 +- .../listBuiltInPolicyDefinitionVersions.json | 84 +- .../listBuiltInPolicyDefinitions.json | 112 +- ...istBuiltInPolicySetDefinitionVersions.json | 48 +- .../listBuiltInPolicySetDefinitions.json | 50 +- ...listPolicyAssignmentsForResourceGroup.json | 52 +- .../listPolicyDefinitionVersions.json | 60 +- ...cyDefinitionVersionsByManagementGroup.json | 94 +- .../examples/listPolicyDefinitions.json | 102 +- ...istPolicyDefinitionsByManagementGroup.json | 92 +- .../listPolicySetDefinitionVersions.json | 34 +- ...etDefinitionVersionsByManagementGroup.json | 34 +- .../examples/listPolicySetDefinitions.json | 82 +- ...PolicySetDefinitionsByManagementGroup.json | 78 +- .../updatePolicyAssignmentWithIdentity.json | 50 +- .../updatePolicyAssignmentWithOverrides.json | 50 +- ...PolicyAssignmentWithResourceSelectors.json | 42 +- ...icyAssignmentWithUserAssignedIdentity.json | 58 +- .../stable/2025-03-01/openapi.json | 4263 +++++++++++++++++ .../stable/2025-03-01/policyAssignments.json | 1098 ----- .../2025-03-01/policyDefinitionVersions.json | 854 ---- .../stable/2025-03-01/policyDefinitions.json | 751 --- .../policySetDefinitionVersions.json | 852 ---- .../2025-03-01/policySetDefinitions.json | 761 --- .../stable/2025-03-01/policyTokens.json | 368 -- 78 files changed, 6425 insertions(+), 6704 deletions(-) create mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json delete mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyAssignments.json delete mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyDefinitionVersions.json delete mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyDefinitions.json delete mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policySetDefinitionVersions.json delete mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policySetDefinitions.json delete mode 100644 specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyTokens.json diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/acquirePolicyToken.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/acquirePolicyToken.json index ab7aa1eeeb3f..b91d59b10de2 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/acquirePolicyToken.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/acquirePolicyToken.json @@ -1,62 +1,64 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "api-version": "2025-03-01", "parameters": { "operation": { - "uri": "https://management.azure.com/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM?api-version=2024-01-01", - "httpMethod": "delete" + "httpMethod": "delete", + "uri": "https://management.azure.com/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM?api-version=2024-01-01" } - } + }, + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { "body": { + "expiration": "2025-01-01T21:30:00.00Z", "result": "Succeeded", "results": [ { - "policyInfo": { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/5ed64d02", - "policyAssignmentId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/3f2def86" - }, - "result": "Succeeded", - "message": "Coin flip successful (success probability: '1').", "claims": { + "date": "2025-01-01T19:30:00.00Z", + "double": 0.99, + "int": 2, "isValid": false, "string": "testString", - "int": 2, - "double": 0.99, - "date": "2025-01-01T19:30:00.00Z", + "testArray": [ + "Apple", + "Banana", + "Cherry" + ], "testObject": { - "id": 12345, "name": "Complex Object", + "id": 12345, "details": { "createdBy": "John Doe", "createdDate": "2024-12-13T12:00:00Z", "metadata": { - "version": "1.0.0", "isActive": true, "tags": [ "example", "test", "object" - ] + ], + "version": "1.0.0" } } - }, - "testArray": [ - "Apple", - "Banana", - "Cherry" - ] + } + }, + "expiration": "2025-01-01T21:30:00.00Z", + "message": "Coin flip successful (success probability: '1').", + "policyInfo": { + "policyAssignmentId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/3f2def86", + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/5ed64d02" }, - "expiration": "2025-01-01T21:30:00.00Z" + "result": "Succeeded" } ], "token": "PoP 7zmVse52pjMKPQd5m2uiNjz5UV2pZ.LPGtRiTeuCDBomEVbzj9kIaL9odEmlNv4D9VzyrQLTAyv4HHnUR7oNytWnL.AQrZ5bSGAQZzr8eySqvugzrD-ceRVL311SL3Nn6f-4c9kgPgU_u1ArXQKW25QCxMlsAuWmaE", - "tokenId": "0da8a969-c660-4de0-a6a4-b2034d4325e4", - "expiration": "2025-01-01T21:30:00.00Z" + "tokenId": "0da8a969-c660-4de0-a6a4-b2034d4325e4" } } - } + }, + "operationId": "PolicyTokens_Acquire", + "title": "Acquire a policy token" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/acquirePolicyTokenAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/acquirePolicyTokenAtManagementGroup.json index d5ce160843d1..b4d77d1c792d 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/acquirePolicyTokenAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/acquirePolicyTokenAtManagementGroup.json @@ -1,62 +1,64 @@ { "parameters": { - "managementGroupName": "MyManagementGroup", "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup", "parameters": { "operation": { - "uri": "https://management.azure.com/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/roleAssignments/00000000-0000-0000-0000-000000000000?api-version=2022-04-01", - "httpMethod": "delete" + "httpMethod": "delete", + "uri": "https://management.azure.com/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/roleAssignments/00000000-0000-0000-0000-000000000000?api-version=2022-04-01" } } }, "responses": { "200": { "body": { + "expiration": "2025-01-01T21:30:00.00Z", "result": "Succeeded", "results": [ { - "policyInfo": { - "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/5ed64d02", - "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/3f2def86" - }, - "result": "Succeeded", - "message": "Coin flip successful (success probability: '1').", "claims": { + "date": "2025-01-01T19:30:00.00Z", + "double": 0.99, + "int": 2, "isValid": false, "string": "testString", - "int": 2, - "double": 0.99, - "date": "2025-01-01T19:30:00.00Z", + "testArray": [ + "Apple", + "Banana", + "Cherry" + ], "testObject": { - "id": 12345, "name": "Complex Object", + "id": 12345, "details": { "createdBy": "John Doe", "createdDate": "2024-12-13T12:00:00Z", "metadata": { - "version": "1.0.0", "isActive": true, "tags": [ "example", "test", "object" - ] + ], + "version": "1.0.0" } } - }, - "testArray": [ - "Apple", - "Banana", - "Cherry" - ] + } + }, + "expiration": "2025-01-01T21:30:00.00Z", + "message": "Coin flip successful (success probability: '1').", + "policyInfo": { + "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/3f2def86", + "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/5ed64d02" }, - "expiration": "2025-01-01T21:30:00.00Z" + "result": "Succeeded" } ], "token": "PoP 7zmVse52pjMKPQd5m2uiNjz5UV2pZ.LPGtRiTeuCDBomEVbzj9kIaL9odEmlNv4D9VzyrQLTAyv4HHnUR7oNytWnL.AQrZ5bSGAQZzr8eySqvugzrD-ceRVL311SL3Nn6f-4c9kgPgU_u1ArXQKW25QCxMlsAuWmaE", - "tokenId": "0da8a969-c660-4de0-a6a4-b2034d4325e4", - "expiration": "2025-01-01T21:30:00.00Z" + "tokenId": "0da8a969-c660-4de0-a6a4-b2034d4325e4" } } - } + }, + "operationId": "PolicyTokens_AcquireAtManagementGroup", + "title": "Acquire a policy token at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinition.json index 67c0bfce97f2..91438d92bc62 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinition.json @@ -1,95 +1,97 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyDefinitionName": "ResourceNaming", "api-version": "2025-03-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'", + "displayName": "Enforce resource naming convention", "metadata": { "category": "Naming" }, - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } } } - } + }, + "policyDefinitionName": "ResourceNaming", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "201": { - "headers": {}, "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "type": "Microsoft.Authorization/policyDefinitions", "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] } - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitions_CreateOrUpdate", + "title": "Create or update a policy definition" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json index c0088f8a738d..58db388be568 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json @@ -1,20 +1,35 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyDefinitionName": "EventHubDiagnosticLogs", "api-version": "2025-03-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", + "displayName": "Event Hubs should have diagnostic logging enabled", "metadata": { "category": "Event Hub" }, + "mode": "Indexed", + "parameters": { + "requiredRetentionDays": { + "type": "Integer", + "allowedValues": [ + 0, + 30, + 90, + 180, + 365 + ], + "defaultValue": 365, + "metadata": { + "description": "The required diagnostic logs retention in days", + "displayName": "Required retention (days)" + } + } + }, "policyRule": { "if": { - "field": "type", - "equals": "Microsoft.EventHub/namespaces" + "equals": "Microsoft.EventHub/namespaces", + "field": "type" }, "then": { "effect": "AuditIfNotExists", @@ -23,61 +38,57 @@ "existenceCondition": { "allOf": [ { - "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled", - "equals": "true" + "equals": "true", + "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled" }, { - "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days", - "equals": "[parameters('requiredRetentionDays')]" + "equals": "[parameters('requiredRetentionDays')]", + "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days" } ] } } } - }, - "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" - } - } } } - } + }, + "policyDefinitionName": "EventHubDiagnosticLogs", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "201": { - "headers": {}, "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "type": "Microsoft.Authorization/policyDefinitions", "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/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", + "displayName": "Event Hubs should have diagnostic logging enabled", "metadata": { "category": "Event Hub" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], + "mode": "Indexed", + "parameters": { + "requiredRetentionDays": { + "type": "Integer", + "allowedValues": [ + 0, + 30, + 90, + 180, + 365 + ], + "defaultValue": 365, + "metadata": { + "description": "The required diagnostic logs retention in days", + "displayName": "Required retention (days)" + } + } + }, "policyRule": { "if": { - "field": "type", - "equals": "Microsoft.EventHub/namespaces" + "equals": "Microsoft.EventHub/namespaces", + "field": "type" }, "then": { "effect": "AuditIfNotExists", @@ -86,37 +97,28 @@ "existenceCondition": { "allOf": [ { - "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled", - "equals": "true" + "equals": "true", + "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled" }, { - "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days", - "equals": "[parameters('requiredRetentionDays')]" + "equals": "[parameters('requiredRetentionDays')]", + "field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days" } ] } } } }, - "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" - } - } - } + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] } - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitions_CreateOrUpdate", + "title": "Create or update a policy definition with advanced parameters" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json index dfad853cc2c8..140f26107013 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json @@ -1,95 +1,97 @@ { "parameters": { - "managementGroupId": "MyManagementGroup", - "policyDefinitionName": "ResourceNaming", "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup", "parameters": { "properties": { - "mode": "All", - "displayName": "Enforce resource naming convention", "description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'", + "displayName": "Enforce resource naming convention", "metadata": { "category": "Naming" }, - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } } } - } + }, + "policyDefinitionName": "ResourceNaming" }, "responses": { "201": { - "headers": {}, "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "type": "Microsoft.Authorization/policyDefinitions", "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] } - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitions_CreateOrUpdateAtManagementGroup", + "title": "Create or update a policy definition at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json index a629d1a47c0b..66a1862463c8 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json @@ -1,85 +1,91 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyDefinitionName": "RandomizeVMAllocation", "api-version": "2025-03-01", "parameters": { "properties": { - "mode": "Indexed", - "displayName": "Randomize VM Allocation", "description": "Randomly disable VM allocation in eastus by having policy rule reference the outcome of invoking an external endpoint using the CoinFlip endpoint that returns random values.", + "displayName": "Randomize VM Allocation", + "externalEvaluationEnforcementSettings": { + "endpointSettings": { + "kind": "CoinFlip", + "details": { + "successProbability": 0.5 + } + }, + "missingTokenAction": "audit", + "roleDefinitionIds": [ + "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/roleDefinitions/f0cc2aea-b517-48f6-8f9e-0c01c687907b" + ] + }, "metadata": { "category": "VM" }, + "mode": "Indexed", "policyRule": { "if": { "allOf": [ { - "field": "type", - "equals": "Microsoft.Compute/virtualMachines" + "equals": "Microsoft.Compute/virtualMachines", + "field": "type" }, { - "field": "location", - "equals": "eastus" + "equals": "eastus", + "field": "location" }, { - "value": "[claims().isValid]", - "equals": "false" + "equals": "false", + "value": "[claims().isValid]" } ] }, "then": { "effect": "deny" } - }, - "externalEvaluationEnforcementSettings": { - "missingTokenAction": "audit", - "endpointSettings": { - "kind": "CoinFlip", - "details": { - "successProbability": 0.5 - } - }, - "roleDefinitionIds": [ - "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/roleDefinitions/f0cc2aea-b517-48f6-8f9e-0c01c687907b" - ] } } - } + }, + "policyDefinitionName": "RandomizeVMAllocation", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "201": { - "headers": {}, "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/RandomizeVMAllocation", - "type": "Microsoft.Authorization/policyDefinitions", "name": "RandomizeVMAllocation", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/RandomizeVMAllocation", "properties": { - "mode": "Indexed", - "displayName": "Randomize VM Allocation", "description": "Randomly disable VM allocation in eastus by having policy rule reference the outcome of invoking an external endpoint using the CoinFlip endpoint that returns random values.", + "displayName": "Randomize VM Allocation", + "externalEvaluationEnforcementSettings": { + "endpointSettings": { + "kind": "CoinFlip", + "details": { + "successProbability": 0.5 + } + }, + "missingTokenAction": "audit", + "roleDefinitionIds": [ + "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/roleDefinitions/f0cc2aea-b517-48f6-8f9e-0c01c687907b" + ] + }, "metadata": { "category": "VM" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], + "mode": "Indexed", "policyRule": { "if": { "allOf": [ { - "field": "type", - "equals": "Microsoft.Compute/virtualMachines" + "equals": "Microsoft.Compute/virtualMachines", + "field": "type" }, { - "field": "location", - "equals": "eastus" + "equals": "eastus", + "field": "location" }, { - "value": "[claims().isValid]", - "equals": "false" + "equals": "false", + "value": "[claims().isValid]" } ] }, @@ -87,21 +93,17 @@ "effect": "deny" } }, - "externalEvaluationEnforcementSettings": { - "missingTokenAction": "audit", - "endpointSettings": { - "kind": "CoinFlip", - "details": { - "successProbability": 0.5 - } - }, - "roleDefinitionIds": [ - "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/roleDefinitions/f0cc2aea-b517-48f6-8f9e-0c01c687907b" - ] - }, - "policyType": "Custom" + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] } - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitions_CreateOrUpdate", + "title": "Create or update a policy definition with external evaluation enforcement settings" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionVersion.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionVersion.json index a91f163f900f..5bbb045374f8 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionVersion.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionVersion.json @@ -1,108 +1,77 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyDefinitionName": "ResourceNaming", - "policyDefinitionVersion": "1.2.1", "api-version": "2025-03-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'", + "displayName": "Enforce resource naming convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } - } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "version": "1.2.1" } - } + }, + "policyDefinitionName": "ResourceNaming", + "policyDefinitionVersion": "1.2.1", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" - } - } - }, - "201": { - "headers": {}, - "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", - "name": "1.2.1", - "properties": { - "mode": "All", - "displayName": "Naming Convention", - "description": "Force resource names to begin with 'prefix' and end with 'suffix'", - "metadata": { - "category": "Naming" - }, - "version": "1.2.1", "policyRule": { "if": { "not": { @@ -114,25 +83,58 @@ "effect": "deny" } }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + "headers": {} + }, + "201": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" } - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_CreateOrUpdate", + "title": "Create or update a policy definition version" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json index 00d18dd67ceb..ccc91d11b970 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json @@ -1,108 +1,77 @@ { "parameters": { - "managementGroupName": "MyManagementGroup", - "policyDefinitionName": "ResourceNaming", - "policyDefinitionVersion": "1.2.1", "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup", "parameters": { "properties": { - "mode": "All", - "displayName": "Enforce resource naming convention", "description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'", + "displayName": "Enforce resource naming convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } - } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "version": "1.2.1" } - } + }, + "policyDefinitionName": "ResourceNaming", + "policyDefinitionVersion": "1.2.1" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" - } - } - }, - "201": { - "headers": {}, - "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", - "name": "1.2.1", - "properties": { - "mode": "All", - "displayName": "Naming Convention", - "description": "Force resource names to begin with 'prefix' and end with 'suffix'", - "metadata": { - "category": "Naming" - }, - "version": "1.2.1", "policyRule": { "if": { "not": { @@ -114,25 +83,58 @@ "effect": "deny" } }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + "headers": {} + }, + "201": { + "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" } - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_CreateOrUpdateAtManagementGroup", + "title": "Create or update a policy definition version at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinition.json index ef7e08b69614..0dd02b6ce0ba 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinition.json @@ -1,12 +1,10 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policySetDefinitionName": "CostManagement", "api-version": "2025-03-01", "parameters": { "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, @@ -21,8 +19,6 @@ }, "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -30,11 +26,11 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "[parameters('namePrefix')]" @@ -42,30 +38,28 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } ] } - } + }, + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { - "201": { - "headers": {}, + "200": { "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "type": "Microsoft.Authorization/policySetDefinitions", "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "parameters": { "namePrefix": { "type": "String", @@ -77,9 +71,6 @@ }, "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", - "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -87,12 +78,11 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "[parameters('namePrefix')]" @@ -100,21 +90,23 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } ] } - } + }, + "headers": {} }, - "200": { - "headers": {}, + "201": { "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "type": "Microsoft.Authorization/policySetDefinitions", "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, @@ -129,8 +121,7 @@ }, "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", - "policyDefinitionReferenceId": "Limit_Skus", + "definitionVersion": "1.*.*", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -138,11 +129,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "policyDefinitionReferenceId": "Resource_Naming", + "definitionVersion": "1.*.*", "parameters": { "prefix": { "value": "[parameters('namePrefix')]" @@ -150,11 +142,21 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] } - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitions_CreateOrUpdate", + "title": "Create or update a policy set definition" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json index 4127fe0bb59e..adf5a31305ef 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json @@ -1,19 +1,16 @@ { "parameters": { - "managementGroupId": "MyManagementGroup", - "policySetDefinitionName": "CostManagement", "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup", "parameters": { "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "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": [ @@ -21,11 +18,11 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -33,35 +30,30 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } ] } - } + }, + "policySetDefinitionName": "CostManagement" }, "responses": { - "201": { - "headers": {}, + "200": { "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "type": "Microsoft.Authorization/policySetDefinitions", "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -69,12 +61,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -82,29 +74,29 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } ] } - } + }, + "headers": {} }, - "200": { - "headers": {}, + "201": { "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "type": "Microsoft.Authorization/policySetDefinitions", "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -112,12 +104,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -125,11 +117,21 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] } - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitions_CreateOrUpdateAtManagementGroup", + "title": "Create or update a policy set definition at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionVersion.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionVersion.json index 0a5b284e5a73..f1aa0608b1db 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionVersion.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionVersion.json @@ -1,17 +1,13 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policySetDefinitionName": "CostManagement", - "policyDefinitionVersion": "1.2.1", "api-version": "2025-03-01", "parameters": { "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", "parameters": { "namePrefix": { "type": "String", @@ -23,8 +19,6 @@ }, "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -32,11 +26,11 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "[parameters('namePrefix')]" @@ -44,26 +38,30 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } - ] + ], + "version": "1.2.1" } - } + }, + "policyDefinitionVersion": "1.2.1", + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { - "201": { - "headers": {}, + "200": { "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", "parameters": { "namePrefix": { "type": "String", @@ -75,9 +73,7 @@ }, "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -85,12 +81,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "[parameters('namePrefix')]" @@ -98,25 +94,27 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } - ] + ], + "version": "1.2.1" } - } + }, + "headers": {} }, - "200": { - "headers": {}, + "201": { "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", "parameters": { "namePrefix": { "type": "String", @@ -128,9 +126,7 @@ }, "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -138,12 +134,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "[parameters('namePrefix')]" @@ -151,11 +147,17 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } - ] + ], + "version": "1.2.1" } - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_CreateOrUpdate", + "title": "Create or update a policy set definition version" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json index 8acf8598ccec..079604c3768d 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json @@ -1,21 +1,16 @@ { "parameters": { - "managementGroupName": "MyManagementGroup", - "policySetDefinitionName": "CostManagement", - "policyDefinitionVersion": "1.2.1", "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup", "parameters": { "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -23,11 +18,11 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -35,31 +30,32 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } - ] + ], + "version": "1.2.1" } - } + }, + "policyDefinitionVersion": "1.2.1", + "policySetDefinitionName": "CostManagement" }, "responses": { - "201": { - "headers": {}, + "200": { "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", - "name": "1.2.1", + "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -67,12 +63,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -80,29 +76,29 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } ] } - } + }, + "headers": {} }, - "200": { - "headers": {}, + "201": { "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "type": "Microsoft.Authorization/policySetDefinitions", - "name": "CostManagement", + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -110,12 +106,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -123,11 +119,17 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } - ] + ], + "version": "1.2.1" } - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_CreateOrUpdateAtManagementGroup", + "title": "Create or update a policy set definition version at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json index fd6f4b9e25d9..4bc6d042bb4a 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json @@ -1,32 +1,28 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policySetDefinitionName": "CostManagement", "api-version": "2025-03-01", "parameters": { "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, "policyDefinitionGroups": [ { "name": "CostSaving", - "displayName": "Cost Management Policies", - "description": "Policies designed to control spend within a subscription." + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" }, { "name": "Organizational", - "displayName": "Organizational Policies", - "description": "Policies that help enforce resource organization standards within a subscription." + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" } ], "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "groupNames": [ "CostSaving" ], @@ -37,12 +33,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "groupNames": [ "Organizational" ], @@ -53,47 +49,43 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } ] } - } + }, + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { - "201": { - "headers": {}, + "200": { "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "type": "Microsoft.Authorization/policySetDefinitions", "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyDefinitionGroups": [ { "name": "CostSaving", - "displayName": "Cost Management Policies", - "description": "Policies designed to control spend within a subscription." + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" }, { "name": "Organizational", - "displayName": "Organizational Policies", - "description": "Policies that help enforce resource organization standards within a subscription." + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" } ], "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "groupNames": [ "CostSaving" ], @@ -104,12 +96,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "groupNames": [ "Organizational" ], @@ -120,46 +112,46 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] } - } + }, + "headers": {} }, - "200": { - "headers": {}, + "201": { "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "type": "Microsoft.Authorization/policySetDefinitions", "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyDefinitionGroups": [ { "name": "CostSaving", - "displayName": "Cost Management Policies", - "description": "Policies designed to control spend within a subscription." + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" }, { "name": "Organizational", - "displayName": "Organizational Policies", - "description": "Policies that help enforce resource organization standards within a subscription." + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" } ], "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "groupNames": [ "CostSaving" ], @@ -170,12 +162,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "groupNames": [ "Organizational" ], @@ -186,11 +178,21 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] } - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitions_CreateOrUpdate", + "title": "Create or update a policy set definition with groups" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json index 529e8355de04..e5e142d22577 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json @@ -1,31 +1,28 @@ { "parameters": { - "managementGroupId": "MyManagementGroup", - "policySetDefinitionName": "CostManagement", "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup", "parameters": { "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, "policyDefinitionGroups": [ { "name": "CostSaving", - "displayName": "Cost Management Policies", - "description": "Policies designed to control spend within a subscription." + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" }, { "name": "Organizational", - "displayName": "Organizational Policies", - "description": "Policies that help enforce resource organization standards within a subscription." + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" } ], "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", - "policyDefinitionReferenceId": "Limit_Skus", "groupNames": [ "CostSaving" ], @@ -36,11 +33,11 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "policyDefinitionReferenceId": "Resource_Naming", "groupNames": [ "Organizational" ], @@ -51,47 +48,42 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } ] } - } + }, + "policySetDefinitionName": "CostManagement" }, "responses": { - "201": { - "headers": {}, + "200": { "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "type": "Microsoft.Authorization/policySetDefinitions", "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyDefinitionGroups": [ { "name": "CostSaving", - "displayName": "Cost Management Policies", - "description": "Policies designed to control spend within a subscription." + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" }, { "name": "Organizational", - "displayName": "Organizational Policies", - "description": "Policies that help enforce resource organization standards within a subscription." + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" } ], "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "groupNames": [ "CostSaving" ], @@ -102,12 +94,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "groupNames": [ "Organizational" ], @@ -118,46 +110,46 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] } - } + }, + "headers": {} }, - "200": { - "headers": {}, + "201": { "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "type": "Microsoft.Authorization/policySetDefinitions", "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyDefinitionGroups": [ { "name": "CostSaving", - "displayName": "Cost Management Policies", - "description": "Policies designed to control spend within a subscription." + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" }, { "name": "Organizational", - "displayName": "Organizational Policies", - "description": "Policies that help enforce resource organization standards within a subscription." + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" } ], "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "groupNames": [ "CostSaving" ], @@ -168,12 +160,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "groupNames": [ "Organizational" ], @@ -184,11 +176,21 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] } - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitions_CreateOrUpdateAtManagementGroup", + "title": "Create or update a policy set definition with groups at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignment.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignment.json index 9df240827893..0d8381c1a2e1 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignment.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignment.json @@ -1,16 +1,18 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyAssignmentName": "EnforceNaming", "api-version": "2025-03-01", "parameters": { "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "displayName": "Enforce resource naming rules", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "nonComplianceMessages": [ + { + "message": "Resource names must start with 'DeptA' and end with '-LC'." + } + ], "parameters": { "prefix": { "value": "DeptA" @@ -19,26 +21,32 @@ "value": "-LC" } }, - "nonComplianceMessages": [ - { - "message": "Resource names must start with 'DeptA' and end with '-LC'." - } - ] + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming" } - } + }, + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "201": { - "headers": {}, "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "definitionVersion": "1.*.*", + "nonComplianceMessages": [ + { + "message": "Resource names must start with 'DeptA' and end with '-LC'." + } + ], "notScopes": [], "parameters": { "prefix": { @@ -48,19 +56,13 @@ "value": "-LC" } }, - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "nonComplianceMessages": [ - { - "message": "Resource names must start with 'DeptA' and end with '-LC'." - } - ], - "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", - "type": "Microsoft.Authorization/policyAssignments", - "name": "EnforceNaming" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentNonComplianceMessages.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentNonComplianceMessages.json index f31383871d17..506a0db6ad8e 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentNonComplianceMessages.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentNonComplianceMessages.json @@ -1,12 +1,9 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyAssignmentName": "securityInitAssignment", "api-version": "2025-03-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." @@ -19,24 +16,27 @@ "message": "Storage accounts must have firewall rules configured.", "policyDefinitionReferenceId": "8572513655450389710" } - ] + ], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/securityInitiative" } - } + }, + "policyAssignmentName": "securityInitAssignment", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "201": { - "headers": {}, "body": { + "name": "securityInitAssignment", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/securityInitAssignment", "properties": { + "definitionVersion": "1.*.*", "displayName": "Enforce security policies", + "enforcementMode": "Default", + "instanceId": "b7e0f8a9-1c2d-4e3f-8b4c-5d6e7f8a9b0c", "metadata": { "assignedBy": "User 1" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/securityInitiative", - "definitionVersion": "1.*.*", - "notScopes": [], - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "nonComplianceMessages": [ { "message": "Resources must comply with all internal security policies. See for more info." @@ -50,12 +50,14 @@ "policyDefinitionReferenceId": "8572513655450389710" } ], - "instanceId": "b7e0f8a9-1c2d-4e3f-8b4c-5d6e7f8a9b0c" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/securityInitAssignment", - "type": "Microsoft.Authorization/policyAssignments", - "name": "securityInitAssignment" - } + "notScopes": [], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/securityInitiative", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment with multiple non-compliance messages" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithEnrollEnforcement.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithEnrollEnforcement.json index 12743358049d..f14af10acda8 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithEnrollEnforcement.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithEnrollEnforcement.json @@ -1,16 +1,14 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyAssignmentName": "EnforceNamingEnroll", "api-version": "2025-03-01", "parameters": { "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Enroll", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "parameters": { "prefix": { "value": "DeptA" @@ -19,22 +17,27 @@ "value": "-LC" } }, - "enforcementMode": "Enroll" + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming" } - } + }, + "policyAssignmentName": "EnforceNamingEnroll", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "201": { - "headers": {}, "body": { + "name": "EnforceNamingEnroll", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNamingEnroll", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Enroll", + "instanceId": "f2b3c4d5-e6f7-8a9b-0c1d-2e3f4a5b6c7d", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "definitionVersion": "1.*.*", "notScopes": [], "parameters": { "prefix": { @@ -44,14 +47,13 @@ "value": "-LC" } }, - "enforcementMode": "Enroll", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "instanceId": "f2b3c4d5-e6f7-8a9b-0c1d-2e3f4a5b6c7d" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNamingEnroll", - "type": "Microsoft.Authorization/policyAssignments", - "name": "EnforceNamingEnroll" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment to enforce policy effect only on enrolled resources during resource creation or update." } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithIdentity.json index 68286fd11f2a..1ff9945511b9 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithIdentity.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithIdentity.json @@ -1,20 +1,18 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyAssignmentName": "EnforceNaming", "api-version": "2025-03-01", "parameters": { - "location": "eastus", "identity": { "type": "SystemAssigned" }, + "location": "eastus", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", "metadata": { "assignedBy": "Foo Bar" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "parameters": { "prefix": { "value": "DeptA" @@ -23,22 +21,33 @@ "value": "-LC" } }, - "enforcementMode": "Default" + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming" } - } + }, + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "201": { - "headers": {}, "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "eastus", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "definitionVersion": "1.*.*", "notScopes": [], "parameters": { "prefix": { @@ -48,20 +57,13 @@ "value": "-LC" } }, - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b" - }, - "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" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment with a system assigned identity" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithOverrides.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithOverrides.json index 93b4de1a4387..7ef5947130af 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithOverrides.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithOverrides.json @@ -1,84 +1,86 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyAssignmentName": "CostManagement", "api-version": "2025-03-01", "parameters": { "properties": { - "displayName": "Limit the resource location and resource SKU", "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "definitionVersion": "1.*.*", "overrides": [ { "kind": "policyEffect", - "value": "Audit", "selectors": [ { - "kind": "policyDefinitionReferenceId", "in": [ "Limit_Skus", "Limit_Locations" - ] + ], + "kind": "policyDefinitionReferenceId" } - ] + ], + "value": "Audit" }, { "kind": "definitionVersion", - "value": "2.*.*", "selectors": [ { - "kind": "resourceLocation", "in": [ "eastUSEuap", "centralUSEuap" - ] + ], + "kind": "resourceLocation" } - ] + ], + "value": "2.*.*" } - ] + ], + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement" } - } + }, + "policyAssignmentName": "CostManagement", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "201": { - "headers": {}, "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", "properties": { - "displayName": "Limit the resource location and resource SKU", "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "enforcementMode": "Default", + "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "definitionVersion": "1.*.*", "notScopes": [], - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "overrides": [ { "kind": "policyEffect", - "value": "Audit", "selectors": [ { - "kind": "policyDefinitionReferenceId", "in": [ "Limit_Skus", "Limit_Locations" - ] + ], + "kind": "policyDefinitionReferenceId" } - ] + ], + "value": "Audit" } ], - "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", - "type": "Microsoft.Authorization/policyAssignments", - "name": "CostManagement" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment with overrides" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithResourceSelectors.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithResourceSelectors.json index 30625c8405d4..3bfb7303f6ec 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithResourceSelectors.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithResourceSelectors.json @@ -1,12 +1,10 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyAssignmentName": "CostManagement", "api-version": "2025-03-01", "parameters": { "properties": { - "displayName": "Limit the resource location and resource SKU", "description": "Limit the resource location and resource SKU", + "displayName": "Limit the resource location and resource SKU", "metadata": { "assignedBy": "Special Someone" }, @@ -16,53 +14,57 @@ "name": "SDPRegions", "selectors": [ { - "kind": "resourceLocation", "in": [ "eastus2euap", "centraluseuap" - ] + ], + "kind": "resourceLocation" } ] } ] } - } + }, + "policyAssignmentName": "CostManagement", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "201": { - "headers": {}, "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", "properties": { - "displayName": "Limit the resource location and resource SKU", "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "enforcementMode": "Default", + "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "definitionVersion": "1.*.*", "notScopes": [], - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "resourceSelectors": [ { "name": "SDPRegions", "selectors": [ { - "kind": "resourceLocation", "in": [ "eastus2euap", "centraluseuap" - ] + ], + "kind": "resourceLocation" } ] } ], - "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", - "type": "Microsoft.Authorization/policyAssignments", - "name": "CostManagement" - } + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment with resource selectors" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithUserAssignedIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithUserAssignedIdentity.json index eb03da7619e8..765add88100a 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithUserAssignedIdentity.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithUserAssignedIdentity.json @@ -1,23 +1,21 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyAssignmentName": "EnforceNaming", "api-version": "2025-03-01", "parameters": { - "location": "eastus", "identity": { "type": "UserAssigned", "userAssignedIdentities": { "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {} } }, + "location": "eastus", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", "metadata": { "assignedBy": "Foo Bar" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "parameters": { "prefix": { "value": "DeptA" @@ -26,22 +24,37 @@ "value": "-LC" } }, - "enforcementMode": "Default" + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming" } - } + }, + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "201": { - "headers": {}, "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": { + "clientId": "4bee2b8a-1bee-47c2-90e9-404241551135", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a" + } + } + }, + "location": "eastus", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "definitionVersion": "1.*.*", "notScopes": [], "parameters": { "prefix": { @@ -51,24 +64,13 @@ "value": "-LC" } }, - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b" - }, - "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" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment with a user assigned identity" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithoutEnforcement.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithoutEnforcement.json index 8a9d3d0c5137..61d6cd45f59d 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithoutEnforcement.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/createPolicyAssignmentWithoutEnforcement.json @@ -1,16 +1,14 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyAssignmentName": "EnforceNaming", "api-version": "2025-03-01", "parameters": { "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "displayName": "Enforce resource naming rules", + "enforcementMode": "DoNotEnforce", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "parameters": { "prefix": { "value": "DeptA" @@ -19,22 +17,27 @@ "value": "-LC" } }, - "enforcementMode": "DoNotEnforce" + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming" } - } + }, + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "201": { - "headers": {}, "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "DoNotEnforce", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "definitionVersion": "1.*.*", "notScopes": [], "parameters": { "prefix": { @@ -44,14 +47,13 @@ "value": "-LC" } }, - "enforcementMode": "DoNotEnforce", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", - "type": "Microsoft.Authorization/policyAssignments", - "name": "EnforceNaming" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Create", + "title": "Create or update a policy assignment without enforcing policy effect during resource creation or update." } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyAssignment.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyAssignment.json index 28849c27c25f..e03b67b96c17 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyAssignment.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyAssignment.json @@ -1,21 +1,23 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyAssignmentName": "EnforceNaming", - "api-version": "2025-03-01" + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "definitionVersion": "1.*.*", "notScopes": [], "parameters": { "prefix": { @@ -25,16 +27,16 @@ "value": "-LC" } }, - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", - "type": "Microsoft.Authorization/policyAssignments", - "name": "EnforceNaming" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} }, "204": { "headers": {} } - } + }, + "operationId": "PolicyAssignments_Delete", + "title": "Delete a policy assignment" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinition.json index 840f916a951e..7576285efdb7 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinition.json @@ -1,8 +1,8 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyDefinitionName": "ResourceNaming", - "api-version": "2025-03-01" + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { @@ -11,5 +11,7 @@ "204": { "headers": {} } - } + }, + "operationId": "PolicyDefinitions_Delete", + "title": "Delete a policy definition" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinitionAtManagementGroup.json index b80dd773ec0d..228df971b91a 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinitionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinitionAtManagementGroup.json @@ -1,8 +1,8 @@ { "parameters": { + "api-version": "2025-03-01", "managementGroupId": "MyManagementGroup", - "policyDefinitionName": "ResourceNaming", - "api-version": "2025-03-01" + "policyDefinitionName": "ResourceNaming" }, "responses": { "200": { @@ -11,5 +11,7 @@ "204": { "headers": {} } - } + }, + "operationId": "PolicyDefinitions_DeleteAtManagementGroup", + "title": "Delete a policy definition at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinitionVersion.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinitionVersion.json index 0f654df7e16d..d41ae43ef4ce 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinitionVersion.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinitionVersion.json @@ -1,9 +1,9 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyDefinitionName": "ResourceNaming", "policyDefinitionVersion": "1.2.1", - "api-version": "2025-03-01" + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { @@ -12,5 +12,7 @@ "204": { "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_Delete", + "title": "Delete a policy definition version" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinitionVersionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinitionVersionAtManagementGroup.json index 3209fd673fec..b841e31494c2 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinitionVersionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicyDefinitionVersionAtManagementGroup.json @@ -1,9 +1,9 @@ { "parameters": { + "api-version": "2025-03-01", "managementGroupName": "MyManagementGroup", "policyDefinitionName": "ResourceNaming", - "policyDefinitionVersion": "1.2.1", - "api-version": "2025-03-01" + "policyDefinitionVersion": "1.2.1" }, "responses": { "200": { @@ -12,5 +12,7 @@ "204": { "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_DeleteAtManagementGroup", + "title": "Delete a policy definition version at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinition.json index a69af9a5d9cc..93388f84fcd0 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinition.json @@ -1,8 +1,8 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policySetDefinitionName": "CostManagement", - "api-version": "2025-03-01" + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { @@ -11,5 +11,7 @@ "204": { "headers": {} } - } + }, + "operationId": "PolicySetDefinitions_Delete", + "title": "Delete a policy set definition" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinitionAtManagementGroup.json index 4e6b5a0e1a3b..18888ec78cf8 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinitionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinitionAtManagementGroup.json @@ -1,8 +1,8 @@ { "parameters": { + "api-version": "2025-03-01", "managementGroupId": "MyManagementGroup", - "policySetDefinitionName": "CostManagement", - "api-version": "2025-03-01" + "policySetDefinitionName": "CostManagement" }, "responses": { "200": { @@ -11,5 +11,7 @@ "204": { "headers": {} } - } + }, + "operationId": "PolicySetDefinitions_DeleteAtManagementGroup", + "title": "Delete a policy set definition at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinitionVersion.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinitionVersion.json index 9c5b2f3db5bf..29dc54f08816 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinitionVersion.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinitionVersion.json @@ -1,9 +1,9 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policySetDefinitionName": "CostManagement", + "api-version": "2025-03-01", "policyDefinitionVersion": "1.2.1", - "api-version": "2025-03-01" + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { @@ -12,5 +12,7 @@ "204": { "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_Delete", + "title": "Delete a policy set definition version" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinitionVersionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinitionVersionAtManagementGroup.json index d3cfdea83687..cc00c62a0f06 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinitionVersionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/deletePolicySetDefinitionVersionAtManagementGroup.json @@ -1,9 +1,9 @@ { "parameters": { + "api-version": "2025-03-01", "managementGroupName": "MyManagementGroup", - "policySetDefinitionName": "CostManagement", "policyDefinitionVersion": "1.2.1", - "api-version": "2025-03-01" + "policySetDefinitionName": "CostManagement" }, "responses": { "200": { @@ -12,5 +12,7 @@ "204": { "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_DeleteAtManagementGroup", + "title": "Delete a policy set definition version at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltInPolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltInPolicySetDefinition.json index d47320962b32..e003a337577d 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltInPolicySetDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltInPolicySetDefinition.json @@ -1,82 +1,84 @@ { "parameters": { - "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", - "api-version": "2025-03-01" + "api-version": "2025-03-01", + "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8" }, "responses": { "200": { - "headers": {}, "body": { + "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", "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.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", "metadata": { "category": "Security Center" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "parameters": {}, "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "policyDefinitionReferenceId": "RefId1" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "policyDefinitionReferenceId": "RefId2" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "policyDefinitionReferenceId": "RefId3" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "policyDefinitionReferenceId": "RefId4" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "policyDefinitionReferenceId": "RefId5" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "policyDefinitionReferenceId": "RefId6" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "policyDefinitionReferenceId": "RefId7" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "policyDefinitionReferenceId": "RefId8" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "policyDefinitionReferenceId": "RefId9" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "policyDefinitionReferenceId": "RefId10" } + ], + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] - }, - "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", - "type": "Microsoft.Authorization/policySetDefinitions", - "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8" - } + } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitions_GetBuiltIn", + "title": "Retrieve a built-in policy set definition" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltInPolicySetDefinitionVersion.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltInPolicySetDefinitionVersion.json index 703092a8f55b..1d9c1862f115 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltInPolicySetDefinitionVersion.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltInPolicySetDefinitionVersion.json @@ -1,79 +1,81 @@ { "parameters": { - "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "api-version": "2025-03-01", "policyDefinitionVersion": "1.2.1", - "api-version": "2025-03-01" + "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8" }, "responses": { "200": { - "headers": {}, "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8/versions/1.2.1", "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.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", "metadata": { "category": "Security Center" }, - "version": "1.2.1", "parameters": {}, "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "policyDefinitionReferenceId": "RefId1" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "policyDefinitionReferenceId": "RefId2" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "policyDefinitionReferenceId": "RefId3" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "policyDefinitionReferenceId": "RefId4" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "policyDefinitionReferenceId": "RefId5" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "policyDefinitionReferenceId": "RefId6" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "policyDefinitionReferenceId": "RefId7" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "policyDefinitionReferenceId": "RefId8" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "policyDefinitionReferenceId": "RefId9" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "policyDefinitionReferenceId": "RefId10" } - ] - }, - "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8/versions/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", - "name": "1.2.1" - } + ], + "policyType": "BuiltIn", + "version": "1.2.1" + } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_GetBuiltIn", + "title": "Retrieve a built-in policy set definition version" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltinPolicyDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltinPolicyDefinition.json index 54655f98071c..f15fa3d43eb8 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltinPolicyDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltinPolicyDefinition.json @@ -1,18 +1,19 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyDefinitionName": "7433c107-6db4-4ad1-b57a-a76dce0154a1", - "api-version": "2025-03-01" + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "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.", + "displayName": "Allowed storage account SKUs", + "mode": "All", "parameters": { "listOfAllowedSKUs": { "type": "Array", @@ -23,17 +24,12 @@ } } }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyRule": { "if": { "allOf": [ { - "field": "type", - "equals": "Microsoft.Storage/storageAccounts" + "equals": "Microsoft.Storage/storageAccounts", + "field": "type" }, { "not": { @@ -46,12 +42,18 @@ "then": { "effect": "Deny" } - } - }, - "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", - "type": "Microsoft.Authorization/policyDefinitions", - "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1" - } + }, + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitions_GetBuiltIn", + "title": "Retrieve a built-in policy definition" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltinPolicyDefinitionVersion.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltinPolicyDefinitionVersion.json index 000131b68354..d45119a673f5 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltinPolicyDefinitionVersion.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getBuiltinPolicyDefinitionVersion.json @@ -1,19 +1,20 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyDefinitionName": "7433c107-6db4-4ad1-b57a-a76dce0154a1", "policyDefinitionVersion": "1.2.1", - "api-version": "2025-03-01" + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1/versions/1.2.1", "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.", + "displayName": "Allowed storage account SKUs", + "mode": "All", "parameters": { "listOfAllowedSKUs": { "type": "Array", @@ -24,13 +25,12 @@ } } }, - "version": "1.2.1", "policyRule": { "if": { "allOf": [ { - "field": "type", - "equals": "Microsoft.Storage/storageAccounts" + "equals": "Microsoft.Storage/storageAccounts", + "field": "type" }, { "not": { @@ -43,12 +43,14 @@ "then": { "effect": "Deny" } - } - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", - "name": "1.2.1" - } + }, + "policyType": "BuiltIn", + "version": "1.2.1" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_GetBuiltIn", + "title": "Retrieve a built-in policy definition version" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignment.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignment.json index b13348bfbe4c..4936ef94da0e 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignment.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignment.json @@ -1,21 +1,24 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyAssignmentName": "EnforceNaming", - "api-version": "2025-03-01" + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "definitionVersion": "1.*.*", "notScopes": [], "parameters": { "prefix": { @@ -25,14 +28,13 @@ "value": "-LC" } }, - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", - "type": "Microsoft.Authorization/policyAssignments", - "name": "EnforceNaming" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Get", + "title": "Retrieve a policy assignment" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithIdentity.json index 62bcd6d8a09d..70922a369ae3 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithIdentity.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithIdentity.json @@ -1,21 +1,30 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyAssignmentName": "EnforceNaming", - "api-version": "2025-03-01" + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "westus", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "definitionVersion": "1.*.*", "notScopes": [], "parameters": { "prefix": { @@ -25,20 +34,13 @@ "value": "-LC" } }, - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b" - }, - "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" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Get", + "title": "Retrieve a policy assignment with a system assigned identity" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithOverrides.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithOverrides.json index d420f53da7cd..6bc9269cc071 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithOverrides.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithOverrides.json @@ -1,45 +1,47 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyAssignmentName": "CostManagement", - "api-version": "2025-03-01" + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", "properties": { - "displayName": "Limit the resource location and resource SKU", "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "enforcementMode": "Default", + "instanceId": "d2f3a4b5-c6d7-8e9f-0a1b-2c3d4e5f6a7b", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "definitionVersion": "1.*.*", "notScopes": [], - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "overrides": [ { "kind": "policyEffect", - "value": "Audit", "selectors": [ { - "kind": "policyDefinitionReferenceId", "in": [ "Limit_Skus", "Limit_Locations" - ] + ], + "kind": "policyDefinitionReferenceId" } - ] + ], + "value": "Audit" } ], - "instanceId": "d2f3a4b5-c6d7-8e9f-0a1b-2c3d4e5f6a7b" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", - "type": "Microsoft.Authorization/policyAssignments", - "name": "CostManagement" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Get", + "title": "Retrieve a policy assignment with overrides" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithResourceSelectors.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithResourceSelectors.json index 566863608c02..beb9b1450275 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithResourceSelectors.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithResourceSelectors.json @@ -1,44 +1,46 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyAssignmentName": "CostManagement", - "api-version": "2025-03-01" + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", "properties": { - "displayName": "Limit the resource location and resource SKU", "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "enforcementMode": "Default", + "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "definitionVersion": "1.*.*", "notScopes": [], - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "resourceSelectors": [ { "name": "SDPRegions", "selectors": [ { - "kind": "resourceLocation", "in": [ "eastus2euap", "centraluseuap" - ] + ], + "kind": "resourceLocation" } ] } ], - "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", - "type": "Microsoft.Authorization/policyAssignments", - "name": "CostManagement" - } + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Get", + "title": "Retrieve a policy assignment with resource selectors" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithUserAssignedIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithUserAssignedIdentity.json index e5b0add8f919..5def53d8ec6e 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithUserAssignedIdentity.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyAssignmentWithUserAssignedIdentity.json @@ -1,21 +1,34 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyAssignmentName": "EnforceNaming", - "api-version": "2025-03-01" + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": { + "clientId": "4bee2b8a-1bee-47c2-90e9-404241551135", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a" + } + } + }, + "location": "westus", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "definitionVersion": "1.*.*", "notScopes": [], "parameters": { "prefix": { @@ -25,24 +38,13 @@ "value": "-LC" } }, - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b" - }, - "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" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Get", + "title": "Retrieve a policy assignment with a user assigned identity" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinition.json index d788bd2519a1..667bd3d6c51e 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinition.json @@ -1,58 +1,60 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyDefinitionName": "ResourceNaming", - "api-version": "2025-03-01" + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "type": "Microsoft.Authorization/policyDefinitions", - "name": "ResourceNaming" - } + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitions_Get", + "title": "Retrieve a policy definition" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinitionAtManagementGroup.json index 04176da89e1a..50d0ba4bc872 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinitionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinitionAtManagementGroup.json @@ -1,58 +1,60 @@ { "parameters": { + "api-version": "2025-03-01", "managementGroupId": "MyManagementGroup", - "policyDefinitionName": "ResourceNaming", - "api-version": "2025-03-01" + "policyDefinitionName": "ResourceNaming" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "type": "Microsoft.Authorization/policyDefinitions", "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] } - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitions_GetAtManagementGroup", + "title": "Retrieve a policy definition at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinitionVersion.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinitionVersion.json index 7cdc4bdf4a82..e0daec7cb078 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinitionVersion.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinitionVersion.json @@ -1,55 +1,57 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyDefinitionName": "ResourceNaming", "policyDefinitionVersion": "1.2.1", - "api-version": "2025-03-01" + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", - "name": "1.2.1" - } + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_Get", + "title": "Retrieve a policy definition version" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinitionVersionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinitionVersionAtManagementGroup.json index 0766eddc08ec..1c1ec84270d5 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinitionVersionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicyDefinitionVersionAtManagementGroup.json @@ -1,55 +1,57 @@ { "parameters": { + "api-version": "2025-03-01", "managementGroupName": "MyManagementGroup", "policyDefinitionName": "ResourceNaming", - "policyDefinitionVersion": "1.2.1", - "api-version": "2025-03-01" + "policyDefinitionVersion": "1.2.1" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1" } - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_GetAtManagementGroup", + "title": "Retrieve a policy definition version at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinition.json index b484c4817f88..409a2fbc2e9f 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinition.json @@ -1,44 +1,36 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policySetDefinitionName": "CostManagement", - "api-version": "2025-03-01" + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "type": "Microsoft.Authorization/policySetDefinitions", "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyDefinitionGroups": [ { "name": "CostSaving", - "displayName": "Cost Management Policies", - "description": "Policies designed to control spend within a subscription." + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" }, { "name": "Organizational", - "displayName": "Organizational Policies", - "description": "Policies that help enforce resource organization standards within a subscription." + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" } ], "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "groupNames": [ "CostSaving" ], @@ -49,12 +41,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "groupNames": [ "Organizational" ], @@ -65,11 +57,21 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] } - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitions_Get", + "title": "Retrieve a policy set definition" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinitionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinitionAtManagementGroup.json index e5833e082973..d6ecde4512b0 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinitionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinitionAtManagementGroup.json @@ -1,32 +1,24 @@ { "parameters": { + "api-version": "2025-03-01", "managementGroupId": "MyManagementGroup", - "policySetDefinitionName": "CostManagement", - "api-version": "2025-03-01" + "policySetDefinitionName": "CostManagement" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "type": "Microsoft.Authorization/policySetDefinitions", "name": "CostManagement", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -34,12 +26,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -47,11 +39,21 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] } - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitions_GetAtManagementGroup", + "title": "Retrieve a policy set definition at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinitionVersion.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinitionVersion.json index b7f664242381..eefdf88946a5 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinitionVersion.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinitionVersion.json @@ -1,41 +1,37 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policySetDefinitionName": "CostManagement", + "api-version": "2025-03-01", "policyDefinitionVersion": "1.2.1", - "api-version": "2025-03-01" + "policySetDefinitionName": "CostManagement", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", "policyDefinitionGroups": [ { "name": "CostSaving", - "displayName": "Cost Management Policies", - "description": "Policies designed to control spend within a subscription." + "description": "Policies designed to control spend within a subscription.", + "displayName": "Cost Management Policies" }, { "name": "Organizational", - "displayName": "Organizational Policies", - "description": "Policies that help enforce resource organization standards within a subscription." + "description": "Policies that help enforce resource organization standards within a subscription.", + "displayName": "Organizational Policies" } ], "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "groupNames": [ "CostSaving" ], @@ -46,12 +42,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "groupNames": [ "Organizational" ], @@ -62,11 +58,17 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } - ] + ], + "version": "1.2.1" } - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_Get", + "title": "Retrieve a policy set definition version" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinitionVersionAtManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinitionVersionAtManagementGroup.json index 0af50c6a463d..fb68c04d970b 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinitionVersionAtManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/getPolicySetDefinitionVersionAtManagementGroup.json @@ -1,29 +1,25 @@ { "parameters": { + "api-version": "2025-03-01", "managementGroupName": "MyManagementGroup", - "policySetDefinitionName": "CostManagement", "policyDefinitionVersion": "1.2.1", - "api-version": "2025-03-01" + "policySetDefinitionName": "CostManagement" }, "responses": { "200": { - "headers": {}, "body": { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -31,12 +27,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -44,11 +40,17 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } - ] + ], + "version": "1.2.1" } - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_GetAtManagementGroup", + "title": "Retrieve a policy set definition version at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllBuiltInPolicyDefinitionVersions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllBuiltInPolicyDefinitionVersions.json index 59e20cf76f02..d2403a682723 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllBuiltInPolicyDefinitionVersions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllBuiltInPolicyDefinitionVersions.json @@ -4,102 +4,104 @@ }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.2.1", "properties": { - "mode": "All", - "displayName": "Audit SQL DB Level Audit Setting", - "policyType": "BuiltIn", "description": "Audit DB level audit setting for SQL databases", + "displayName": "Audit SQL DB Level Audit Setting", + "mode": "All", "parameters": { "setting": { "type": "String", - "metadata": { - "displayName": "Audit Setting" - }, "allowedValues": [ "enabled", "disabled" - ] + ], + "metadata": { + "displayName": "Audit Setting" + } } }, - "version": "1.2.1", "policyRule": { "if": { - "field": "type", - "equals": "Microsoft.Sql/servers/databases" + "equals": "Microsoft.Sql/servers/databases", + "field": "type" }, "then": { "effect": "AuditIfNotExists", "details": { - "type": "Microsoft.Sql/servers/databases/auditingSettings", "name": "default", + "type": "Microsoft.Sql/servers/databases/auditingSettings", "existenceCondition": { "allOf": [ { - "field": "Microsoft.Sql/auditingSettings.state", - "equals": "[parameters('setting')]" + "equals": "[parameters('setting')]", + "field": "Microsoft.Sql/auditingSettings.state" } ] } } } - } - }, - "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", - "name": "1.2.1" + }, + "policyType": "BuiltIn", + "version": "1.2.1" + } }, { + "name": "1.0.0", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.0.0", "properties": { - "mode": "All", - "displayName": "Audit SQL DB Level Audit Setting", - "policyType": "BuiltIn", "description": "Audit DB level audit setting for SQL databases", + "displayName": "Audit SQL DB Level Audit Setting", + "mode": "All", "parameters": { "setting": { "type": "String", - "metadata": { - "displayName": "Audit Setting" - }, "allowedValues": [ "enabled", "disabled", "default" - ] + ], + "metadata": { + "displayName": "Audit Setting" + } } }, - "version": "1.0.0", "policyRule": { "if": { - "field": "type", - "equals": "Microsoft.Sql/servers/databases" + "equals": "Microsoft.Sql/servers/databases", + "field": "type" }, "then": { "effect": "AuditIfNotExists", "details": { - "type": "Microsoft.Sql/servers/databases/auditingSettings", "name": "default", + "type": "Microsoft.Sql/servers/databases/auditingSettings", "existenceCondition": { "allOf": [ { - "field": "Microsoft.Sql/auditingSettings.state", - "equals": "[parameters('setting')]" + "equals": "[parameters('setting')]", + "field": "Microsoft.Sql/auditingSettings.state" } ] } } } - } - }, - "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.0.0", - "type": "Microsoft.Authorization/policyDefinitions/versions", - "name": "1.0.0" + }, + "policyType": "BuiltIn", + "version": "1.0.0" + } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_ListAllBuiltins", + "title": "List all built-in policy definition versions" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllBuiltInPolicySetDefinitionVersions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllBuiltInPolicySetDefinitionVersions.json index fa58704e81c1..cff066682229 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllBuiltInPolicySetDefinitionVersions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllBuiltInPolicySetDefinitionVersions.json @@ -4,78 +4,80 @@ }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8/versions/1.2.1", "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.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", "metadata": { "category": "Security Center" }, - "version": "1.2.1", "parameters": {}, "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "policyDefinitionReferenceId": "RefId1" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "policyDefinitionReferenceId": "RefId2" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "policyDefinitionReferenceId": "RefId3" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "policyDefinitionReferenceId": "RefId4" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "policyDefinitionReferenceId": "RefId5" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "policyDefinitionReferenceId": "RefId6" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "policyDefinitionReferenceId": "RefId7" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "policyDefinitionReferenceId": "RefId8" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "policyDefinitionReferenceId": "RefId9" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "policyDefinitionReferenceId": "RefId10" } - ] - }, - "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8/versions/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", - "name": "1.2.1" + ], + "policyType": "BuiltIn", + "version": "1.2.1" + } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_ListAllBuiltins", + "title": "List all built-in policy definition versions" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicyDefinitionVersions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicyDefinitionVersions.json index fa26db1913a8..d9bc957c17f8 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicyDefinitionVersions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicyDefinitionVersions.json @@ -1,38 +1,39 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "api-version": "2025-03-01" + "api-version": "2025-03-01", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "version": "1.2.1", "policyRule": { "if": { "not": { @@ -44,37 +45,37 @@ "effect": "deny" } }, - "policyType": "Custom" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", - "name": "1.2.1" + "policyType": "Custom", + "version": "1.2.1" + } }, { + "name": "1.0.0", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/versions/1.0.0", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "version": "1.0.0", "policyRule": { "if": { "not": { @@ -86,14 +87,15 @@ "effect": "deny" } }, - "policyType": "Custom" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/versions/1.0.0", - "type": "Microsoft.Authorization/policyDefinitions", - "name": "1.0.0" + "policyType": "Custom", + "version": "1.0.0" + } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_ListAll", + "title": "List all policy definition versions at subscription" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicyDefinitionVersionsByManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicyDefinitionVersionsByManagementGroup.json index b90f835faf7f..bd600f72687b 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicyDefinitionVersionsByManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicyDefinitionVersionsByManagementGroup.json @@ -1,99 +1,101 @@ { "parameters": { - "managementGroupName": "MyManagementGroup", - "api-version": "2025-03-01" + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" - } - }, - { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.0.0", - "type": "Microsoft.Authorization/policyDefinitions/versions", - "name": "1.0.0", - "properties": { - "mode": "All", - "displayName": "Naming Convention", - "description": "Force resource names to begin with 'prefix' and end with 'suffix'", - "metadata": { - "category": "Naming" - }, - "version": "1.2.1", "policyRule": { "if": { "not": { "field": "name", - "like": "[concat(parameters('prefix'), '-*', parameters('suffix'))]" + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" } }, "then": { "effect": "deny" } }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + { + "name": "1.0.0", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.0.0", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '-*', parameters('suffix'))]" } + }, + "then": { + "effect": "deny" } }, - "policyType": "Custom" + "policyType": "Custom", + "version": "1.2.1" } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_ListAllAtManagementGroup", + "title": "List all policy definition versions at management group" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicySetDefinitionVersions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicySetDefinitionVersions.json index b6e838b5d50a..9f3b6356db16 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicySetDefinitionVersions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicySetDefinitionVersions.json @@ -1,29 +1,25 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "api-version": "2025-03-01" + "api-version": "2025-03-01", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -31,12 +27,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -44,13 +40,19 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } - ] + ], + "version": "1.2.1" } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_ListAll", + "title": "List all policy definition versions at subscription" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicySetDefinitionVersionsByManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicySetDefinitionVersionsByManagementGroup.json index d4dac0e763e9..78a5b395bd2e 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicySetDefinitionVersionsByManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicySetDefinitionVersionsByManagementGroup.json @@ -1,96 +1,92 @@ { "parameters": { - "managementGroupName": "MyManagementGroup", - "api-version": "2025-03-01" + "api-version": "2025-03-01", + "managementGroupName": "MyManagementGroup" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8/versoins/1.2.1", "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.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", "metadata": { "category": "Security Center" }, - "version": "1.2.1", "parameters": {}, "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "policyDefinitionReferenceId": "RefId1" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "policyDefinitionReferenceId": "RefId2" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "policyDefinitionReferenceId": "RefId3" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "policyDefinitionReferenceId": "RefId4" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "policyDefinitionReferenceId": "RefId5" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "policyDefinitionReferenceId": "RefId6" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "policyDefinitionReferenceId": "RefId7" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "policyDefinitionReferenceId": "RefId8" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "policyDefinitionReferenceId": "RefId9" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "policyDefinitionReferenceId": "RefId10" } - ] - }, - "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8/versoins/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", - "name": "1.2.1" + ], + "policyType": "BuiltIn", + "version": "1.2.1" + } }, { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -98,12 +94,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -111,13 +107,19 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } - ] + ], + "version": "1.2.1" } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_ListAllAtManagementGroup", + "title": "List all policy definition versions at management group" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicyDefinitionVersions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicyDefinitionVersions.json index 3578b8146312..0aac2071f496 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicyDefinitionVersions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicyDefinitionVersions.json @@ -1,106 +1,108 @@ { "parameters": { - "policyDefinitionName": "06a78e20-9358-41c9-923c-fb736d382a12", - "api-version": "2025-03-01" + "api-version": "2025-03-01", + "policyDefinitionName": "06a78e20-9358-41c9-923c-fb736d382a12" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.2.1", "properties": { - "mode": "All", - "displayName": "Audit SQL DB Level Audit Setting", - "policyType": "BuiltIn", "description": "Audit DB level audit setting for SQL databases", + "displayName": "Audit SQL DB Level Audit Setting", + "mode": "All", "parameters": { "setting": { "type": "String", - "metadata": { - "displayName": "Audit Setting" - }, "allowedValues": [ "enabled", "disabled" - ] + ], + "metadata": { + "displayName": "Audit Setting" + } } }, - "version": "1.2.1", "policyRule": { "if": { - "field": "type", - "equals": "Microsoft.Sql/servers/databases" + "equals": "Microsoft.Sql/servers/databases", + "field": "type" }, "then": { "effect": "AuditIfNotExists", "details": { - "type": "Microsoft.Sql/servers/databases/auditingSettings", "name": "default", + "type": "Microsoft.Sql/servers/databases/auditingSettings", "existenceCondition": { "allOf": [ { - "field": "Microsoft.Sql/auditingSettings.state", - "equals": "[parameters('setting')]" + "equals": "[parameters('setting')]", + "field": "Microsoft.Sql/auditingSettings.state" } ] } } } - } - }, - "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", - "name": "1.2.1" + }, + "policyType": "BuiltIn", + "version": "1.2.1" + } }, { + "name": "1.0.0", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.0.0", "properties": { - "mode": "All", - "displayName": "Audit SQL DB Level Audit Setting", - "policyType": "BuiltIn", "description": "Audit DB level audit setting for SQL databases", + "displayName": "Audit SQL DB Level Audit Setting", + "mode": "All", "parameters": { "setting": { "type": "String", - "metadata": { - "displayName": "Audit Setting" - }, "allowedValues": [ "enabled", "disabled", "default" - ] + ], + "metadata": { + "displayName": "Audit Setting" + } } }, - "version": "1.0.0", "policyRule": { "if": { - "field": "type", - "equals": "Microsoft.Sql/servers/databases" + "equals": "Microsoft.Sql/servers/databases", + "field": "type" }, "then": { "effect": "AuditIfNotExists", "details": { - "type": "Microsoft.Sql/servers/databases/auditingSettings", "name": "default", + "type": "Microsoft.Sql/servers/databases/auditingSettings", "existenceCondition": { "allOf": [ { - "field": "Microsoft.Sql/auditingSettings.state", - "equals": "[parameters('setting')]" + "equals": "[parameters('setting')]", + "field": "Microsoft.Sql/auditingSettings.state" } ] } } } - } - }, - "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.0.0", - "type": "Microsoft.Authorization/policyDefinitions/versions", - "name": "1.0.0" + }, + "policyType": "BuiltIn", + "version": "1.0.0" + } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_ListBuiltIn", + "title": "List built-in policy definition versions" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicyDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicyDefinitions.json index cbd5ec9a6c53..1b4c23e59536 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicyDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicyDefinitions.json @@ -4,64 +4,65 @@ }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "06a78e20-9358-41c9-923c-fb736d382a12", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12", "properties": { - "mode": "All", - "displayName": "Audit SQL DB Level Audit Setting", - "policyType": "BuiltIn", "description": "Audit DB level audit setting for SQL databases", + "displayName": "Audit SQL DB Level Audit Setting", + "mode": "All", "parameters": { "setting": { "type": "String", - "metadata": { - "displayName": "Audit Setting" - }, "allowedValues": [ "enabled", "disabled" - ] + ], + "metadata": { + "displayName": "Audit Setting" + } } }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyRule": { "if": { - "field": "type", - "equals": "Microsoft.Sql/servers/databases" + "equals": "Microsoft.Sql/servers/databases", + "field": "type" }, "then": { "effect": "AuditIfNotExists", "details": { - "type": "Microsoft.Sql/servers/databases/auditingSettings", "name": "default", + "type": "Microsoft.Sql/servers/databases/auditingSettings", "existenceCondition": { "allOf": [ { - "field": "Microsoft.Sql/auditingSettings.state", - "equals": "[parameters('setting')]" + "equals": "[parameters('setting')]", + "field": "Microsoft.Sql/auditingSettings.state" } ] } } } - } - }, - "id": "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12", - "type": "Microsoft.Authorization/policyDefinitions", - "name": "06a78e20-9358-41c9-923c-fb736d382a12" + }, + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } }, { + "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "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.", + "displayName": "Allowed storage account SKUs", + "mode": "All", "parameters": { "listOfAllowedSKUs": { "type": "Array", @@ -72,17 +73,12 @@ } } }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyRule": { "if": { "allOf": [ { - "field": "type", - "equals": "Microsoft.Storage/storageAccounts" + "equals": "Microsoft.Storage/storageAccounts", + "field": "type" }, { "not": { @@ -95,35 +91,35 @@ "then": { "effect": "Deny" } - } - }, - "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", - "type": "Microsoft.Authorization/policyDefinitions", - "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1" + }, + "policyType": "Static", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } }, { + "name": "abeed54a-73c5-441d-8a8c-6b5e7a0c299e", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/abeed54a-73c5-441d-8a8c-6b5e7a0c299e", "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.", + "displayName": "Audit KeyVault certificates that expire within specified number of days", "metadata": { "category": "KeyVault DataPlane" }, + "mode": "Microsoft.KeyVault.Data", "parameters": { "daysToExpire": { "type": "Integer", "metadata": { - "displayName": "Days to expire", - "description": "The number of days for a certificate to expire." + "description": "The number of days for a certificate to expire.", + "displayName": "Days to expire" } } }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyRule": { "if": { "field": "Microsoft.KeyVault.Data/vaults/certificates/attributes/expiresOn", @@ -132,14 +128,20 @@ "then": { "effect": "audit" } - } - }, - "id": "/providers/Microsoft.Authorization/policyDefinitions/abeed54a-73c5-441d-8a8c-6b5e7a0c299e", - "type": "Microsoft.Authorization/policyDefinitions", - "name": "abeed54a-73c5-441d-8a8c-6b5e7a0c299e" + }, + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitions_ListBuiltIn", + "title": "List built-in policy definitions" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicySetDefinitionVersions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicySetDefinitionVersions.json index 71616e96bc4a..4f475cdaade9 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicySetDefinitionVersions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicySetDefinitionVersions.json @@ -1,82 +1,84 @@ { "parameters": { - "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", - "api-version": "2025-03-01" + "api-version": "2025-03-01", + "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8/versions/1.2.1", "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.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", "metadata": { "category": "Security Center" }, - "version": "1.2.1", "parameters": {}, "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "policyDefinitionReferenceId": "RefId1" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "policyDefinitionReferenceId": "RefId2" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "policyDefinitionReferenceId": "RefId3" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "policyDefinitionReferenceId": "RefId4" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "policyDefinitionReferenceId": "RefId5" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "policyDefinitionReferenceId": "RefId6" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "policyDefinitionReferenceId": "RefId7" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "policyDefinitionReferenceId": "RefId8" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "policyDefinitionReferenceId": "RefId9" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "policyDefinitionReferenceId": "RefId10" } - ] - }, - "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8/versions/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", - "name": "1.2.1" + ], + "policyType": "BuiltIn", + "version": "1.2.1" + } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_ListBuiltIn", + "title": "List built-in policy set definitions" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicySetDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicySetDefinitions.json index f237429c3d84..ed5ee47c8bc4 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicySetDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listBuiltInPolicySetDefinitions.json @@ -4,82 +4,84 @@ }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", "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.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", "metadata": { "category": "Security Center" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "parameters": {}, "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "policyDefinitionReferenceId": "RefId1" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "policyDefinitionReferenceId": "RefId2" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "policyDefinitionReferenceId": "RefId3" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "policyDefinitionReferenceId": "RefId4" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "policyDefinitionReferenceId": "RefId5" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "policyDefinitionReferenceId": "RefId6" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "policyDefinitionReferenceId": "RefId7" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "policyDefinitionReferenceId": "RefId8" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "policyDefinitionReferenceId": "RefId9" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "policyDefinitionReferenceId": "RefId10" } + ], + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] - }, - "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", - "type": "Microsoft.Authorization/policySetDefinitions", - "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8" + } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitions_ListBuiltIn", + "title": "List built-in policy set definitions" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignmentsForResourceGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignmentsForResourceGroup.json index 76ad72cea4b6..0f76fed8aea7 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignmentsForResourceGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignmentsForResourceGroup.json @@ -1,64 +1,66 @@ { "parameters": { - "resourceGroupName": "TestResourceGroup", - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "api-version": "2025-03-01", + "$expand": "LatestDefinitionVersion, EffectiveDefinitionVersion", "$filter": "atScope()", - "$expand": "LatestDefinitionVersion, EffectiveDefinitionVersion" + "api-version": "2025-03-01", + "resourceGroupName": "TestResourceGroup", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "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", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup/providers/Microsoft.Authorization/policyAssignments/TestCostManagement", "identity": { "type": "SystemAssigned", "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" }, + "location": "eastus", "properties": { - "displayName": "Storage Cost Management", "description": "Minimize the risk of accidental cost overruns", + "definitionVersion": "1.*.*", + "displayName": "Storage Cost Management", + "effectiveDefinitionVersion": "1.0.0", + "instanceId": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d", + "latestDefinitionVersion": "1.0.0", "metadata": { "category": "Cost Management" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/storageSkus", - "definitionVersion": "1.*.*", - "latestDefinitionVersion": "1.0.0", - "effectiveDefinitionVersion": "1.0.0", + "notScopes": [], "parameters": { "allowedSkus": { "value": "Standard_A1" } }, - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup", - "notScopes": [], - "instanceId": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d" + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/storageSkus", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup" } }, { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup/providers/Microsoft.Authorization/policyAssignments/TestTagEnforcement", - "type": "Microsoft.Authorization/policyAssignments", "name": "TestTagEnforcement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup/providers/Microsoft.Authorization/policyAssignments/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", "definitionVersion": "1.*.*", - "latestDefinitionVersion": "1.0.0", + "displayName": "Enforces a tag key and value", "effectiveDefinitionVersion": "1.0.0", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup", + "instanceId": "f0b1c2d3-e4f5-6a7b-8c9d-0e1f2a3b4c5d", + "latestDefinitionVersion": "1.0.0", "notScopes": [], - "instanceId": "f0b1c2d3-e4f5-6a7b-8c9d-0e1f2a3b4c5d" + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/TagKeyValue", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup" } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_ListForResourceGroup", + "title": "List policy assignments that apply to a resource group" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionVersions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionVersions.json index bb2a72539039..8f89677cb450 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionVersions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionVersions.json @@ -1,39 +1,40 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policyDefinitionName": "ResourceNaming", - "api-version": "2025-03-01" + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "version": "1.2.1", "policyRule": { "if": { "not": { @@ -45,37 +46,37 @@ "effect": "deny" } }, - "policyType": "Custom" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", - "name": "1.2.1" + "policyType": "Custom", + "version": "1.2.1" + } }, { + "name": "1.0.0", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/versions/1.0.0", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "version": "1.0.0", "policyRule": { "if": { "not": { @@ -87,14 +88,15 @@ "effect": "deny" } }, - "policyType": "Custom" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/versions/1.0.0", - "type": "Microsoft.Authorization/policyDefinitions", - "name": "1.0.0" + "policyType": "Custom", + "version": "1.0.0" + } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_List", + "title": "List policy definition versions by subscription" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionVersionsByManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionVersionsByManagementGroup.json index e38ade5e719c..87ef147d5c7c 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionVersionsByManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionVersionsByManagementGroup.json @@ -1,100 +1,102 @@ { "parameters": { + "api-version": "2025-03-01", "managementGroupName": "MyManagementGroup", - "policyDefinitionName": "ResourceNaming", - "api-version": "2025-03-01" + "policyDefinitionName": "ResourceNaming" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", - "type": "Microsoft.Authorization/policyDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" - } - }, - { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.0.0", - "type": "Microsoft.Authorization/policyDefinitions/versions", - "name": "1.0.0", - "properties": { - "mode": "All", - "displayName": "Naming Convention", - "description": "Force resource names to begin with 'prefix' and end with 'suffix'", - "metadata": { - "category": "Naming" - }, - "version": "1.2.1", "policyRule": { "if": { "not": { "field": "name", - "like": "[concat(parameters('prefix'), '-*', parameters('suffix'))]" + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" } }, "then": { "effect": "deny" } }, + "policyType": "Custom", + "version": "1.2.1" + } + }, + { + "name": "1.0.0", + "type": "Microsoft.Authorization/policyDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.0.0", + "properties": { + "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", + "metadata": { + "category": "Naming" + }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" + } + } + }, + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '-*', parameters('suffix'))]" } + }, + "then": { + "effect": "deny" } }, - "policyType": "Custom" + "policyType": "Custom", + "version": "1.2.1" } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitionVersions_ListByManagementGroup", + "title": "List policy definition versions by management group" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitions.json index 0300c5692247..9eafcde5e7b7 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitions.json @@ -1,19 +1,20 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "api-version": "2025-03-01" + "api-version": "2025-03-01", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "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.", + "displayName": "Allowed storage account SKUs", + "mode": "All", "parameters": { "listOfAllowedSKUs": { "type": "Array", @@ -24,17 +25,12 @@ } } }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyRule": { "if": { "allOf": [ { - "field": "type", - "equals": "Microsoft.Storage/storageAccounts" + "equals": "Microsoft.Storage/storageAccounts", + "field": "type" }, { "not": { @@ -47,41 +43,42 @@ "then": { "effect": "Deny" } - } - }, - "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", - "type": "Microsoft.Authorization/policyDefinitions", - "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1" + }, + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } }, { + "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyRule": { "if": { "not": { @@ -93,34 +90,34 @@ "effect": "deny" } }, - "policyType": "Custom" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "type": "Microsoft.Authorization/policyDefinitions", - "name": "ResourceNaming" + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } }, { + "name": "AuditSoonToExpireCerts", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/AuditSoonToExpireCerts", "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.", + "displayName": "Audit KeyVault certificates that expire within specified number of days", "metadata": { "category": "KeyVault DataPlane" }, + "mode": "Microsoft.KeyVault.Data", "parameters": { "daysToExpire": { "type": "Integer", "metadata": { - "displayName": "Days to expire", - "description": "The number of days for a certificate to expire." + "description": "The number of days for a certificate to expire.", + "displayName": "Days to expire" } } }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyRule": { "if": { "field": "Microsoft.KeyVault.Data/vaults/certificates/attributes/expiresOn", @@ -130,14 +127,19 @@ "effect": "audit" } }, - "policyType": "Custom" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/AuditSoonToExpireCerts", - "type": "Microsoft.Authorization/policyDefinitions", - "name": "AuditSoonToExpireCerts" + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitions_List", + "title": "List policy definitions by subscription" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionsByManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionsByManagementGroup.json index c6e21558a995..3367ff8c2f67 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionsByManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionsByManagementGroup.json @@ -1,19 +1,20 @@ { "parameters": { - "managementGroupId": "MyManagementGroup", - "api-version": "2025-03-01" + "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "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.", + "displayName": "Allowed storage account SKUs", + "mode": "All", "parameters": { "listOfAllowedSKUs": { "type": "Array", @@ -24,17 +25,12 @@ } } }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyRule": { "if": { "allOf": [ { - "field": "type", - "equals": "Microsoft.Storage/storageAccounts" + "equals": "Microsoft.Storage/storageAccounts", + "field": "type" }, { "not": { @@ -47,60 +43,66 @@ "then": { "effect": "Deny" } - } - }, - "id": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", - "type": "Microsoft.Authorization/policyDefinitions", - "name": "7433c107-6db4-4ad1-b57a-a76dce0154a1" + }, + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] + } }, { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "type": "Microsoft.Authorization/policyDefinitions", "name": "ResourceNaming", + "type": "Microsoft.Authorization/policyDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "properties": { - "mode": "All", - "displayName": "Naming Convention", "description": "Force resource names to begin with 'prefix' and end with 'suffix'", + "displayName": "Naming Convention", "metadata": { "category": "Naming" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], - "policyRule": { - "if": { - "not": { - "field": "name", - "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" - } - }, - "then": { - "effect": "deny" - } - }, + "mode": "All", "parameters": { "prefix": { "type": "String", "metadata": { - "displayName": "Prefix", - "description": "Resource name prefix" + "description": "Resource name prefix", + "displayName": "Prefix" } }, "suffix": { "type": "String", "metadata": { - "displayName": "Suffix", - "description": "Resource name suffix" + "description": "Resource name suffix", + "displayName": "Suffix" } } }, - "policyType": "Custom" + "policyRule": { + "if": { + "not": { + "field": "name", + "like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" + } + }, + "then": { + "effect": "deny" + } + }, + "policyType": "Custom", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" + ] } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicyDefinitions_ListByManagementGroup", + "title": "List policy definitions by management group" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitionVersions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitionVersions.json index 030f3c29d7a4..66d61cb56c09 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitionVersions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitionVersions.json @@ -1,30 +1,26 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", "policySetDefinitionName": "CostManagement", - "api-version": "2025-03-01" + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -32,12 +28,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -45,13 +41,19 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } - ] + ], + "version": "1.2.1" } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_List", + "title": "List policy set definitions" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitionVersionsByManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitionVersionsByManagementGroup.json index 21b9eba9cd79..2d887eb2cbd0 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitionVersionsByManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitionVersionsByManagementGroup.json @@ -1,30 +1,26 @@ { "parameters": { + "api-version": "2025-03-01", "managementGroupName": "MyManagementGroup", - "policySetDefinitionName": "CostManagement", - "api-version": "2025-03-01" + "policySetDefinitionName": "CostManagement" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { - "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", - "type": "Microsoft.Authorization/policySetDefinitions/versions", "name": "1.2.1", + "type": "Microsoft.Authorization/policySetDefinitions/versions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement/versions/1.2.1", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -32,12 +28,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -45,13 +41,19 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } - ] + ], + "version": "1.2.1" } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitionVersions_ListByManagementGroup", + "title": "List policy set definitions at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitions.json index 7eb27af4f3e1..d330a3004a84 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitions.json @@ -1,104 +1,96 @@ { "parameters": { - "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "api-version": "2025-03-01" + "api-version": "2025-03-01", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", "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.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", "metadata": { "category": "Security Center" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "parameters": {}, "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "policyDefinitionReferenceId": "RefId1" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "policyDefinitionReferenceId": "RefId2" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "policyDefinitionReferenceId": "RefId3" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "policyDefinitionReferenceId": "RefId4" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b0f33259-77d7-4c9e-aac6-3aabcfae693c", "policyDefinitionReferenceId": "RefId5" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "policyDefinitionReferenceId": "RefId6" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "policyDefinitionReferenceId": "RefId7" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15", "policyDefinitionReferenceId": "RefId8" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "policyDefinitionReferenceId": "RefId9" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "policyDefinitionReferenceId": "RefId10" } + ], + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] - }, - "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", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyDefinitions": [ { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -106,12 +98,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -119,13 +111,23 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitions_List", + "title": "List policy set definitions" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitionsByManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitionsByManagementGroup.json index 22dc8d8b4b27..c13d482435c4 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitionsByManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicySetDefinitionsByManagementGroup.json @@ -1,46 +1,42 @@ { "parameters": { - "managementGroupId": "MyManagementGroup", - "api-version": "2025-03-01" + "api-version": "2025-03-01", + "managementGroupId": "MyManagementGroup" }, "responses": { "200": { - "headers": {}, "body": { "value": [ { + "name": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", "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.", + "displayName": "[Preview]: Enable Monitoring in Azure Security Center", "metadata": { "category": "Security Center" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "parameters": {}, "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8bef009-a5c9-4d0f-90d7-6018734e8a16", "policyDefinitionReferenceId": "RefId1" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af8051bf-258b-44e2-a2bf-165330459f9d", "policyDefinitionReferenceId": "RefId2" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86b3d65f-7626-441e-b690-81a8b71cff60", "policyDefinitionReferenceId": "RefId3" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", "policyDefinitionReferenceId": "RefId4" }, { @@ -48,13 +44,13 @@ "policyDefinitionReferenceId": "RefId5" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47a6b606-51aa-4496-8bb7-64b11cf66adc", "policyDefinitionReferenceId": "RefId6" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", "policyDefinitionReferenceId": "RefId7" }, { @@ -62,41 +58,37 @@ "policyDefinitionReferenceId": "RefId8" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/af6cd1bd-1635-48cb-bde7-5b15693900b9", "policyDefinitionReferenceId": "RefId9" }, { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "definitionVersion": "1.*.*", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0961003e-5a0a-4549-abde-af6a37f2724d", "policyDefinitionReferenceId": "RefId10" } + ], + "policyType": "BuiltIn", + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] - }, - "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", + "type": "Microsoft.Authorization/policySetDefinitions", + "id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "properties": { - "displayName": "Cost Management", "description": "Policies to enforce low cost storage SKUs", + "displayName": "Cost Management", "metadata": { "category": "Cost Management" }, - "version": "1.2.1", - "versions": [ - "1.2.1", - "1.0.0" - ], "policyDefinitions": [ { - "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Limit_Skus", "parameters": { "listOfAllowedSKUs": { "value": [ @@ -104,12 +96,12 @@ "Standard_LRS" ] } - } + }, + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", + "policyDefinitionReferenceId": "Limit_Skus" }, { - "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", "definitionVersion": "1.*.*", - "policyDefinitionReferenceId": "Resource_Naming", "parameters": { "prefix": { "value": "DeptA" @@ -117,13 +109,23 @@ "suffix": { "value": "-LC" } - } + }, + "policyDefinitionId": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "policyDefinitionReferenceId": "Resource_Naming" } + ], + "version": "1.2.1", + "versions": [ + "1.2.1", + "1.0.0" ] } } ] - } + }, + "headers": {} } - } + }, + "operationId": "PolicySetDefinitions_ListByManagementGroup", + "title": "List policy set definitions at management group level" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithIdentity.json index 60cd5093992b..116b5227d41c 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithIdentity.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithIdentity.json @@ -1,27 +1,36 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyAssignmentName": "EnforceNaming", "api-version": "2025-03-01", "parameters": { - "location": "eastus", "identity": { "type": "SystemAssigned" - } - } + }, + "location": "eastus" + }, + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "identity": { + "type": "SystemAssigned", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a", + "tenantId": "4bee2b8a-1bee-47c2-90e9-404241551135" + }, + "location": "eastus", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "definitionVersion": "1.*.*", "notScopes": [], "parameters": { "prefix": { @@ -31,20 +40,13 @@ "value": "-LC" } }, - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b" - }, - "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" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Update", + "title": "Update a policy assignment with a system assigned identity" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithOverrides.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithOverrides.json index 89fb00c11dcd..84030547bf7e 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithOverrides.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithOverrides.json @@ -1,64 +1,66 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyAssignmentName": "CostManagement", "api-version": "2025-03-01", "parameters": { "properties": { "overrides": [ { "kind": "policyEffect", - "value": "Audit", "selectors": [ { - "kind": "policyDefinitionReferenceId", "in": [ "Limit_Skus", "Limit_Locations" - ] + ], + "kind": "policyDefinitionReferenceId" } - ] + ], + "value": "Audit" } ] } - } + }, + "policyAssignmentName": "CostManagement", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", "properties": { - "displayName": "Limit the resource location and resource SKU", "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "enforcementMode": "Default", + "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "definitionVersion": "1.*.*", "notScopes": [], - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "overrides": [ { "kind": "policyEffect", - "value": "Audit", "selectors": [ { - "kind": "policyDefinitionReferenceId", "in": [ "Limit_Skus", "Limit_Locations" - ] + ], + "kind": "policyDefinitionReferenceId" } - ] + ], + "value": "Audit" } ], - "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", - "type": "Microsoft.Authorization/policyAssignments", - "name": "CostManagement" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Update", + "title": "Update a policy assignment with overrides" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithResourceSelectors.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithResourceSelectors.json index fa5606cea323..4c6967ba9aec 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithResourceSelectors.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithResourceSelectors.json @@ -1,7 +1,5 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyAssignmentName": "CostManagement", "api-version": "2025-03-01", "parameters": { "properties": { @@ -10,53 +8,57 @@ "name": "SDPRegions", "selectors": [ { - "kind": "resourceLocation", "in": [ "eastus2euap", "centraluseuap" - ] + ], + "kind": "resourceLocation" } ] } ] } - } + }, + "policyAssignmentName": "CostManagement", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "CostManagement", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", "properties": { - "displayName": "Limit the resource location and resource SKU", "description": "Limit the resource location and resource SKU", + "definitionVersion": "1.*.*", + "displayName": "Limit the resource location and resource SKU", + "enforcementMode": "Default", + "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", - "definitionVersion": "1.*.*", "notScopes": [], - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement", "resourceSelectors": [ { "name": "SDPRegions", "selectors": [ { - "kind": "resourceLocation", "in": [ "eastus2euap", "centraluseuap" - ] + ], + "kind": "resourceLocation" } ] } ], - "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e" - }, - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", - "type": "Microsoft.Authorization/policyAssignments", - "name": "CostManagement" - } + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Update", + "title": "Update a policy assignment with resource selectors" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithUserAssignedIdentity.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithUserAssignedIdentity.json index b9f912dcf623..1b4d76996cb7 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithUserAssignedIdentity.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/updatePolicyAssignmentWithUserAssignedIdentity.json @@ -1,30 +1,43 @@ { "parameters": { - "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "policyAssignmentName": "EnforceNaming", "api-version": "2025-03-01", "parameters": { - "location": "eastus", "identity": { "type": "UserAssigned", "userAssignedIdentities": { "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {} } - } - } + }, + "location": "eastus" + }, + "policyAssignmentName": "EnforceNaming", + "scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" }, "responses": { "200": { - "headers": {}, "body": { + "name": "EnforceNaming", + "type": "Microsoft.Authorization/policyAssignments", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/EnforceNaming", + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": { + "clientId": "4bee2b8a-1bee-47c2-90e9-404241551135", + "principalId": "e6d23f8d-af97-4fbc-bda6-00604e4e3d0a" + } + } + }, + "location": "eastus", "properties": { - "displayName": "Enforce resource naming rules", "description": "Force resource names to begin with given DeptA and end with -LC", + "definitionVersion": "1.*.*", + "displayName": "Enforce resource naming rules", + "enforcementMode": "Default", + "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b", "metadata": { "assignedBy": "Special Someone" }, - "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", - "definitionVersion": "1.*.*", "notScopes": [], "parameters": { "prefix": { @@ -34,24 +47,13 @@ "value": "-LC" } }, - "enforcementMode": "Default", - "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", - "instanceId": "e4b0f5a6-7c8d-4e9f-8a1b-2c3d4e5f6a7b" - }, - "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" - } + "policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2" + } + }, + "headers": {} } - } + }, + "operationId": "PolicyAssignments_Update", + "title": "Update a policy assignment with a user assigned identity" } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json new file mode 100644 index 000000000000..94fffff8046b --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -0,0 +1,4263 @@ +{ + "swagger": "2.0", + "info": { + "title": "PolicyClient", + "version": "2025-03-01", + "description": "To manage and control access to your resources, you can define customized policies and assign them at a scope.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "tags": [ + { + "name": "PolicyAssignments" + }, + { + "name": "PolicyDefinitions" + }, + { + "name": "PolicyDefinitionVersions" + }, + { + "name": "PolicySetDefinitions" + }, + { + "name": "PolicySetDefinitionVersions" + } + ], + "paths": { + "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}": { + "get": { + "operationId": "PolicyAssignments_Get", + "tags": [ + "PolicyAssignments" + ], + "description": "This operation retrieves a single policy assignment, given its name and the scope it was created at.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "scope", + "in": "path", + "description": "The fully qualified Azure Resource manager identifier of the resource.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true + }, + { + "name": "policyAssignmentName", + "in": "path", + "description": "The name of the policy assignment to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a policy assignment": { + "$ref": "./examples/getPolicyAssignment.json" + }, + "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" + }, + "Retrieve a policy assignment with overrides": { + "$ref": "./examples/getPolicyAssignmentWithOverrides.json" + }, + "Retrieve a policy assignment with resource selectors": { + "$ref": "./examples/getPolicyAssignmentWithResourceSelectors.json" + } + } + }, + "put": { + "operationId": "PolicyAssignments_Create", + "tags": [ + "PolicyAssignments" + ], + "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.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "scope", + "in": "path", + "description": "The fully qualified Azure Resource manager identifier of the resource.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true + }, + { + "name": "policyAssignmentName", + "in": "path", + "description": "The name of the policy assignment to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "parameters", + "in": "body", + "description": "Parameters for the policy assignment.", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + } + ], + "responses": { + "201": { + "description": "Resource 'PolicyAssignment' create operation succeeded", + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a policy assignment": { + "$ref": "./examples/createPolicyAssignment.json" + }, + "Create or update a policy assignment to enforce policy effect only on enrolled resources during resource creation or update.": { + "$ref": "./examples/createPolicyAssignmentWithEnrollEnforcement.json" + }, + "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 with multiple non-compliance messages": { + "$ref": "./examples/createPolicyAssignmentNonComplianceMessages.json" + }, + "Create or update a policy assignment with overrides": { + "$ref": "./examples/createPolicyAssignmentWithOverrides.json" + }, + "Create or update a policy assignment with resource selectors": { + "$ref": "./examples/createPolicyAssignmentWithResourceSelectors.json" + }, + "Create or update a policy assignment without enforcing policy effect during resource creation or update.": { + "$ref": "./examples/createPolicyAssignmentWithoutEnforcement.json" + } + } + }, + "patch": { + "operationId": "PolicyAssignments_Update", + "tags": [ + "PolicyAssignments" + ], + "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.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "scope", + "in": "path", + "description": "The fully qualified Azure Resource manager identifier of the resource.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true + }, + { + "name": "policyAssignmentName", + "in": "path", + "description": "The name of the policy assignment to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "parameters", + "in": "body", + "description": "Parameters for policy assignment patch request.", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyAssignmentUpdate" + } + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Update a policy assignment with a system assigned identity": { + "$ref": "./examples/updatePolicyAssignmentWithIdentity.json" + }, + "Update a policy assignment with a user assigned identity": { + "$ref": "./examples/updatePolicyAssignmentWithUserAssignedIdentity.json" + }, + "Update a policy assignment with overrides": { + "$ref": "./examples/updatePolicyAssignmentWithOverrides.json" + }, + "Update a policy assignment with resource selectors": { + "$ref": "./examples/updatePolicyAssignmentWithResourceSelectors.json" + } + } + }, + "delete": { + "operationId": "PolicyAssignments_Delete", + "tags": [ + "PolicyAssignments" + ], + "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}'.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "scope", + "in": "path", + "description": "The fully qualified Azure Resource manager identifier of the resource.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true + }, + { + "name": "policyAssignmentName", + "in": "path", + "description": "The name of the policy assignment to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "204": { + "description": "Resource does not exist." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a policy assignment": { + "$ref": "./examples/deletePolicyAssignment.json" + } + } + } + }, + "/{scope}/providers/Microsoft.Authorization/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/policyAssignments": { + "get": { + "operationId": "PolicyAssignments_ListForResourceGroup", + "tags": [ + "PolicyAssignments" + ], + "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.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "scope", + "in": "path", + "description": "The fully qualified Azure Resource manager identifier of the resource.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "$filter", + "in": "query", + "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}.", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyAssignmentListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List policy assignments that apply to a resource group": { + "$ref": "./examples/listPolicyAssignmentsForResourceGroup.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Authorization/listPolicyDefinitionVersions": { + "post": { + "operationId": "PolicyDefinitionVersions_ListAllBuiltins", + "summary": "Lists all built-in policy definition versions.", + "description": "This operation lists all the built-in policy definition versions for all built-in policy definitions.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List all built-in policy definition versions": { + "$ref": "./examples/listAllBuiltInPolicyDefinitionVersions.json" + } + } + } + }, + "/providers/Microsoft.Authorization/listPolicySetDefinitionVersions": { + "post": { + "operationId": "PolicySetDefinitionVersions_ListAllBuiltins", + "summary": "Lists all built-in policy set definition versions.", + "description": "This operation lists all the built-in policy set definition versions for all built-in policy set definitions.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List all built-in policy definition versions": { + "$ref": "./examples/listAllBuiltInPolicySetDefinitionVersions.json" + } + } + } + }, + "/providers/Microsoft.Authorization/managementGroups/{managementGroupName}/acquirePolicyToken": { + "post": { + "operationId": "PolicyTokens_AcquireAtManagementGroup", + "summary": "Acquires a policy token at management group level.", + "description": "This operation acquires a policy token in the given management group for the given request body.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupName", + "in": "path", + "description": "The name of the management group.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "The request body", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyTokenRequest" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicyTokenResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Acquire a policy token at management group level": { + "$ref": "./examples/acquirePolicyTokenAtManagementGroup.json" + } + } + } + }, + "/providers/Microsoft.Authorization/managementGroups/{managementGroupName}/listPolicyDefinitionVersions": { + "post": { + "operationId": "PolicyDefinitionVersions_ListAllAtManagementGroup", + "summary": "Lists all policy definition versions at management group scope.", + "description": "This operation lists all the policy definition versions for all policy definitions at the management group scope.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupName", + "in": "path", + "description": "The name of the management group. The name is case insensitive.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 90 + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List all policy definition versions at management group": { + "$ref": "./examples/listAllPolicyDefinitionVersionsByManagementGroup.json" + } + } + } + }, + "/providers/Microsoft.Authorization/managementGroups/{managementGroupName}/listPolicySetDefinitionVersions": { + "post": { + "operationId": "PolicySetDefinitionVersions_ListAllAtManagementGroup", + "summary": "Lists all policy set definition versions at management group scope.", + "description": "This operation lists all the policy set definition versions for all policy set definitions at the management group scope.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupName", + "in": "path", + "description": "The name of the management group. The name is case insensitive.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 90 + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List all policy definition versions at management group": { + "$ref": "./examples/listAllPolicySetDefinitionVersionsByManagementGroup.json" + } + } + } + }, + "/providers/Microsoft.Authorization/policyDefinitions": { + "get": { + "operationId": "PolicyDefinitions_ListBuiltIn", + "tags": [ + "PolicyDefinitions" + ], + "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}.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "$filter", + "in": "query", + "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}.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List built-in policy definitions": { + "$ref": "./examples/listBuiltInPolicyDefinitions.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}": { + "get": { + "operationId": "PolicyDefinitions_GetBuiltIn", + "tags": [ + "PolicyDefinitions" + ], + "description": "This operation retrieves the built-in policy definition with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the built-in policy definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyDefinition" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a built-in policy definition": { + "$ref": "./examples/getBuiltinPolicyDefinition.json" + } + } + } + }, + "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions": { + "get": { + "operationId": "PolicyDefinitionVersions_ListBuiltIn", + "tags": [ + "PolicyDefinitionVersions" + ], + "description": "This operation retrieves a list of all the built-in policy definition versions for the given policy definition.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List built-in policy definition versions": { + "$ref": "./examples/listBuiltInPolicyDefinitionVersions.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}": { + "get": { + "operationId": "PolicyDefinitionVersions_GetBuiltIn", + "tags": [ + "PolicyDefinitionVersions" + ], + "description": "This operation retrieves the built-in policy definition version with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersion" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a built-in policy definition version": { + "$ref": "./examples/getBuiltinPolicyDefinitionVersion.json" + } + } + } + }, + "/providers/Microsoft.Authorization/policySetDefinitions": { + "get": { + "operationId": "PolicySetDefinitions_ListBuiltIn", + "tags": [ + "PolicySetDefinitions" + ], + "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}.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "$filter", + "in": "query", + "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}.", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List built-in policy set definitions": { + "$ref": "./examples/listBuiltInPolicySetDefinitions.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": { + "get": { + "operationId": "PolicySetDefinitions_GetBuiltIn", + "tags": [ + "PolicySetDefinitions" + ], + "description": "This operation retrieves the built-in policy set definition with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicySetDefinition" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a built-in policy set definition": { + "$ref": "./examples/getBuiltInPolicySetDefinition.json" + } + } + } + }, + "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions": { + "get": { + "operationId": "PolicySetDefinitionVersions_ListBuiltIn", + "tags": [ + "PolicySetDefinitionVersions" + ], + "description": "This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy set definition.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List built-in policy set definitions": { + "$ref": "./examples/listBuiltInPolicySetDefinitionVersions.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}": { + "get": { + "operationId": "PolicySetDefinitionVersions_GetBuiltIn", + "tags": [ + "PolicySetDefinitionVersions" + ], + "description": "This operation retrieves the built-in policy set definition version with the given name and version.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersion" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a built-in policy set definition version": { + "$ref": "./examples/getBuiltInPolicySetDefinitionVersion.json" + } + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions": { + "get": { + "operationId": "PolicyDefinitions_ListByManagementGroup", + "tags": [ + "PolicyDefinitions" + ], + "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}.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupId", + "in": "path", + "description": "The ID of the management group.", + "required": true, + "type": "string" + }, + { + "name": "$filter", + "in": "query", + "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}.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List policy definitions by management group": { + "$ref": "./examples/listPolicyDefinitionsByManagementGroup.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}": { + "get": { + "operationId": "PolicyDefinitions_GetAtManagementGroup", + "tags": [ + "PolicyDefinitions" + ], + "description": "This operation retrieves the policy definition in the given management group with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupId", + "in": "path", + "description": "The ID of the management group.", + "required": true, + "type": "string" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyDefinition" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a policy definition at management group level": { + "$ref": "./examples/getPolicyDefinitionAtManagementGroup.json" + } + } + }, + "put": { + "operationId": "PolicyDefinitions_CreateOrUpdateAtManagementGroup", + "tags": [ + "PolicyDefinitions" + ], + "description": "This operation creates or updates a policy definition in the given management group with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupId", + "in": "path", + "description": "The ID of the management group.", + "required": true, + "type": "string" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "parameters", + "in": "body", + "description": "The policy definition properties.", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyDefinition" + } + } + ], + "responses": { + "201": { + "description": "Resource 'PolicyDefinition' create operation succeeded", + "schema": { + "$ref": "#/definitions/PolicyDefinition" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a policy definition at management group level": { + "$ref": "./examples/createOrUpdatePolicyDefinitionAtManagementGroup.json" + } + } + }, + "delete": { + "operationId": "PolicyDefinitions_DeleteAtManagementGroup", + "tags": [ + "PolicyDefinitions" + ], + "description": "This operation deletes the policy definition in the given management group with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupId", + "in": "path", + "description": "The ID of the management group.", + "required": true, + "type": "string" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource does not exist." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a policy definition at management group level": { + "$ref": "./examples/deletePolicyDefinitionAtManagementGroup.json" + } + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions": { + "get": { + "operationId": "PolicyDefinitionVersions_ListByManagementGroup", + "tags": [ + "PolicyDefinitionVersions" + ], + "description": "This operation retrieves a list of all the policy definition versions for the given policy definition in the given management group.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupName", + "in": "path", + "description": "The name of the management group. The name is case insensitive.", + "required": true, + "type": "string" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List policy definition versions by management group": { + "$ref": "./examples/listPolicyDefinitionVersionsByManagementGroup.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}": { + "get": { + "operationId": "PolicyDefinitionVersions_GetAtManagementGroup", + "tags": [ + "PolicyDefinitionVersions" + ], + "description": "This operation retrieves the policy definition version in the given management group with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupName", + "in": "path", + "description": "The name of the management group. The name is case insensitive.", + "required": true, + "type": "string" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersion" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a policy definition version at management group level": { + "$ref": "./examples/getPolicyDefinitionVersionAtManagementGroup.json" + } + } + }, + "put": { + "operationId": "PolicyDefinitionVersions_CreateOrUpdateAtManagementGroup", + "tags": [ + "PolicyDefinitionVersions" + ], + "description": "This operation creates or updates a policy definition version in the given management group with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupName", + "in": "path", + "description": "The name of the management group. The name is case insensitive.", + "required": true, + "type": "string" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + { + "name": "parameters", + "in": "body", + "description": "The policy definition properties.", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersion" + } + } + ], + "responses": { + "200": { + "description": "Resource 'PolicyDefinitionVersion' update operation succeeded", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersion" + } + }, + "201": { + "description": "Resource 'PolicyDefinitionVersion' create operation succeeded", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersion" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a policy definition version at management group level": { + "$ref": "./examples/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json" + } + } + }, + "delete": { + "operationId": "PolicyDefinitionVersions_DeleteAtManagementGroup", + "tags": [ + "PolicyDefinitionVersions" + ], + "description": "This operation deletes the policy definition in the given management group with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupName", + "in": "path", + "description": "The name of the management group. The name is case insensitive.", + "required": true, + "type": "string" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource does not exist." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a policy definition version at management group level": { + "$ref": "./examples/deletePolicyDefinitionVersionAtManagementGroup.json" + } + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions": { + "get": { + "operationId": "PolicySetDefinitions_ListByManagementGroup", + "tags": [ + "PolicySetDefinitions" + ], + "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}.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupId", + "in": "path", + "description": "The ID of the management group.", + "required": true, + "type": "string" + }, + { + "name": "$filter", + "in": "query", + "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}.", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List policy set definitions at management group level": { + "$ref": "./examples/listPolicySetDefinitionsByManagementGroup.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": { + "get": { + "operationId": "PolicySetDefinitions_GetAtManagementGroup", + "tags": [ + "PolicySetDefinitions" + ], + "description": "This operation retrieves the policy set definition in the given management group with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupId", + "in": "path", + "description": "The ID of the management group.", + "required": true, + "type": "string" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicySetDefinition" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a policy set definition at management group level": { + "$ref": "./examples/getPolicySetDefinitionAtManagementGroup.json" + } + } + }, + "put": { + "operationId": "PolicySetDefinitions_CreateOrUpdateAtManagementGroup", + "tags": [ + "PolicySetDefinitions" + ], + "description": "This operation creates or updates a policy set definition in the given management group with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupId", + "in": "path", + "description": "The ID of the management group.", + "required": true, + "type": "string" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "parameters", + "in": "body", + "description": "The policy set definition properties.", + "required": true, + "schema": { + "$ref": "#/definitions/PolicySetDefinition" + } + } + ], + "responses": { + "200": { + "description": "Resource 'PolicySetDefinition' update operation succeeded", + "schema": { + "$ref": "#/definitions/PolicySetDefinition" + } + }, + "201": { + "description": "Resource 'PolicySetDefinition' create operation succeeded", + "schema": { + "$ref": "#/definitions/PolicySetDefinition" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "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" + } + } + }, + "delete": { + "operationId": "PolicySetDefinitions_DeleteAtManagementGroup", + "tags": [ + "PolicySetDefinitions" + ], + "description": "This operation deletes the policy set definition in the given management group with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupId", + "in": "path", + "description": "The ID of the management group.", + "required": true, + "type": "string" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource does not exist." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a policy set definition at management group level": { + "$ref": "./examples/deletePolicySetDefinitionAtManagementGroup.json" + } + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions": { + "get": { + "operationId": "PolicySetDefinitionVersions_ListByManagementGroup", + "tags": [ + "PolicySetDefinitionVersions" + ], + "description": "This operation retrieves a list of all the policy set definition versions for the given policy set definition in a given management group.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupName", + "in": "path", + "description": "The name of the management group. The name is case insensitive.", + "required": true, + "type": "string" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List policy set definitions at management group level": { + "$ref": "./examples/listPolicySetDefinitionVersionsByManagementGroup.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}": { + "get": { + "operationId": "PolicySetDefinitionVersions_GetAtManagementGroup", + "tags": [ + "PolicySetDefinitionVersions" + ], + "description": "This operation retrieves the policy set definition version in the given management group with the given name and version.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupName", + "in": "path", + "description": "The name of the management group. The name is case insensitive.", + "required": true, + "type": "string" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersion" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a policy set definition version at management group level": { + "$ref": "./examples/getPolicySetDefinitionVersionAtManagementGroup.json" + } + } + }, + "put": { + "operationId": "PolicySetDefinitionVersions_CreateOrUpdateAtManagementGroup", + "tags": [ + "PolicySetDefinitionVersions" + ], + "description": "This operation creates or updates a policy set definition version in the given management group with the given name and version.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupName", + "in": "path", + "description": "The name of the management group. The name is case insensitive.", + "required": true, + "type": "string" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + { + "name": "parameters", + "in": "body", + "description": "The policy set definition version properties.", + "required": true, + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersion" + } + } + ], + "responses": { + "200": { + "description": "Resource 'PolicySetDefinitionVersion' update operation succeeded", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersion" + } + }, + "201": { + "description": "Resource 'PolicySetDefinitionVersion' create operation succeeded", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersion" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a policy set definition version at management group level": { + "$ref": "./examples/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json" + } + } + }, + "delete": { + "operationId": "PolicySetDefinitionVersions_DeleteAtManagementGroup", + "tags": [ + "PolicySetDefinitionVersions" + ], + "description": "This operation deletes the policy set definition version in the given management group with the given name and version.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "managementGroupName", + "in": "path", + "description": "The name of the management group. The name is case insensitive.", + "required": true, + "type": "string" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource does not exist." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a policy set definition version at management group level": { + "$ref": "./examples/deletePolicySetDefinitionVersionAtManagementGroup.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/acquirePolicyToken": { + "post": { + "operationId": "PolicyTokens_Acquire", + "summary": "Acquires a policy token.", + "description": "This operation acquires a policy token in the given subscription for the given request body.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "body", + "in": "body", + "description": "The request body", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyTokenRequest" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicyTokenResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Acquire a policy token": { + "$ref": "./examples/acquirePolicyToken.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicyDefinitionVersions": { + "post": { + "operationId": "PolicyDefinitionVersions_ListAll", + "summary": "Lists all policy definition versions within a subscription.", + "description": "This operation lists all the policy definition versions for all policy definitions within a subscription.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List all policy definition versions at subscription": { + "$ref": "./examples/listAllPolicyDefinitionVersions.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions": { + "post": { + "operationId": "PolicySetDefinitionVersions_ListAll", + "summary": "Lists all policy set definition versions within a subscription.", + "description": "This operation lists all the policy set definition versions for all policy set definitions within a subscription.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List all policy definition versions at subscription": { + "$ref": "./examples/listAllPolicySetDefinitionVersions.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions": { + "get": { + "operationId": "PolicyDefinitions_List", + "tags": [ + "PolicyDefinitions" + ], + "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}.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "$filter", + "in": "query", + "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}.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List policy definitions by subscription": { + "$ref": "./examples/listPolicyDefinitions.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}": { + "get": { + "operationId": "PolicyDefinitions_Get", + "tags": [ + "PolicyDefinitions" + ], + "description": "This operation retrieves the policy definition in the given subscription with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyDefinition" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a policy definition": { + "$ref": "./examples/getPolicyDefinition.json" + } + } + }, + "put": { + "operationId": "PolicyDefinitions_CreateOrUpdate", + "tags": [ + "PolicyDefinitions" + ], + "description": "This operation creates or updates a policy definition in the given subscription with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "parameters", + "in": "body", + "description": "The policy definition properties.", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyDefinition" + } + } + ], + "responses": { + "201": { + "description": "Resource 'PolicyDefinition' create operation succeeded", + "schema": { + "$ref": "#/definitions/PolicyDefinition" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "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" + }, + "Create or update a policy definition with external evaluation enforcement settings": { + "$ref": "./examples/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json" + } + } + }, + "delete": { + "operationId": "PolicyDefinitions_Delete", + "tags": [ + "PolicyDefinitions" + ], + "description": "This operation deletes the policy definition in the given subscription with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource does not exist." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a policy definition": { + "$ref": "./examples/deletePolicyDefinition.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions": { + "get": { + "operationId": "PolicyDefinitionVersions_List", + "tags": [ + "PolicyDefinitionVersions" + ], + "description": "This operation retrieves a list of all the policy definition versions for the given policy definition.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List policy definition versions by subscription": { + "$ref": "./examples/listPolicyDefinitionVersions.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}": { + "get": { + "operationId": "PolicyDefinitionVersions_Get", + "tags": [ + "PolicyDefinitionVersions" + ], + "description": "This operation retrieves the policy definition version in the given subscription with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersion" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a policy definition version": { + "$ref": "./examples/getPolicyDefinitionVersion.json" + } + } + }, + "put": { + "operationId": "PolicyDefinitionVersions_CreateOrUpdate", + "tags": [ + "PolicyDefinitionVersions" + ], + "description": "This operation creates or updates a policy definition in the given subscription with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + { + "name": "parameters", + "in": "body", + "description": "The policy definition properties.", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersion" + } + } + ], + "responses": { + "200": { + "description": "Resource 'PolicyDefinitionVersion' update operation succeeded", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersion" + } + }, + "201": { + "description": "Resource 'PolicyDefinitionVersion' create operation succeeded", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersion" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a policy definition version": { + "$ref": "./examples/createOrUpdatePolicyDefinitionVersion.json" + } + } + }, + "delete": { + "operationId": "PolicyDefinitionVersions_Delete", + "tags": [ + "PolicyDefinitionVersions" + ], + "description": "This operation deletes the policy definition version in the given subscription with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policyDefinitionName", + "in": "path", + "description": "The name of the policy definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource does not exist." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a policy definition version": { + "$ref": "./examples/deletePolicyDefinitionVersion.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions": { + "get": { + "operationId": "PolicySetDefinitions_List", + "tags": [ + "PolicySetDefinitions" + ], + "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}.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "$filter", + "in": "query", + "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}.", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List policy set definitions": { + "$ref": "./examples/listPolicySetDefinitions.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": { + "get": { + "operationId": "PolicySetDefinitions_Get", + "tags": [ + "PolicySetDefinitions" + ], + "description": "This operation retrieves the policy set definition in the given subscription with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicySetDefinition" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a policy set definition": { + "$ref": "./examples/getPolicySetDefinition.json" + } + } + }, + "put": { + "operationId": "PolicySetDefinitions_CreateOrUpdate", + "tags": [ + "PolicySetDefinitions" + ], + "description": "This operation creates or updates a policy set definition in the given subscription with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "parameters", + "in": "body", + "description": "The policy set definition properties.", + "required": true, + "schema": { + "$ref": "#/definitions/PolicySetDefinition" + } + } + ], + "responses": { + "200": { + "description": "Resource 'PolicySetDefinition' update operation succeeded", + "schema": { + "$ref": "#/definitions/PolicySetDefinition" + } + }, + "201": { + "description": "Resource 'PolicySetDefinition' create operation succeeded", + "schema": { + "$ref": "#/definitions/PolicySetDefinition" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "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" + } + } + }, + "delete": { + "operationId": "PolicySetDefinitions_Delete", + "tags": [ + "PolicySetDefinitions" + ], + "description": "This operation deletes the policy set definition in the given subscription with the given name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition to get.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource does not exist." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a policy set definition": { + "$ref": "./examples/deletePolicySetDefinition.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions": { + "get": { + "operationId": "PolicySetDefinitionVersions_List", + "tags": [ + "PolicySetDefinitionVersions" + ], + "description": "This operation retrieves a list of all the policy set definition versions for the given policy set definition.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List policy set definitions": { + "$ref": "./examples/listPolicySetDefinitionVersions.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}": { + "get": { + "operationId": "PolicySetDefinitionVersions_Get", + "tags": [ + "PolicySetDefinitionVersions" + ], + "description": "This operation retrieves the policy set definition version in the given subscription with the given name and version.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersion" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Retrieve a policy set definition version": { + "$ref": "./examples/getPolicySetDefinitionVersion.json" + } + } + }, + "put": { + "operationId": "PolicySetDefinitionVersions_CreateOrUpdate", + "tags": [ + "PolicySetDefinitionVersions" + ], + "description": "This operation creates or updates a policy set definition version in the given subscription with the given name and version.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + { + "name": "parameters", + "in": "body", + "description": "The policy set definition properties.", + "required": true, + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersion" + } + } + ], + "responses": { + "200": { + "description": "Resource 'PolicySetDefinitionVersion' update operation succeeded", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersion" + } + }, + "201": { + "description": "Resource 'PolicySetDefinitionVersion' create operation succeeded", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersion" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a policy set definition version": { + "$ref": "./examples/createOrUpdatePolicySetDefinitionVersion.json" + } + } + }, + "delete": { + "operationId": "PolicySetDefinitionVersions_Delete", + "tags": [ + "PolicySetDefinitionVersions" + ], + "description": "This operation deletes the policy set definition version in the given subscription with the given name and version.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "policySetDefinitionName", + "in": "path", + "description": "The name of the policy set definition.", + "required": true, + "type": "string", + "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$" + }, + { + "name": "policyDefinitionVersion", + "in": "path", + "description": "The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", + "required": true, + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource does not exist." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a policy set definition version": { + "$ref": "./examples/deletePolicySetDefinitionVersion.json" + } + } + } + } + }, + "definitions": { + "AssignmentType": { + "type": "string", + "description": "The type of policy assignment. Possible values are NotSpecified, System, SystemHidden, and Custom. Immutable.", + "enum": [ + "NotSpecified", + "System", + "SystemHidden", + "Custom" + ], + "x-ms-enum": { + "name": "AssignmentType", + "modelAsString": true, + "values": [ + { + "name": "NotSpecified", + "value": "NotSpecified", + "description": "NotSpecified" + }, + { + "name": "System", + "value": "System", + "description": "System" + }, + { + "name": "SystemHidden", + "value": "SystemHidden", + "description": "SystemHidden" + }, + { + "name": "Custom", + "value": "Custom", + "description": "Custom" + } + ] + } + }, + "ExternalEndpointResult": { + "type": "string", + "description": "The result of the external endpoint. Possible values are Succeeded and Failed.", + "enum": [ + "Succeeded", + "Failed" + ], + "x-ms-enum": { + "name": "ExternalEndpointResult", + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Succeeded" + }, + { + "name": "Failed", + "value": "Failed", + "description": "Failed" + } + ] + } + }, + "ExternalEvaluationEndpointInvocationResult": { + "type": "object", + "description": "The external evaluation endpoint invocation results.", + "properties": { + "policyInfo": { + "$ref": "#/definitions/PolicyLogInfo", + "description": "The details of the policy requiring the external endpoint invocation." + }, + "result": { + "$ref": "#/definitions/ExternalEndpointResult", + "description": "The result of the external endpoint. Possible values are Succeeded and Failed." + }, + "message": { + "type": "string", + "description": "The status message with additional details about the invocation result." + }, + "retryAfter": { + "type": "string", + "format": "date-time", + "description": "The date and time after which a failed endpoint invocation can be retried." + }, + "claims": { + "description": "The set of claims that will be attached to the policy token as an attestation for the result of the endpoint invocation." + }, + "expiration": { + "type": "string", + "format": "date-time", + "description": "The expiration of the results." + } + } + }, + "ExternalEvaluationEndpointSettings": { + "type": "object", + "description": "The settings of an external endpoint providing evaluation results.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of the endpoint." + }, + "details": { + "description": "The details of the endpoint." + } + } + }, + "ExternalEvaluationEnforcementSettings": { + "type": "object", + "description": "The details of the source of external evaluation results required by the policy during enforcement evaluation.", + "properties": { + "missingTokenAction": { + "type": "string", + "description": "What to do when evaluating an enforcement policy that requires an external evaluation and the token is missing. Possible values are Audit and Deny and language expressions are supported." + }, + "resultLifespan": { + "type": "string", + "description": "The lifespan of the endpoint invocation result after which it's no longer valid. Value is expected to follow the ISO 8601 duration format and language expressions are supported." + }, + "endpointSettings": { + "$ref": "#/definitions/ExternalEvaluationEndpointSettings", + "description": "The settings of an external endpoint providing evaluation results." + }, + "roleDefinitionIds": { + "type": "array", + "description": "An array of the role definition Ids the assignment's MSI will need in order to invoke the endpoint.", + "items": { + "type": "string" + } + } + } + }, + "Identity": { + "type": "object", + "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.", + "properties": { + "principalId": { + "type": "string", + "description": "The principal ID of the resource identity. This property will only be provided for a system assigned identity", + "readOnly": true + }, + "tenantId": { + "type": "string", + "description": "The tenant ID of the resource identity. This property will only be provided for a system assigned identity", + "readOnly": true + }, + "type": { + "$ref": "#/definitions/ResourceIdentityType", + "description": "The identity type. This is the only required field when adding a system or user assigned identity to a resource." + }, + "userAssignedIdentities": { + "type": "object", + "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}'.", + "additionalProperties": { + "$ref": "#/definitions/UserAssignedIdentitiesValue" + } + } + } + }, + "NonComplianceMessage": { + "type": "object", + "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.", + "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" + ] + }, + "Override": { + "type": "object", + "description": "The policy property value override.", + "properties": { + "kind": { + "$ref": "#/definitions/OverrideKind", + "description": "The override kind." + }, + "value": { + "type": "string", + "description": "The value to override the policy property." + }, + "selectors": { + "type": "array", + "description": "The list of the selector expressions.", + "items": { + "$ref": "#/definitions/Selector" + }, + "x-ms-identifiers": [] + } + } + }, + "OverrideKind": { + "type": "string", + "description": "The override kind.", + "enum": [ + "policyEffect", + "definitionVersion" + ], + "x-ms-enum": { + "name": "OverrideKind", + "modelAsString": true, + "values": [ + { + "name": "policyEffect", + "value": "policyEffect", + "description": "It will override the policy effect type." + }, + { + "name": "definitionVersion", + "value": "definitionVersion", + "description": "It will override the definition version property value of the policy assignment." + } + ] + } + }, + "ParameterDefinitionsValue": { + "type": "object", + "description": "The definition of a parameter that can be provided to the policy.", + "properties": { + "type": { + "$ref": "#/definitions/ParameterType", + "description": "The data type of the parameter." + }, + "allowedValues": { + "type": "array", + "description": "The allowed values for the parameter.", + "items": {} + }, + "defaultValue": { + "description": "The default value for the parameter if no value is provided." + }, + "schema": { + "description": "Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/." + }, + "metadata": { + "$ref": "#/definitions/ParameterDefinitionsValueMetadata", + "description": "General metadata for the parameter." + } + } + }, + "ParameterDefinitionsValueMetadata": { + "type": "object", + "description": "General metadata for the parameter.", + "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": {} + }, + "ParameterType": { + "type": "string", + "description": "The data type of the parameter.", + "enum": [ + "String", + "Array", + "Object", + "Boolean", + "Integer", + "Float", + "DateTime" + ], + "x-ms-enum": { + "name": "ParameterType", + "modelAsString": true, + "values": [ + { + "name": "String", + "value": "String", + "description": "String" + }, + { + "name": "Array", + "value": "Array", + "description": "Array" + }, + { + "name": "Object", + "value": "Object", + "description": "Object" + }, + { + "name": "Boolean", + "value": "Boolean", + "description": "Boolean" + }, + { + "name": "Integer", + "value": "Integer", + "description": "Integer" + }, + { + "name": "Float", + "value": "Float", + "description": "Float" + }, + { + "name": "DateTime", + "value": "DateTime", + "description": "DateTime" + } + ] + } + }, + "ParameterValuesValue": { + "type": "object", + "description": "The value of a parameter.", + "properties": { + "value": { + "description": "The value of the parameter." + } + } + }, + "PolicyAssignment": { + "type": "object", + "description": "The policy assignment.", + "properties": { + "properties": { + "$ref": "#/definitions/PolicyAssignmentProperties", + "description": "Properties for the policy assignment.", + "x-ms-client-flatten": 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." + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + } + ] + }, + "PolicyAssignmentListResult": { + "type": "object", + "description": "The response of a PolicyAssignment list operation.", + "properties": { + "value": { + "type": "array", + "description": "The PolicyAssignment items on this page", + "items": { + "$ref": "#/definitions/PolicyAssignment" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PolicyAssignmentProperties": { + "type": "object", + "description": "The policy assignment properties.", + "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." + }, + "definitionVersion": { + "type": "string", + "description": "The version of the policy definition to use." + }, + "latestDefinitionVersion": { + "type": "string", + "description": "The latest version of the policy definition available. This is only present if requested via the $expand query parameter.", + "readOnly": true + }, + "effectiveDefinitionVersion": { + "type": "string", + "description": "The effective version of the policy definition in use. This is only present if requested via the $expand query parameter.", + "readOnly": true + }, + "scope": { + "type": "string", + "description": "The scope for the policy assignment.", + "readOnly": true + }, + "notScopes": { + "type": "array", + "description": "The policy's excluded scopes.", + "items": { + "type": "string" + } + }, + "parameters": { + "type": "object", + "description": "The parameter values for the assigned policy rule. The keys are the parameter names.", + "additionalProperties": { + "$ref": "#/definitions/ParameterValuesValue" + } + }, + "description": { + "type": "string", + "description": "This message will be part of response in case of policy violation." + }, + "metadata": { + "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, DoNotEnforce, and Enroll", + "default": "Default", + "enum": [ + "Default", + "DoNotEnforce", + "Enroll" + ], + "x-ms-enum": { + "name": "EnforcementMode", + "modelAsString": true, + "values": [ + { + "name": "Default", + "value": "Default", + "description": "The policy effect is enforced during resource creation or update." + }, + { + "name": "DoNotEnforce", + "value": "DoNotEnforce", + "description": "The policy effect is not enforced during resource creation or update." + }, + { + "name": "Enroll", + "value": "Enroll", + "description": "The policy effect is not enforced during resource creation or update until the resource or scope of the resource is enrolled to the assignment instance. Enrollment occurs upon deployment of the policy enrollment resource." + } + ] + } + }, + "nonComplianceMessages": { + "type": "array", + "description": "The messages that describe why a resource is non-compliant with the policy.", + "items": { + "$ref": "#/definitions/NonComplianceMessage" + }, + "x-ms-identifiers": [ + "message", + "policyDefinitionReferenceId" + ] + }, + "resourceSelectors": { + "type": "array", + "description": "The resource selector list to filter policies by resource properties.", + "items": { + "$ref": "#/definitions/ResourceSelector" + }, + "x-ms-identifiers": [] + }, + "overrides": { + "type": "array", + "description": "The policy property value override.", + "items": { + "$ref": "#/definitions/Override" + }, + "x-ms-identifiers": [] + }, + "assignmentType": { + "$ref": "#/definitions/AssignmentType", + "description": "The type of policy assignment. Possible values are NotSpecified, System, SystemHidden, and Custom. Immutable." + }, + "instanceId": { + "type": "string", + "description": "The instance ID of the policy assignment. This ID only and always changes when the assignment is deleted and recreated.", + "readOnly": true + } + } + }, + "PolicyAssignmentUpdate": { + "type": "object", + "description": "The policy assignment for Patch request.", + "properties": { + "properties": { + "$ref": "#/definitions/PolicyAssignmentUpdateProperties", + "description": "The policy assignment properties for Patch request.", + "x-ms-client-flatten": 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." + } + } + }, + "PolicyAssignmentUpdateProperties": { + "type": "object", + "description": "The policy assignment properties for Patch request.", + "properties": { + "resourceSelectors": { + "type": "array", + "description": "The resource selector list to filter policies by resource properties.", + "items": { + "$ref": "#/definitions/ResourceSelector" + }, + "x-ms-identifiers": [] + }, + "overrides": { + "type": "array", + "description": "The policy property value override.", + "items": { + "$ref": "#/definitions/Override" + }, + "x-ms-identifiers": [] + } + } + }, + "PolicyDefinition": { + "type": "object", + "description": "The policy definition.", + "properties": { + "properties": { + "$ref": "#/definitions/PolicyDefinitionProperties", + "description": "The policy definition properties.", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + } + ] + }, + "PolicyDefinitionGroup": { + "type": "object", + "description": "The policy definition group.", + "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" + ] + }, + "PolicyDefinitionListResult": { + "type": "object", + "description": "The response of a PolicyDefinition list operation.", + "properties": { + "value": { + "type": "array", + "description": "The PolicyDefinition items on this page", + "items": { + "$ref": "#/definitions/PolicyDefinition" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PolicyDefinitionProperties": { + "type": "object", + "description": "The policy definition properties.", + "properties": { + "policyType": { + "$ref": "#/definitions/PolicyType", + "description": "The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static." + }, + "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": { + "description": "The policy rule." + }, + "metadata": { + "description": "The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." + }, + "parameters": { + "type": "object", + "description": "The parameter definitions for parameters used in the policy rule. The keys are the parameter names.", + "additionalProperties": { + "$ref": "#/definitions/ParameterDefinitionsValue" + } + }, + "version": { + "type": "string", + "description": "The policy definition version in #.#.# format." + }, + "versions": { + "type": "array", + "description": "A list of available versions for this policy definition.", + "items": { + "type": "string" + } + }, + "externalEvaluationEnforcementSettings": { + "$ref": "#/definitions/ExternalEvaluationEnforcementSettings", + "description": "The details of the source of external evaluation results required by the policy during enforcement evaluation." + } + } + }, + "PolicyDefinitionReference": { + "type": "object", + "description": "The policy definition reference.", + "properties": { + "policyDefinitionId": { + "type": "string", + "description": "The ID of the policy definition or policy set definition." + }, + "definitionVersion": { + "type": "string", + "description": "The version of the policy definition to use." + }, + "latestDefinitionVersion": { + "type": "string", + "description": "The latest version of the policy definition available. This is only present if requested via the $expand query parameter.", + "readOnly": true + }, + "effectiveDefinitionVersion": { + "type": "string", + "description": "The effective version of the policy definition in use. This is only present if requested via the $expand query parameter.", + "readOnly": true + }, + "parameters": { + "type": "object", + "description": "The parameter values for the referenced policy rule. The keys are the parameter names.", + "additionalProperties": { + "$ref": "#/definitions/ParameterValuesValue" + } + }, + "policyDefinitionReferenceId": { + "type": "string", + "description": "A unique id (within the policy set definition) for this policy definition reference." + }, + "groupNames": { + "type": "array", + "description": "The name of the groups that this policy definition reference belongs to.", + "items": { + "type": "string" + } + } + }, + "required": [ + "policyDefinitionId" + ] + }, + "PolicyDefinitionVersion": { + "type": "object", + "description": "The ID of the policy definition version.", + "properties": { + "properties": { + "$ref": "#/definitions/PolicyDefinitionVersionProperties", + "description": "The policy definition version properties.", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + } + ] + }, + "PolicyDefinitionVersionListResult": { + "type": "object", + "description": "The response of a PolicyDefinitionVersion list operation.", + "properties": { + "value": { + "type": "array", + "description": "The PolicyDefinitionVersion items on this page", + "items": { + "$ref": "#/definitions/PolicyDefinitionVersion" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PolicyDefinitionVersionProperties": { + "type": "object", + "description": "The policy definition properties.", + "properties": { + "policyType": { + "$ref": "#/definitions/PolicyType", + "description": "The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static." + }, + "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": { + "description": "The policy rule." + }, + "metadata": { + "description": "The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." + }, + "parameters": { + "type": "object", + "description": "The parameter definitions for parameters used in the policy rule. The keys are the parameter names.", + "additionalProperties": { + "$ref": "#/definitions/ParameterDefinitionsValue" + } + }, + "version": { + "type": "string", + "description": "The policy definition version in #.#.# format." + }, + "externalEvaluationEnforcementSettings": { + "$ref": "#/definitions/ExternalEvaluationEnforcementSettings", + "description": "The details of the source of external evaluation results required by the policy during enforcement evaluation." + } + } + }, + "PolicyLogInfo": { + "type": "object", + "description": "The policy log info.", + "properties": { + "policyDefinitionId": { + "type": "string", + "description": "The policy definition Id." + }, + "policySetDefinitionId": { + "type": "string", + "description": "The policy set definition Id." + }, + "policyDefinitionReferenceId": { + "type": "string", + "description": "The policy definition instance Id inside a policy set." + }, + "policySetDefinitionName": { + "type": "string", + "description": "The policy set definition name." + }, + "policySetDefinitionDisplayName": { + "type": "string", + "description": "The policy set definition display name." + }, + "policySetDefinitionVersion": { + "type": "string", + "description": "The policy set definition version." + }, + "policySetDefinitionCategory": { + "type": "string", + "description": "The policy set definition category." + }, + "policyDefinitionName": { + "type": "string", + "description": "The policy definition name." + }, + "policyDefinitionDisplayName": { + "type": "string", + "description": "The policy definition display name." + }, + "policyDefinitionVersion": { + "type": "string", + "description": "The policy definition version." + }, + "policyDefinitionEffect": { + "type": "string", + "description": "The policy definition action." + }, + "policyDefinitionGroupNames": { + "type": "array", + "description": "An array of policy definition group names.", + "items": { + "type": "string" + } + }, + "policyAssignmentId": { + "type": "string", + "description": "The policy assignment Id." + }, + "policyAssignmentName": { + "type": "string", + "description": "The policy assignment name." + }, + "policyAssignmentDisplayName": { + "type": "string", + "description": "The policy assignment display name." + }, + "policyAssignmentVersion": { + "type": "string", + "description": "The policy assignment version." + }, + "policyAssignmentScope": { + "type": "string", + "description": "The policy assignment scope." + }, + "resourceLocation": { + "type": "string", + "description": "The resource location." + }, + "ancestors": { + "type": "string", + "description": "The management group ancestors." + }, + "complianceReasonCode": { + "type": "string", + "description": "The policy compliance reason code." + }, + "policyExemptionIds": { + "type": "array", + "description": "An array of policy exemption Ids.", + "items": { + "type": "string" + } + } + } + }, + "PolicySetDefinition": { + "type": "object", + "description": "The policy set definition.", + "properties": { + "properties": { + "$ref": "#/definitions/PolicySetDefinitionProperties", + "description": "The policy set definition properties.", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + } + ] + }, + "PolicySetDefinitionListResult": { + "type": "object", + "description": "The response of a PolicySetDefinition list operation.", + "properties": { + "value": { + "type": "array", + "description": "The PolicySetDefinition items on this page", + "items": { + "$ref": "#/definitions/PolicySetDefinition" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PolicySetDefinitionProperties": { + "type": "object", + "description": "The policy set definition properties.", + "properties": { + "policyType": { + "$ref": "#/definitions/PolicyType", + "description": "The type of policy set definition. Possible values are NotSpecified, BuiltIn, Custom, and Static." + }, + "displayName": { + "type": "string", + "description": "The display name of the policy set definition." + }, + "description": { + "type": "string", + "description": "The policy set definition description." + }, + "metadata": { + "description": "The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." + }, + "parameters": { + "type": "object", + "description": "The policy set definition parameters that can be used in policy definition references.", + "additionalProperties": { + "$ref": "#/definitions/ParameterDefinitionsValue" + } + }, + "policyDefinitions": { + "type": "array", + "description": "An array of policy definition references.", + "items": { + "$ref": "#/definitions/PolicyDefinitionReference" + }, + "x-ms-identifiers": [ + "policyDefinitionReferenceId" + ] + }, + "policyDefinitionGroups": { + "type": "array", + "description": "The metadata describing groups of policy definition references within the policy set definition.", + "items": { + "$ref": "#/definitions/PolicyDefinitionGroup" + }, + "x-ms-identifiers": [ + "name" + ] + }, + "version": { + "type": "string", + "description": "The policy set definition version in #.#.# format." + }, + "versions": { + "type": "array", + "description": "A list of available versions for this policy set definition.", + "items": { + "type": "string" + } + } + }, + "required": [ + "policyDefinitions" + ] + }, + "PolicySetDefinitionVersion": { + "type": "object", + "description": "The policy set definition version.", + "properties": { + "properties": { + "$ref": "#/definitions/PolicySetDefinitionVersionProperties", + "description": "The policy set definition version properties.", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + } + ] + }, + "PolicySetDefinitionVersionListResult": { + "type": "object", + "description": "The response of a PolicySetDefinitionVersion list operation.", + "properties": { + "value": { + "type": "array", + "description": "The PolicySetDefinitionVersion items on this page", + "items": { + "$ref": "#/definitions/PolicySetDefinitionVersion" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PolicySetDefinitionVersionProperties": { + "type": "object", + "description": "The policy set definition properties.", + "properties": { + "policyType": { + "$ref": "#/definitions/PolicyType", + "description": "The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static." + }, + "displayName": { + "type": "string", + "description": "The display name of the policy set definition." + }, + "description": { + "type": "string", + "description": "The policy set definition description." + }, + "metadata": { + "description": "The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." + }, + "parameters": { + "type": "object", + "description": "The policy set definition parameters that can be used in policy definition references.", + "additionalProperties": { + "$ref": "#/definitions/ParameterDefinitionsValue" + } + }, + "policyDefinitions": { + "type": "array", + "description": "An array of policy definition references.", + "items": { + "$ref": "#/definitions/PolicyDefinitionReference" + }, + "x-ms-identifiers": [ + "policyDefinitionReferenceId" + ] + }, + "policyDefinitionGroups": { + "type": "array", + "description": "The metadata describing groups of policy definition references within the policy set definition.", + "items": { + "$ref": "#/definitions/PolicyDefinitionGroup" + }, + "x-ms-identifiers": [ + "name" + ] + }, + "version": { + "type": "string", + "description": "The policy set definition version in #.#.# format." + } + }, + "required": [ + "policyDefinitions" + ] + }, + "PolicyTokenOperation": { + "type": "object", + "description": "The resource operation to acquire a token for.", + "properties": { + "uri": { + "type": "string", + "description": "The request URI of the resource operation." + }, + "httpMethod": { + "type": "string", + "description": "The http method of the resource operation." + }, + "content": { + "description": "The payload of the resource operation." + } + }, + "required": [ + "uri", + "httpMethod" + ] + }, + "PolicyTokenRequest": { + "type": "object", + "description": "The policy token request properties.", + "properties": { + "operation": { + "$ref": "#/definitions/PolicyTokenOperation", + "description": "The resource operation to acquire a token for." + }, + "changeReference": { + "type": "string", + "description": "The change reference." + } + }, + "required": [ + "operation" + ] + }, + "PolicyTokenResponse": { + "type": "object", + "description": "The policy token response properties.", + "properties": { + "result": { + "$ref": "#/definitions/PolicyTokenResult", + "description": "The result of the completed token acquisition operation. Possible values are Succeeded and Failed." + }, + "message": { + "type": "string", + "description": "Status message with additional details about the token acquisition operation result." + }, + "retryAfter": { + "type": "string", + "format": "date-time", + "description": "The date and time after which the client can try to acquire a token again in the case of retry-able failures." + }, + "results": { + "type": "array", + "description": "An array of external evaluation endpoint invocation results.", + "items": { + "$ref": "#/definitions/ExternalEvaluationEndpointInvocationResult" + }, + "x-ms-identifiers": [] + }, + "changeReference": { + "type": "string", + "description": "The change reference associated with the operation for which the token is acquired." + }, + "token": { + "type": "string", + "description": "The issued policy token." + }, + "tokenId": { + "type": "string", + "description": "The unique Id assigned to the policy token." + }, + "expiration": { + "type": "string", + "format": "date-time", + "description": "The expiration of the policy token." + } + } + }, + "PolicyTokenResult": { + "type": "string", + "description": "The result of the completed token acquisition operation. Possible values are Succeeded and Failed.", + "enum": [ + "Succeeded", + "Failed" + ], + "x-ms-enum": { + "name": "PolicyTokenResult", + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Succeeded" + }, + { + "name": "Failed", + "value": "Failed", + "description": "Failed" + } + ] + } + }, + "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, + "values": [ + { + "name": "NotSpecified", + "value": "NotSpecified", + "description": "NotSpecified" + }, + { + "name": "BuiltIn", + "value": "BuiltIn", + "description": "BuiltIn" + }, + { + "name": "Custom", + "value": "Custom", + "description": "Custom" + }, + { + "name": "Static", + "value": "Static", + "description": "Static" + } + ] + } + }, + "ResourceIdentityType": { + "type": "string", + "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": { + "name": "ResourceIdentityType", + "modelAsString": false, + "values": [ + { + "name": "SystemAssigned", + "value": "SystemAssigned", + "description": "Indicates that a system assigned identity is associated with the resource." + }, + { + "name": "UserAssigned", + "value": "UserAssigned", + "description": "Indicates that a system assigned identity is associated with the resource." + }, + { + "name": "None", + "value": "None", + "description": "Indicates that no identity is associated with the resource or that the existing identity should be removed." + } + ] + } + }, + "ResourceSelector": { + "type": "object", + "description": "The resource selector to filter policies by resource properties.", + "properties": { + "name": { + "type": "string", + "description": "The name of the resource selector." + }, + "selectors": { + "type": "array", + "description": "The list of the selector expressions.", + "items": { + "$ref": "#/definitions/Selector" + }, + "x-ms-identifiers": [] + } + } + }, + "Selector": { + "type": "object", + "description": "The selector expression.", + "properties": { + "kind": { + "$ref": "#/definitions/SelectorKind", + "description": "The selector kind." + }, + "in": { + "type": "array", + "description": "The list of values to filter in.", + "items": { + "type": "string" + } + }, + "notIn": { + "type": "array", + "description": "The list of values to filter out.", + "items": { + "type": "string" + } + } + } + }, + "SelectorKind": { + "type": "string", + "description": "The selector kind.", + "enum": [ + "resourceLocation", + "resourceType", + "resourceWithoutLocation", + "policyDefinitionReferenceId" + ], + "x-ms-enum": { + "name": "SelectorKind", + "modelAsString": true, + "values": [ + { + "name": "resourceLocation", + "value": "resourceLocation", + "description": "The selector kind to filter policies by the resource location." + }, + { + "name": "resourceType", + "value": "resourceType", + "description": "The selector kind to filter policies by the resource type." + }, + { + "name": "resourceWithoutLocation", + "value": "resourceWithoutLocation", + "description": "The selector kind to filter policies by the resource without location." + }, + { + "name": "policyDefinitionReferenceId", + "value": "policyDefinitionReferenceId", + "description": "The selector kind to filter policies by the policy definition reference ID." + } + ] + } + }, + "UserAssignedIdentitiesValue": { + "type": "object", + "properties": { + "principalId": { + "type": "string", + "description": "The principal id of user assigned identity.", + "readOnly": true + }, + "clientId": { + "type": "string", + "description": "The client id of user assigned identity.", + "readOnly": true + } + } + } + }, + "parameters": {} +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyAssignments.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyAssignments.json deleted file mode 100644 index 88adf9932e4f..000000000000 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyAssignments.json +++ /dev/null @@ -1,1098 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "PolicyClient", - "version": "2025-03-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", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy assignment to delete." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "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 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" - }, - "Create or update a policy assignment to enforce policy effect only on enrolled resources during resource creation or update.": { - "$ref": "./examples/createPolicyAssignmentWithEnrollEnforcement.json" - }, - "Create or update a policy assignment with resource selectors": { - "$ref": "./examples/createPolicyAssignmentWithResourceSelectors.json" - }, - "Create or update a policy assignment with overrides": { - "$ref": "./examples/createPolicyAssignmentWithOverrides.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", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy assignment." - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PolicyAssignment" - }, - "description": "Parameters for the policy assignment." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "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 system assigned identity": { - "$ref": "./examples/getPolicyAssignmentWithIdentity.json" - }, - "Retrieve a policy assignment with a user assigned identity": { - "$ref": "./examples/getPolicyAssignmentWithUserAssignedIdentity.json" - }, - "Retrieve a policy assignment with resource selectors": { - "$ref": "./examples/getPolicyAssignmentWithResourceSelectors.json" - }, - "Retrieve a policy assignment with overrides": { - "$ref": "./examples/getPolicyAssignmentWithOverrides.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", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy assignment to get." - }, - { - "$ref": "#/parameters/PolicyAssignmentExpandParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "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": { - "Update a policy assignment with a system assigned identity": { - "$ref": "./examples/updatePolicyAssignmentWithIdentity.json" - }, - "Update a policy assignment with a user assigned identity": { - "$ref": "./examples/updatePolicyAssignmentWithUserAssignedIdentity.json" - }, - "Update a policy assignment with resource selectors": { - "$ref": "./examples/updatePolicyAssignmentWithResourceSelectors.json" - }, - "Update a policy assignment with overrides": { - "$ref": "./examples/updatePolicyAssignmentWithOverrides.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", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy assignment." - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PolicyAssignmentUpdate" - }, - "description": "Parameters for policy assignment patch request." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/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": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "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/PolicyAssignmentExpandParameter" - }, - { - "$ref": "#/parameters/TopParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "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": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "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", - "pattern": "^.+$", - "description": "The name of the resource." - }, - { - "$ref": "#/parameters/PolicyAssignmentsFilterParameter" - }, - { - "$ref": "#/parameters/PolicyAssignmentExpandParameter" - }, - { - "$ref": "#/parameters/TopParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "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/PolicyAssignmentExpandParameter" - }, - { - "$ref": "#/parameters/TopParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "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/PolicyAssignmentExpandParameter" - }, - { - "$ref": "#/parameters/TopParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "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": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "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": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "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": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "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": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "PolicyAssignmentProperties": { - "type": "object", - "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." - }, - "definitionVersion": { - "type": "string", - "description": "The version of the policy definition to use." - }, - "latestDefinitionVersion": { - "type": "string", - "description": "The latest version of the policy definition available. This is only present if requested via the $expand query parameter.", - "readOnly": true - }, - "effectiveDefinitionVersion": { - "type": "string", - "description": "The effective version of the policy definition in use. This is only present if requested via the $expand query parameter.", - "readOnly": true - }, - "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, DoNotEnforce, and Enroll", - "enum": [ - "Default", - "DoNotEnforce", - "Enroll" - ], - "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." - }, - { - "value": "Enroll", - "description": "The policy effect is not enforced during resource creation or update until the resource or scope of the resource is enrolled to the assignment instance. Enrollment occurs upon deployment of the policy enrollment resource." - } - ] - }, - "default": "Default" - }, - "nonComplianceMessages": { - "type": "array", - "items": { - "$ref": "#/definitions/NonComplianceMessage" - }, - "x-ms-identifiers": [ - "message", - "policyDefinitionReferenceId" - ], - "description": "The messages that describe why a resource is non-compliant with the policy." - }, - "resourceSelectors": { - "type": "array", - "items": { - "$ref": "../../common/v2/types.json#/definitions/ResourceSelector" - }, - "x-ms-identifiers": [], - "description": "The resource selector list to filter policies by resource properties." - }, - "overrides": { - "type": "array", - "items": { - "$ref": "../../common/v2/types.json#/definitions/Override" - }, - "x-ms-identifiers": [], - "description": "The policy property value override." - }, - "assignmentType": { - "type": "string", - "description": "The type of policy assignment. Possible values are NotSpecified, System, SystemHidden, and Custom. Immutable.", - "enum": [ - "NotSpecified", - "System", - "SystemHidden", - "Custom" - ], - "x-ms-enum": { - "name": "assignmentType", - "modelAsString": true - } - }, - "instanceId": { - "type": "string", - "description": "The instance ID of the policy assignment. This ID only and always changes when the assignment is deleted and recreated.", - "readOnly": true - } - }, - "description": "The policy assignment properties." - }, - "NonComplianceMessage": { - "type": "object", - "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": { - "type": "object", - "properties": { - "value": { - "description": "The value of the parameter." - } - }, - "description": "The value of a parameter." - }, - "PolicyAssignment": { - "type": "object", - "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." - }, - "systemData": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/systemData", - "readOnly": true, - "description": "The system metadata relating to this resource." - } - }, - "description": "The policy assignment.", - "x-ms-azure-resource": true - }, - "PolicyAssignmentListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/PolicyAssignment" - }, - "x-ms-identifiers": [], - "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": { - "type": "object", - "properties": { - "principalId": { - "readOnly": true, - "type": "string", - "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. 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 or user assigned identity to a resource.", - "enum": [ - "SystemAssigned", - "UserAssigned", - "None" - ], - "x-ms-enum": { - "name": "ResourceIdentityType", - "modelAsString": false, - "values": [ - { - "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. Policy assignments support a maximum of one identity. That is either a system assigned identity or a single user assigned identity." - }, - "PolicyAssignmentUpdateProperties": { - "type": "object", - "properties": { - "resourceSelectors": { - "type": "array", - "items": { - "$ref": "../../common/v2/types.json#/definitions/ResourceSelector" - }, - "x-ms-identifiers": [], - "description": "The resource selector list to filter policies by resource properties." - }, - "overrides": { - "type": "array", - "items": { - "$ref": "../../common/v2/types.json#/definitions/Override" - }, - "x-ms-identifiers": [], - "description": "The policy property value override." - } - }, - "description": "The policy assignment properties for Patch request." - }, - "PolicyAssignmentUpdate": { - "type": "object", - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/PolicyAssignmentUpdateProperties", - "description": "The policy assignment properties for Patch request." - }, - "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 for Patch request." - } - }, - "parameters": { - "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" - }, - "PolicyAssignmentExpandParameter": { - "name": "$expand", - "in": "query", - "required": false, - "type": "string", - "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", - "x-ms-parameter-location": "method" - }, - "TopParameter": { - "name": "$top", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "minimum": 1, - "maximum": 1000, - "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", - "x-ms-parameter-location": "method" - } - } -} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyDefinitionVersions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyDefinitionVersions.json deleted file mode 100644 index cc93f5ffa4e6..000000000000 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyDefinitionVersions.json +++ /dev/null @@ -1,854 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "PolicyClient", - "version": "2025-03-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/listPolicyDefinitionVersions": { - "post": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_ListAllBuiltins", - "summary": "Lists all built-in policy definition versions.", - "description": "This operation lists all the built-in policy definition versions for all built-in policy definitions.", - "x-ms-examples": { - "List all built-in policy definition versions": { - "$ref": "./examples/listAllBuiltInPolicyDefinitionVersions.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of policy definition versions.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicyDefinitionVersions": { - "post": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_ListAllAtManagementGroup", - "summary": "Lists all policy definition versions at management group scope.", - "description": "This operation lists all the policy definition versions for all policy definitions at the management group scope.", - "x-ms-examples": { - "List all policy definition versions at management group": { - "$ref": "./examples/listAllPolicyDefinitionVersionsByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of policy definition versions.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicyDefinitionVersions": { - "post": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_ListAll", - "summary": "Lists all policy definition versions within a subscription.", - "description": "This operation lists all the policy definition versions for all policy definitions within a subscription.", - "x-ms-examples": { - "List all policy definition versions at subscription": { - "$ref": "./examples/listAllPolicyDefinitionVersions.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of policy definition versions.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}": { - "put": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_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 version": { - "$ref": "./examples/createOrUpdatePolicyDefinitionVersion.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PolicyDefinitionName" - }, - { - "$ref": "#/parameters/PolicyDefinitionVersion" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersion" - }, - "description": "The policy definition properties." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "201": { - "description": "Created - Returns information about the policy definition version.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersion" - } - }, - "200": { - "description": "OK - Successfully updated policy definition version.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersion" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_Delete", - "summary": "Deletes a policy definition version in a subscription.", - "description": "This operation deletes the policy definition version in the given subscription with the given name.", - "x-ms-examples": { - "Delete a policy definition version": { - "$ref": "./examples/deletePolicyDefinitionVersion.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PolicyDefinitionName" - }, - { - "$ref": "#/parameters/PolicyDefinitionVersion" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "200": { - "description": "OK" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "get": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_Get", - "summary": "Retrieves a policy definition version in a subscription.", - "description": "This operation retrieves the policy definition version in the given subscription with the given name.", - "x-ms-examples": { - "Retrieve a policy definition version": { - "$ref": "./examples/getPolicyDefinitionVersion.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PolicyDefinitionName" - }, - { - "$ref": "#/parameters/PolicyDefinitionVersion" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns information about the policy definition.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersion" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}": { - "get": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_GetBuiltIn", - "summary": "Retrieves a built-in policy definition version.", - "description": "This operation retrieves the built-in policy definition version with the given name.", - "x-ms-examples": { - "Retrieve a built-in policy definition version": { - "$ref": "./examples/getBuiltinPolicyDefinitionVersion.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/PolicyDefinitionName" - }, - { - "$ref": "#/parameters/PolicyDefinitionVersion" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns information about the built-in policy definition.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersion" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}": { - "put": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_CreateOrUpdateAtManagementGroup", - "summary": "Creates or updates a policy definition version in a management group.", - "description": "This operation creates or updates a policy definition version in the given management group with the given name.", - "x-ms-examples": { - "Create or update a policy definition version at management group level": { - "$ref": "./examples/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" - }, - { - "$ref": "#/parameters/PolicyDefinitionName" - }, - { - "$ref": "#/parameters/PolicyDefinitionVersion" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersion" - }, - "description": "The policy definition properties." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "201": { - "description": "Created - Returns information about the policy definition version.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersion" - } - }, - "200": { - "description": "OK - Successfully updated policy definition version.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersion" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_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 version at management group level": { - "$ref": "./examples/deletePolicyDefinitionVersionAtManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" - }, - { - "$ref": "#/parameters/PolicyDefinitionName" - }, - { - "$ref": "#/parameters/PolicyDefinitionVersion" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "200": { - "description": "OK" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "get": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_GetAtManagementGroup", - "summary": "Retrieve a policy definition version in a management group.", - "description": "This operation retrieves the policy definition version in the given management group with the given name.", - "x-ms-examples": { - "Retrieve a policy definition version at management group level": { - "$ref": "./examples/getPolicyDefinitionVersionAtManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" - }, - { - "$ref": "#/parameters/PolicyDefinitionName" - }, - { - "$ref": "#/parameters/PolicyDefinitionVersion" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns information about the policy definition.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersion" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions": { - "get": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_List", - "summary": "Retrieves policy definition versions for a given policy definition in a subscription", - "description": "This operation retrieves a list of all the policy definition versions for the given policy definition.", - "x-ms-examples": { - "List policy definition versions by subscription": { - "$ref": "./examples/listPolicyDefinitionVersions.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PolicyDefinitionName" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/TopParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of policy definition versions.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions": { - "get": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_ListBuiltIn", - "summary": "Retrieve built-in policy definition versions", - "description": "This operation retrieves a list of all the built-in policy definition versions for the given policy definition.", - "x-ms-examples": { - "List built-in policy definition versions": { - "$ref": "./examples/listBuiltInPolicyDefinitionVersions.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/PolicyDefinitionName" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/TopParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of built-in policy definition versions.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions": { - "get": { - "tags": [ - "PolicyDefinitionVersions" - ], - "operationId": "PolicyDefinitionVersions_ListByManagementGroup", - "summary": "Retrieve policy definition versions in a management group policy definition.", - "description": "This operation retrieves a list of all the policy definition versions for the given policy definition in the given management group.", - "x-ms-examples": { - "List policy definition versions by management group": { - "$ref": "./examples/listPolicyDefinitionVersionsByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" - }, - { - "$ref": "#/parameters/PolicyDefinitionName" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/TopParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of policy definition versions.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "PolicyDefinitionVersionProperties": { - "type": "object", - "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" - }, - "version": { - "type": "string", - "description": "The policy definition version in #.#.# format." - }, - "externalEvaluationEnforcementSettings": { - "description": "The details of the source of external evaluation results required by the policy during enforcement evaluation.", - "$ref": "#/definitions/ExternalEvaluationEnforcementSettings" - } - }, - "description": "The policy definition properties." - }, - "ParameterDefinitionsValue": { - "type": "object", - "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": { - "description": "The collection of allowed values for the parameter." - }, - "x-ms-identifiers": [], - "description": "The allowed values for the parameter." - }, - "defaultValue": { - "description": "The default value for the parameter if no value is provided." - }, - "schema": { - "type": "object", - "description": "Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/." - }, - "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" - } - }, - "PolicyDefinitionVersion": { - "type": "object", - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/PolicyDefinitionVersionProperties", - "description": "The policy definition version properties." - }, - "id": { - "readOnly": true, - "type": "string", - "description": "The ID of the policy definition version." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "The name of the policy definition version." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "The type of the resource (Microsoft.Authorization/policyDefinitions/versions)." - }, - "systemData": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/systemData", - "readOnly": true, - "description": "The system metadata relating to this resource." - } - }, - "description": "The ID of the policy definition version.", - "x-ms-azure-resource": true - }, - "PolicyDefinitionVersionListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/PolicyDefinitionVersion" - }, - "description": "An array of policy definitions versions." - }, - "nextLink": { - "type": "string", - "description": "The URL to use for getting the next set of results." - } - }, - "description": "List of policy definition versions." - }, - "ExternalEvaluationEnforcementSettings": { - "type": "object", - "properties": { - "missingTokenAction": { - "type": "string", - "description": "What to do when evaluating an enforcement policy that requires an external evaluation and the token is missing. Possible values are Audit and Deny and language expressions are supported." - }, - "resultLifespan": { - "type": "string", - "description": "The lifespan of the endpoint invocation result after which it's no longer valid. Value is expected to follow the ISO 8601 duration format and language expressions are supported." - }, - "endpointSettings": { - "description": "The settings of an external endpoint providing evaluation results.", - "$ref": "#/definitions/ExternalEvaluationEndpointSettings" - }, - "roleDefinitionIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "An array of the role definition Ids the assignment's MSI will need in order to invoke the endpoint." - } - }, - "description": "The details of the source of external evaluation results required by the policy during enforcement evaluation." - }, - "ExternalEvaluationEndpointSettings": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "description": "The kind of the endpoint." - }, - "details": { - "type": "object", - "description": "The details of the endpoint." - } - }, - "description": "The settings of an external endpoint providing evaluation results." - } - }, - "parameters": { - "PolicyDefinitionName": { - "name": "policyDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy definition.", - "x-ms-parameter-location": "method" - }, - "PolicyDefinitionVersion": { - "name": "policyDefinitionVersion", - "in": "path", - "required": true, - "type": "string", - "pattern": "^\\d+\\.\\d+\\.\\d+$", - "description": "The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", - "x-ms-parameter-location": "method" - }, - "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/2025-03-01/policyDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyDefinitions.json deleted file mode 100644 index 3b5a3c8f4026..000000000000 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyDefinitions.json +++ /dev/null @@ -1,751 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "PolicyClient", - "version": "2025-03-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" - }, - "Create or update a policy definition with external evaluation enforcement settings": { - "$ref": "./examples/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "name": "policyDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "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": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "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": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "name": "policyDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy definition to delete." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "200": { - "description": "OK" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "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": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "name": "policyDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy definition to get." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/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", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the built-in policy definition to get." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/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": [ - { - "$ref": "#/parameters/ManagementGroupIdParameter" - }, - { - "name": "policyDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "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": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "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": [ - { - "$ref": "#/parameters/ManagementGroupIdParameter" - }, - { - "name": "policyDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy definition to delete." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "200": { - "description": "OK" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "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": [ - { - "$ref": "#/parameters/ManagementGroupIdParameter" - }, - { - "name": "policyDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy definition to get." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/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": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "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": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "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": "../../../../../common-types/resource-management/v5/types.json#/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": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "PolicyDefinitionProperties": { - "type": "object", - "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" - }, - "version": { - "type": "string", - "description": "The policy definition version in #.#.# format." - }, - "versions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of available versions for this policy definition." - }, - "externalEvaluationEnforcementSettings": { - "description": "The details of the source of external evaluation results required by the policy during enforcement evaluation.", - "$ref": "#/definitions/ExternalEvaluationEnforcementSettings" - } - }, - "description": "The policy definition properties." - }, - "ParameterDefinitionsValue": { - "type": "object", - "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": { - "description": "The collection of allowed values for the parameter." - }, - "x-ms-identifiers": [], - "description": "The allowed values for the parameter." - }, - "defaultValue": { - "description": "The default value for the parameter if no value is provided." - }, - "schema": { - "type": "object", - "description": "Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/." - }, - "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": { - "type": "object", - "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)." - }, - "systemData": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/systemData", - "readOnly": true, - "description": "The system metadata relating to this resource." - } - }, - "description": "The policy definition.", - "x-ms-azure-resource": true - }, - "PolicyDefinitionListResult": { - "type": "object", - "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." - }, - "ExternalEvaluationEnforcementSettings": { - "type": "object", - "properties": { - "missingTokenAction": { - "type": "string", - "description": "What to do when evaluating an enforcement policy that requires an external evaluation and the token is missing. Possible values are Audit and Deny and language expressions are supported." - }, - "resultLifespan": { - "type": "string", - "description": "The lifespan of the endpoint invocation result after which it's no longer valid. Value is expected to follow the ISO 8601 duration format and language expressions are supported." - }, - "endpointSettings": { - "description": "The settings of an external endpoint providing evaluation results.", - "$ref": "#/definitions/ExternalEvaluationEndpointSettings" - }, - "roleDefinitionIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "An array of the role definition Ids the assignment's MSI will need in order to invoke the endpoint." - } - }, - "description": "The details of the source of external evaluation results required by the policy during enforcement evaluation." - }, - "ExternalEvaluationEndpointSettings": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "description": "The kind of the endpoint." - }, - "details": { - "type": "object", - "description": "The details of the endpoint." - } - }, - "description": "The settings of an external endpoint providing evaluation results." - } - }, - "parameters": { - "ManagementGroupIdParameter": { - "name": "managementGroupId", - "in": "path", - "required": true, - "type": "string", - "description": "The ID of the management group.", - "x-ms-parameter-location": "method" - }, - "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/2025-03-01/policySetDefinitionVersions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policySetDefinitionVersions.json deleted file mode 100644 index d95878667293..000000000000 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policySetDefinitionVersions.json +++ /dev/null @@ -1,852 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "PolicyClient", - "version": "2025-03-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/listPolicySetDefinitionVersions": { - "post": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_ListAllBuiltins", - "summary": "Lists all built-in policy set definition versions.", - "description": "This operation lists all the built-in policy set definition versions for all built-in policy set definitions.", - "x-ms-examples": { - "List all built-in policy definition versions": { - "$ref": "./examples/listAllBuiltInPolicySetDefinitionVersions.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of policy set definition versions.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions": { - "post": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_ListAllAtManagementGroup", - "summary": "Lists all policy set definition versions at management group scope.", - "description": "This operation lists all the policy set definition versions for all policy set definitions at the management group scope.", - "x-ms-examples": { - "List all policy definition versions at management group": { - "$ref": "./examples/listAllPolicySetDefinitionVersionsByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of policy set definition versions.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions": { - "post": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_ListAll", - "summary": "Lists all policy set definition versions within a subscription.", - "description": "This operation lists all the policy set definition versions for all policy set definitions within a subscription.", - "x-ms-examples": { - "List all policy definition versions at subscription": { - "$ref": "./examples/listAllPolicySetDefinitionVersions.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of policy set definition versions.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}": { - "put": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_CreateOrUpdate", - "summary": "Creates or updates a policy set definition version.", - "description": "This operation creates or updates a policy set definition version in the given subscription with the given name and version.", - "x-ms-examples": { - "Create or update a policy set definition version": { - "$ref": "./examples/createOrUpdatePolicySetDefinitionVersion.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionName" - }, - { - "$ref": "#/parameters/PolicySetDefinitionVersion" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersion" - }, - "description": "The policy set definition properties." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "201": { - "description": "Created - Returns information about the policy set definition version.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersion" - } - }, - "200": { - "description": "OK - Successfully updated policy set definition version.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersion" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_Delete", - "summary": "Deletes a policy set definition version.", - "description": "This operation deletes the policy set definition version in the given subscription with the given name and version.", - "x-ms-examples": { - "Delete a policy set definition version": { - "$ref": "./examples/deletePolicySetDefinitionVersion.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionName" - }, - { - "$ref": "#/parameters/PolicySetDefinitionVersion" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "No Content - the policy set definition doesn't exist in the subscription." - }, - "200": { - "description": "OK" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "get": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_Get", - "summary": "Retrieves a policy set definition version.", - "description": "This operation retrieves the policy set definition version in the given subscription with the given name and version.", - "x-ms-examples": { - "Retrieve a policy set definition version": { - "$ref": "./examples/getPolicySetDefinitionVersion.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionName" - }, - { - "$ref": "#/parameters/PolicySetDefinitionVersion" - }, - { - "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns information about the policy set definition version.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersion" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}": { - "get": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_GetBuiltIn", - "summary": "Retrieves a built in policy set definition version.", - "description": "This operation retrieves the built-in policy set definition version with the given name and version.", - "x-ms-examples": { - "Retrieve a built-in policy set definition version": { - "$ref": "./examples/getBuiltInPolicySetDefinitionVersion.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/PolicySetDefinitionName" - }, - { - "$ref": "#/parameters/PolicySetDefinitionVersion" - }, - { - "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns information about the built in policy set definition version.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersion" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions": { - "get": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_List", - "summary": "Retrieves the policy set definition versions for a given policy set definition in a subscription.", - "description": "This operation retrieves a list of all the policy set definition versions for the given policy set definition.", - "x-ms-examples": { - "List policy set definitions": { - "$ref": "./examples/listPolicySetDefinitionVersions.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionName" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" - }, - { - "$ref": "#/parameters/TopParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of policy set definition versions.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions": { - "get": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_ListBuiltIn", - "summary": "Retrieves built-in policy set definition versions.", - "description": "This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy set definition.", - "x-ms-examples": { - "List built-in policy set definitions": { - "$ref": "./examples/listBuiltInPolicySetDefinitionVersions.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/PolicySetDefinitionName" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" - }, - { - "$ref": "#/parameters/TopParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of built in policy set definition versions.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}": { - "put": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_CreateOrUpdateAtManagementGroup", - "summary": "Creates or updates a policy set definition version.", - "description": "This operation creates or updates a policy set definition version in the given management group with the given name and version.", - "x-ms-examples": { - "Create or update a policy set definition version at management group level": { - "$ref": "./examples/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionName" - }, - { - "$ref": "#/parameters/PolicySetDefinitionVersion" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersion" - }, - "description": "The policy set definition version properties." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "201": { - "description": "Created - Returns information about the policy set definition version.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersion" - } - }, - "200": { - "description": "OK - Successfully updated policy set definition version.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersion" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_DeleteAtManagementGroup", - "summary": "Deletes a policy set definition version.", - "description": "This operation deletes the policy set definition version in the given management group with the given name and version.", - "x-ms-examples": { - "Delete a policy set definition version at management group level": { - "$ref": "./examples/deletePolicySetDefinitionVersionAtManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionName" - }, - { - "$ref": "#/parameters/PolicySetDefinitionVersion" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "No Content - the policy set definition doesn't exist in the subscription." - }, - "200": { - "description": "OK" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "get": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_GetAtManagementGroup", - "summary": "Retrieves a policy set definition version.", - "description": "This operation retrieves the policy set definition version in the given management group with the given name and version.", - "x-ms-examples": { - "Retrieve a policy set definition version at management group level": { - "$ref": "./examples/getPolicySetDefinitionVersionAtManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionName" - }, - { - "$ref": "#/parameters/PolicySetDefinitionVersion" - }, - { - "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns information about the policy set definition version.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersion" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions": { - "get": { - "tags": [ - "PolicySetDefinitionVersions" - ], - "operationId": "PolicySetDefinitionVersions_ListByManagementGroup", - "summary": "Retrieves all policy set definition versions for a given policy set definition in a management group.", - "description": "This operation retrieves a list of all the policy set definition versions for the given policy set definition in a given management group.", - "x-ms-examples": { - "List policy set definitions at management group level": { - "$ref": "./examples/listPolicySetDefinitionVersionsByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionName" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" - }, - { - "$ref": "#/parameters/TopParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of policy set definition versions.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "PolicySetDefinitionVersionProperties": { - "type": "object", - "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" - }, - "x-ms-identifiers": [ - "policyDefinitionReferenceId" - ], - "description": "An array of policy definition references." - }, - "policyDefinitionGroups": { - "type": "array", - "items": { - "$ref": "#/definitions/PolicyDefinitionGroup" - }, - "x-ms-identifiers": [ - "name" - ], - "description": "The metadata describing groups of policy definition references within the policy set definition." - }, - "version": { - "type": "string", - "description": "The policy set definition version in #.#.# format." - } - }, - "required": [ - "policyDefinitions" - ], - "description": "The policy set definition properties." - }, - "PolicyDefinitionReference": { - "type": "object", - "properties": { - "policyDefinitionId": { - "type": "string", - "description": "The ID of the policy definition or policy set definition." - }, - "definitionVersion": { - "type": "string", - "description": "The version of the policy definition to use." - }, - "latestDefinitionVersion": { - "type": "string", - "description": "The latest version of the policy definition available. This is only present if requested via the $expand query parameter.", - "readOnly": true - }, - "effectiveDefinitionVersion": { - "type": "string", - "description": "The effective version of the policy definition in use. This is only present if requested via the $expand query parameter.", - "readOnly": true - }, - "parameters": { - "description": "The parameter values for the referenced policy rule. The keys are the parameter names.", - "$ref": "./policyAssignments.json#/definitions/ParameterValues" - }, - "policyDefinitionReferenceId": { - "type": "string", - "description": "A unique id (within the policy set definition) for this policy definition reference." - }, - "groupNames": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The name of the groups that this policy definition reference belongs to." - } - }, - "required": [ - "policyDefinitionId" - ], - "description": "The policy definition reference." - }, - "PolicyDefinitionGroup": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the group." - }, - "displayName": { - "type": "string", - "description": "The group's display name." - }, - "category": { - "type": "string", - "description": "The group's category." - }, - "description": { - "type": "string", - "description": "The group's description." - }, - "additionalMetadataId": { - "type": "string", - "description": "A resource ID of a resource that contains additional metadata about the group." - } - }, - "required": [ - "name" - ], - "description": "The policy definition group." - }, - "PolicySetDefinitionVersion": { - "type": "object", - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/PolicySetDefinitionVersionProperties", - "description": "The policy set definition version properties." - }, - "id": { - "readOnly": true, - "type": "string", - "description": "The ID of the policy set definition version." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "The name of the policy set definition version." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "The type of the resource (Microsoft.Authorization/policySetDefinitions/versions)." - }, - "systemData": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/systemData", - "readOnly": true, - "description": "The system metadata relating to this resource." - } - }, - "description": "The policy set definition version.", - "x-ms-azure-resource": true - }, - "PolicySetDefinitionVersionListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/PolicySetDefinitionVersion" - }, - "description": "An array of policy set definition versions." - }, - "nextLink": { - "type": "string", - "description": "The URL to use for getting the next set of results." - } - }, - "description": "List of policy set definition versions." - } - }, - "parameters": { - "PolicySetDefinitionName": { - "name": "policySetDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy set definition.", - "x-ms-parameter-location": "method" - }, - "PolicySetDefinitionVersion": { - "name": "policyDefinitionVersion", - "in": "path", - "required": true, - "type": "string", - "pattern": "^\\d+\\.\\d+\\.\\d+$", - "description": "The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", - "x-ms-parameter-location": "method" - }, - "PolicySetDefinitionsFilterParameter": { - "name": "$filter", - "in": "query", - "required": false, - "type": "string", - "description": "The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}.", - "x-ms-skip-url-encoding": true, - "x-ms-parameter-location": "method" - }, - "PolicySetDefinitionsExpandParameter": { - "name": "$expand", - "in": "query", - "required": false, - "type": "string", - "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", - "x-ms-parameter-location": "method" - }, - "TopParameter": { - "name": "$top", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "minimum": 1, - "maximum": 1000, - "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", - "x-ms-parameter-location": "method" - } - } -} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policySetDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policySetDefinitions.json deleted file mode 100644 index fe8dafde6444..000000000000 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policySetDefinitions.json +++ /dev/null @@ -1,761 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "PolicyClient", - "version": "2025-03-01", - "description": "To manage and control access to your resources, you can define customized policies and assign them at a scope." - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": { - "put": { - "tags": [ - "PolicySetDefinitions" - ], - "operationId": "PolicySetDefinitions_CreateOrUpdate", - "summary": "Creates or updates a policy set definition.", - "description": "This operation creates or updates a policy set definition in the given subscription with the given name.", - "x-ms-examples": { - "Create or update a policy set definition": { - "$ref": "./examples/createOrUpdatePolicySetDefinition.json" - }, - "Create or update a policy set definition with groups": { - "$ref": "./examples/createOrUpdatePolicySetDefinitionWithGroups.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "name": "policySetDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy set definition to create." - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PolicySetDefinition" - }, - "description": "The policy set definition properties." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "201": { - "description": "Created - Returns information about the policy set definition.", - "schema": { - "$ref": "#/definitions/PolicySetDefinition" - } - }, - "200": { - "description": "OK - Returns information about the policy set definition.", - "schema": { - "$ref": "#/definitions/PolicySetDefinition" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "PolicySetDefinitions" - ], - "operationId": "PolicySetDefinitions_Delete", - "summary": "Deletes a policy set definition.", - "description": "This operation deletes the policy set definition in the given subscription with the given name.", - "x-ms-examples": { - "Delete a policy set definition": { - "$ref": "./examples/deletePolicySetDefinition.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "name": "policySetDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy set definition to delete." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "No Content - the policy set definition doesn't exist in the subscription." - }, - "200": { - "description": "OK" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "get": { - "tags": [ - "PolicySetDefinitions" - ], - "operationId": "PolicySetDefinitions_Get", - "summary": "Retrieves a policy set definition.", - "description": "This operation retrieves the policy set definition in the given subscription with the given name.", - "x-ms-examples": { - "Retrieve a policy set definition": { - "$ref": "./examples/getPolicySetDefinition.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "name": "policySetDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy set definition to get." - }, - { - "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns information about the policy set definition.", - "schema": { - "$ref": "#/definitions/PolicySetDefinition" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": { - "get": { - "tags": [ - "PolicySetDefinitions" - ], - "operationId": "PolicySetDefinitions_GetBuiltIn", - "summary": "Retrieves a built in policy set definition.", - "description": "This operation retrieves the built-in policy set definition with the given name.", - "x-ms-examples": { - "Retrieve a built-in policy set definition": { - "$ref": "./examples/getBuiltInPolicySetDefinition.json" - } - }, - "parameters": [ - { - "name": "policySetDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy set definition to get." - }, - { - "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns information about the built in policy set definition.", - "schema": { - "$ref": "#/definitions/PolicySetDefinition" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions": { - "get": { - "tags": [ - "PolicySetDefinitions" - ], - "operationId": "PolicySetDefinitions_List", - "summary": "Retrieves the policy set definitions for a subscription.", - "description": "This operation retrieves a list of all the policy set definitions in a given subscription that match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with the subscription, including those that apply directly or from management groups that contain the given subscription. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn and Custom. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}.", - "x-ms-examples": { - "List policy set definitions": { - "$ref": "./examples/listPolicySetDefinitions.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionsFilterParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" - }, - { - "$ref": "#/parameters/TopParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of policy set definitions.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/providers/Microsoft.Authorization/policySetDefinitions": { - "get": { - "tags": [ - "PolicySetDefinitions" - ], - "operationId": "PolicySetDefinitions_ListBuiltIn", - "summary": "Retrieves built-in policy set definitions.", - "description": "This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set definitions whose category match the {value}.", - "x-ms-examples": { - "List built-in policy set definitions": { - "$ref": "./examples/listBuiltInPolicySetDefinitions.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionsFilterParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" - }, - { - "$ref": "#/parameters/TopParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of built in policy set definitions.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": { - "put": { - "tags": [ - "PolicySetDefinitions" - ], - "operationId": "PolicySetDefinitions_CreateOrUpdateAtManagementGroup", - "summary": "Creates or updates a policy set definition.", - "description": "This operation creates or updates a policy set definition in the given management group with the given name.", - "x-ms-examples": { - "Create or update a policy set definition at management group level": { - "$ref": "./examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json" - }, - "Create or update a policy set definition with groups at management group level": { - "$ref": "./examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/ManagementGroupIdParameter" - }, - { - "name": "policySetDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy set definition to create." - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PolicySetDefinition" - }, - "description": "The policy set definition properties." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "201": { - "description": "Created - Returns information about the policy set definition.", - "schema": { - "$ref": "#/definitions/PolicySetDefinition" - } - }, - "200": { - "description": "OK - Returns information about the policy set definition.", - "schema": { - "$ref": "#/definitions/PolicySetDefinition" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "PolicySetDefinitions" - ], - "operationId": "PolicySetDefinitions_DeleteAtManagementGroup", - "summary": "Deletes a policy set definition.", - "description": "This operation deletes the policy set definition in the given management group with the given name.", - "x-ms-examples": { - "Delete a policy set definition at management group level": { - "$ref": "./examples/deletePolicySetDefinitionAtManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/ManagementGroupIdParameter" - }, - { - "name": "policySetDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy set definition to delete." - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "No Content - the policy set definition doesn't exist in the subscription." - }, - "200": { - "description": "OK" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - }, - "get": { - "tags": [ - "PolicySetDefinitions" - ], - "operationId": "PolicySetDefinitions_GetAtManagementGroup", - "summary": "Retrieves a policy set definition.", - "description": "This operation retrieves the policy set definition in the given management group with the given name.", - "x-ms-examples": { - "Retrieve a policy set definition at management group level": { - "$ref": "./examples/getPolicySetDefinitionAtManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/ManagementGroupIdParameter" - }, - { - "name": "policySetDefinitionName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$", - "description": "The name of the policy set definition to get." - }, - { - "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns information about the policy set definition.", - "schema": { - "$ref": "#/definitions/PolicySetDefinition" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions": { - "get": { - "tags": [ - "PolicySetDefinitions" - ], - "operationId": "PolicySetDefinitions_ListByManagementGroup", - "summary": "Retrieves all policy set definitions in management group.", - "description": "This operation retrieves a list of all the policy set definitions in a given management group that match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with the management group, including those that apply directly or from management groups that contain the given management group. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given management group. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn and Custom. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}.", - "x-ms-examples": { - "List policy set definitions at management group level": { - "$ref": "./examples/listPolicySetDefinitionsByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/ManagementGroupIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionsFilterParameter" - }, - { - "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" - }, - { - "$ref": "#/parameters/TopParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of policy set definitions.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "PolicySetDefinitionProperties": { - "type": "object", - "properties": { - "policyType": { - "type": "string", - "description": "The type of policy set definition. Possible values are NotSpecified, BuiltIn, Custom, and Static.", - "enum": [ - "NotSpecified", - "BuiltIn", - "Custom", - "Static" - ], - "x-ms-enum": { - "name": "policyType", - "modelAsString": true - } - }, - "displayName": { - "type": "string", - "description": "The display name of the policy set definition." - }, - "description": { - "type": "string", - "description": "The policy set definition description." - }, - "metadata": { - "type": "object", - "description": "The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." - }, - "parameters": { - "description": "The policy set definition parameters that can be used in policy definition references.", - "$ref": "./policyDefinitions.json#/definitions/ParameterDefinitions" - }, - "policyDefinitions": { - "type": "array", - "items": { - "$ref": "#/definitions/PolicyDefinitionReference" - }, - "x-ms-identifiers": [ - "policyDefinitionReferenceId" - ], - "description": "An array of policy definition references." - }, - "policyDefinitionGroups": { - "type": "array", - "items": { - "$ref": "#/definitions/PolicyDefinitionGroup" - }, - "x-ms-identifiers": [ - "name" - ], - "description": "The metadata describing groups of policy definition references within the policy set definition." - }, - "version": { - "type": "string", - "description": "The policy set definition version in #.#.# format." - }, - "versions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of available versions for this policy set definition." - } - }, - "required": [ - "policyDefinitions" - ], - "description": "The policy set definition properties." - }, - "PolicyDefinitionReference": { - "type": "object", - "properties": { - "policyDefinitionId": { - "type": "string", - "description": "The ID of the policy definition or policy set definition." - }, - "definitionVersion": { - "type": "string", - "description": "The version of the policy definition to use." - }, - "latestDefinitionVersion": { - "type": "string", - "description": "The latest version of the policy definition available. This is only present if requested via the $expand query parameter.", - "readOnly": true - }, - "effectiveDefinitionVersion": { - "type": "string", - "description": "The effective version of the policy definition in use. This is only present if requested via the $expand query parameter.", - "readOnly": true - }, - "parameters": { - "description": "The parameter values for the referenced policy rule. The keys are the parameter names.", - "$ref": "./policyAssignments.json#/definitions/ParameterValues" - }, - "policyDefinitionReferenceId": { - "type": "string", - "description": "A unique id (within the policy set definition) for this policy definition reference." - }, - "groupNames": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The name of the groups that this policy definition reference belongs to." - } - }, - "required": [ - "policyDefinitionId" - ], - "description": "The policy definition reference." - }, - "PolicyDefinitionGroup": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the group." - }, - "displayName": { - "type": "string", - "description": "The group's display name." - }, - "category": { - "type": "string", - "description": "The group's category." - }, - "description": { - "type": "string", - "description": "The group's description." - }, - "additionalMetadataId": { - "type": "string", - "description": "A resource ID of a resource that contains additional metadata about the group." - } - }, - "required": [ - "name" - ], - "description": "The policy definition group." - }, - "PolicySetDefinition": { - "type": "object", - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/PolicySetDefinitionProperties", - "description": "The policy set definition properties." - }, - "id": { - "readOnly": true, - "type": "string", - "description": "The ID of the policy set definition." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "The name of the policy set definition." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "The type of the resource (Microsoft.Authorization/policySetDefinitions)." - }, - "systemData": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/systemData", - "readOnly": true, - "description": "The system metadata relating to this resource." - } - }, - "description": "The policy set definition.", - "x-ms-azure-resource": true - }, - "PolicySetDefinitionListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/PolicySetDefinition" - }, - "description": "An array of policy set definitions." - }, - "nextLink": { - "type": "string", - "description": "The URL to use for getting the next set of results." - } - }, - "description": "List of policy set definitions." - } - }, - "parameters": { - "ManagementGroupIdParameter": { - "name": "managementGroupId", - "in": "path", - "required": true, - "type": "string", - "description": "The ID of the management group.", - "x-ms-parameter-location": "method" - }, - "PolicySetDefinitionsFilterParameter": { - "name": "$filter", - "in": "query", - "required": false, - "type": "string", - "description": "The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}.", - "x-ms-skip-url-encoding": true, - "x-ms-parameter-location": "method" - }, - "PolicySetDefinitionsExpandParameter": { - "name": "$expand", - "in": "query", - "required": false, - "type": "string", - "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", - "x-ms-parameter-location": "method" - }, - "TopParameter": { - "name": "$top", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "minimum": 1, - "maximum": 1000, - "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", - "x-ms-parameter-location": "method" - } - } -} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyTokens.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyTokens.json deleted file mode 100644 index 7e16523c1f0a..000000000000 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/policyTokens.json +++ /dev/null @@ -1,368 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "PolicyClient", - "version": "2025-03-01", - "description": "Allows resource operations to call external endpoints, issuing tokens upon validation." - }, - "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/acquirePolicyToken": { - "post": { - "tags": [ - "PolicyTokens" - ], - "operationId": "PolicyTokens_Acquire", - "summary": "Acquires a policy token.", - "description": "This operation acquires a policy token in the given subscription for the given request body.", - "x-ms-examples": { - "Acquire a policy token": { - "$ref": "./examples/acquirePolicyToken.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PolicyTokenRequest" - }, - "description": "The policy token properties." - } - ], - "responses": { - "200": { - "description": "Successfully acquired the policy token.", - "schema": { - "$ref": "#/definitions/PolicyTokenResponse" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/acquirePolicyToken": { - "post": { - "tags": [ - "PolicyTokens" - ], - "operationId": "PolicyTokens_AcquireAtManagementGroup", - "summary": "Acquires a policy token at management group level.", - "description": "This operation acquires a policy token in the given management group for the given request body.", - "x-ms-examples": { - "Acquire a policy token at management group level": { - "$ref": "./examples/acquirePolicyTokenAtManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ManagementGroupNameParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PolicyTokenRequest" - }, - "description": "The policy token properties." - } - ], - "responses": { - "200": { - "description": "Successfully acquired the policy token.", - "schema": { - "$ref": "#/definitions/PolicyTokenResponse" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "PolicyTokenRequest": { - "type": "object", - "properties": { - "operation": { - "description": "The resource operation to acquire a token for.", - "$ref": "#/definitions/PolicyTokenOperation" - }, - "changeReference": { - "type": "string", - "description": "The change reference." - } - }, - "required": [ - "operation" - ], - "description": "The policy token request properties." - }, - "PolicyTokenResponse": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "The result of the completed token acquisition operation. Possible values are Succeeded and Failed.", - "enum": [ - "Succeeded", - "Failed" - ], - "x-ms-enum": { - "name": "policyTokenResult", - "modelAsString": true - } - }, - "message": { - "type": "string", - "description": "Status message with additional details about the token acquisition operation result." - }, - "retryAfter": { - "type": "string", - "format": "date-time", - "description": "The date and time after which the client can try to acquire a token again in the case of retry-able failures." - }, - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/ExternalEvaluationEndpointInvocationResult" - }, - "description": "An array of external evaluation endpoint invocation results." - }, - "changeReference": { - "type": "string", - "description": "The change reference associated with the operation for which the token is acquired." - }, - "token": { - "type": "string", - "description": "The issued policy token." - }, - "tokenId": { - "type": "string", - "description": "The unique Id assigned to the policy token." - }, - "expiration": { - "type": "string", - "format": "date-time", - "description": "The expiration of the policy token." - } - }, - "description": "The policy token response properties." - }, - "PolicyTokenOperation": { - "type": "object", - "properties": { - "uri": { - "type": "string", - "description": "The request URI of the resource operation." - }, - "httpMethod": { - "type": "string", - "description": "The http method of the resource operation." - }, - "content": { - "type": "object", - "description": "The payload of the resource operation." - } - }, - "required": [ - "uri", - "httpMethod" - ], - "description": "The resource operation to acquire a token for." - }, - "ExternalEvaluationEndpointInvocationResult": { - "type": "object", - "properties": { - "policyInfo": { - "description": "The details of the policy requiring the external endpoint invocation.", - "$ref": "#/definitions/PolicyLogInfo" - }, - "result": { - "type": "string", - "description": "The result of the external endpoint. Possible values are Succeeded and Failed.", - "enum": [ - "Succeeded", - "Failed" - ], - "x-ms-enum": { - "name": "externalEndpointResult", - "modelAsString": true - } - }, - "message": { - "type": "string", - "description": "The status message with additional details about the invocation result." - }, - "retryAfter": { - "type": "string", - "format": "date-time", - "description": "The date and time after which a failed endpoint invocation can be retried." - }, - "claims": { - "type": "object", - "description": "The set of claims that will be attached to the policy token as an attestation for the result of the endpoint invocation." - }, - "expiration": { - "type": "string", - "format": "date-time", - "description": "The expiration of the results." - } - }, - "description": "The external evaluation endpoint invocation results." - }, - "PolicyLogInfo": { - "type": "object", - "properties": { - "policyDefinitionId": { - "type": "string", - "description": "The policy definition Id." - }, - "policySetDefinitionId": { - "type": "string", - "description": "The policy set definition Id." - }, - "policyDefinitionReferenceId": { - "type": "string", - "description": "The policy definition instance Id inside a policy set." - }, - "policySetDefinitionName": { - "type": "string", - "description": "The policy set definition name." - }, - "policySetDefinitionDisplayName": { - "type": "string", - "description": "The policy set definition display name." - }, - "policySetDefinitionVersion": { - "type": "string", - "description": "The policy set definition version." - }, - "policySetDefinitionCategory": { - "type": "string", - "description": "The policy set definition category." - }, - "policyDefinitionName": { - "type": "string", - "description": "The policy definition name." - }, - "policyDefinitionDisplayName": { - "type": "string", - "description": "The policy definition display name." - }, - "policyDefinitionVersion": { - "type": "string", - "description": "The policy definition version." - }, - "policyDefinitionEffect": { - "type": "string", - "description": "The policy definition action." - }, - "policyDefinitionGroupNames": { - "type": "array", - "items": { - "type": "string" - }, - "description": "An array of policy definition group names." - }, - "policyAssignmentId": { - "type": "string", - "description": "The policy assignment Id." - }, - "policyAssignmentName": { - "type": "string", - "description": "The policy assignment name." - }, - "policyAssignmentDisplayName": { - "type": "string", - "description": "The policy assignment display name." - }, - "policyAssignmentVersion": { - "type": "string", - "description": "The policy assignment version." - }, - "policyAssignmentScope": { - "type": "string", - "description": "The policy assignment scope." - }, - "resourceLocation": { - "type": "string", - "description": "The resource location." - }, - "ancestors": { - "type": "string", - "description": "The management group ancestors." - }, - "complianceReasonCode": { - "type": "string", - "description": "The policy compliance reason code." - }, - "policyExemptionIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "An array of policy exemption Ids." - } - }, - "description": "The policy log info." - } - }, - "parameters": { - "ManagementGroupNameParameter": { - "name": "managementGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the management group.", - "x-ms-parameter-location": "method" - } - } -} From a08106774f0ff7e331b62b68608f483778ab53dd Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 29 Oct 2025 15:48:17 +0800 Subject: [PATCH 13/45] add client.tsp --- .../Authorization.Management/client.tsp | 16 ++++++++++++++++ .../resources/Authorization.Management/main.tsp | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 specification/resources/Authorization.Management/client.tsp diff --git a/specification/resources/Authorization.Management/client.tsp b/specification/resources/Authorization.Management/client.tsp new file mode 100644 index 000000000000..7d3306d8c2dc --- /dev/null +++ b/specification/resources/Authorization.Management/client.tsp @@ -0,0 +1,16 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-client-generator-core"; +import "./main.tsp"; + +using Azure.ClientGenerator.Core; +using TypeSpec.Http; + +// namespace Microsoft.Authorization { +// @clientLocation(PolicyAssignments) +// @get +// @route("/{policyAssignmentId}") +// op getById( +// @path policyAssignmentId: string, +// ...Azure.Core.Foundations.ApiVersionParameter, +// ): PolicyAssignment; +// } diff --git a/specification/resources/Authorization.Management/main.tsp b/specification/resources/Authorization.Management/main.tsp index 6ff11e356484..a77bcb30e725 100644 --- a/specification/resources/Authorization.Management/main.tsp +++ b/specification/resources/Authorization.Management/main.tsp @@ -27,10 +27,10 @@ using Azure.Core; using Azure.ResourceManager; using TypeSpec.Versioning; -#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "For backward compatibility" /** * To manage and control access to your resources, you can define customized policies and assign them at a scope. */ +#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "For backward compatibility" @armProviderNamespace @service(#{ title: "PolicyClient" }) @versioned(Versions) From 86c76e543eef9e3d4f3d22e02bb819bab441d0d8 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 10:58:50 +0800 Subject: [PATCH 14/45] remove operationId --- .../Authorization.Management/PolicyDefinition.tsp | 6 ------ .../Authorization.Management/PolicyDefinitionVersion.tsp | 6 ------ .../Authorization.Management/PolicySetDefinition.tsp | 6 ------ .../PolicySetDefinitionVersion.tsp | 6 ------ .../resources/Authorization.Management/routes.tsp | 8 -------- 5 files changed, 32 deletions(-) diff --git a/specification/resources/Authorization.Management/PolicyDefinition.tsp b/specification/resources/Authorization.Management/PolicyDefinition.tsp index 2039c7a64eac..ca8b156dac47 100644 --- a/specification/resources/Authorization.Management/PolicyDefinition.tsp +++ b/specification/resources/Authorization.Management/PolicyDefinition.tsp @@ -145,14 +145,12 @@ interface PolicyDefinitions { * This operation retrieves the built-in policy definition with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitions_GetBuiltIn") getBuiltIn is PolicyDefinitionTenantOps.Read; /** * 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}. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitions_ListBuiltIn") listBuiltIn is PolicyDefinitionTenantOps.List< PolicyDefinition, Parameters = { @@ -176,7 +174,6 @@ interface PolicyDefinitions { * This operation retrieves the policy definition in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitions_GetAtManagementGroup") getAtManagementGroup is PolicyDefinitionManagementGroupOps.Read; /** @@ -184,7 +181,6 @@ interface PolicyDefinitions { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility" - @operationId("PolicyDefinitions_CreateOrUpdateAtManagementGroup") createOrUpdateAtManagementGroup is PolicyDefinitionManagementGroupOps.CreateOrUpdateSync< PolicyDefinition, Response = ArmResourceCreatedSyncResponse @@ -194,14 +190,12 @@ interface PolicyDefinitions { * This operation deletes the policy definition in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitions_DeleteAtManagementGroup") deleteAtManagementGroup is PolicyDefinitionManagementGroupOps.DeleteSync; /** * 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}. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitions_ListByManagementGroup") listByManagementGroup is PolicyDefinitionManagementGroupOps.List< PolicyDefinition, Parameters = { diff --git a/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp b/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp index f4451294fb1f..5fc0a59042f9 100644 --- a/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp +++ b/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp @@ -165,14 +165,12 @@ interface PolicyDefinitionVersions { * This operation retrieves the built-in policy definition version with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitionVersions_GetBuiltIn") getBuiltIn is PolicyDefinitionVersionTenantOps.Read; /** * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitionVersions_ListBuiltIn") listBuiltIn is PolicyDefinitionVersionTenantOps.List< PolicyDefinitionVersion, Parameters = { @@ -190,28 +188,24 @@ interface PolicyDefinitionVersions { * This operation retrieves the policy definition version in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitionVersions_GetAtManagementGroup") getAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.Read; /** * This operation creates or updates a policy definition version in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitionVersions_CreateOrUpdateAtManagementGroup") createOrUpdateAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.CreateOrUpdateSync; /** * This operation deletes the policy definition in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitionVersions_DeleteAtManagementGroup") deleteAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.DeleteSync; /** * This operation retrieves a list of all the policy definition versions for the given policy definition in the given management group. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicyDefinitionVersions_ListByManagementGroup") listByManagementGroup is PolicyDefinitionVersionManagementGroupOps.List< PolicyDefinitionVersion, Parameters = { diff --git a/specification/resources/Authorization.Management/PolicySetDefinition.tsp b/specification/resources/Authorization.Management/PolicySetDefinition.tsp index 195e2e647472..9b582fe48634 100644 --- a/specification/resources/Authorization.Management/PolicySetDefinition.tsp +++ b/specification/resources/Authorization.Management/PolicySetDefinition.tsp @@ -156,7 +156,6 @@ interface PolicySetDefinitions { * This operation retrieves the built-in policy set definition with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicySetDefinitions_GetBuiltIn") getBuiltIn is PolicySetDefinitionTenantOps.Read< PolicySetDefinition, Parameters = { @@ -172,7 +171,6 @@ interface PolicySetDefinitions { * 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}. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicySetDefinitions_ListBuiltIn") listBuiltIn is PolicySetDefinitionTenantOps.List< PolicySetDefinition, Parameters = { @@ -202,7 +200,6 @@ interface PolicySetDefinitions { * This operation retrieves the policy set definition in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicySetDefinitions_GetAtManagementGroup") getAtManagementGroup is PolicySetDefinitionManagementGroupOps.Read< PolicySetDefinition, Parameters = { @@ -218,21 +215,18 @@ interface PolicySetDefinitions { * This operation creates or updates a policy set definition in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicySetDefinitions_CreateOrUpdateAtManagementGroup") createOrUpdateAtManagementGroup is PolicySetDefinitionManagementGroupOps.CreateOrUpdateSync; /** * This operation deletes the policy set definition in the given management group with the given name. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicySetDefinitions_DeleteAtManagementGroup") deleteAtManagementGroup is PolicySetDefinitionManagementGroupOps.DeleteSync; /** * 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}. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicySetDefinitions_ListByManagementGroup") listByManagementGroup is PolicySetDefinitionManagementGroupOps.List< PolicySetDefinition, Parameters = { diff --git a/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp b/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp index f3c0724ecee2..5671050ccba7 100644 --- a/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp +++ b/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp @@ -180,7 +180,6 @@ interface PolicySetDefinitionVersions { * This operation retrieves the built-in policy set definition version with the given name and version. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicySetDefinitionVersions_GetBuiltIn") getBuiltIn is PolicySetDefinitionVersionTenantOps.Read< PolicySetDefinitionVersion, Parameters = { @@ -196,7 +195,6 @@ interface PolicySetDefinitionVersions { * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy set definition. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicySetDefinitionVersions_ListBuiltIn") listBuiltIn is PolicySetDefinitionVersionTenantOps.List< PolicySetDefinitionVersion, Parameters = { @@ -220,7 +218,6 @@ interface PolicySetDefinitionVersions { * This operation retrieves the policy set definition version in the given management group with the given name and version. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicySetDefinitionVersions_GetAtManagementGroup") getAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.Read< PolicySetDefinitionVersion, Parameters = { @@ -236,21 +233,18 @@ interface PolicySetDefinitionVersions { * This operation creates or updates a policy set definition version in the given management group with the given name and version. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicySetDefinitionVersions_CreateOrUpdateAtManagementGroup") createOrUpdateAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.CreateOrUpdateSync; /** * This operation deletes the policy set definition version in the given management group with the given name and version. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicySetDefinitionVersions_DeleteAtManagementGroup") deleteAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.DeleteSync; /** * This operation retrieves a list of all the policy set definition versions for the given policy set definition in a given management group. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" - @operationId("PolicySetDefinitionVersions_ListByManagementGroup") listByManagementGroup is PolicySetDefinitionVersionManagementGroupOps.List< PolicySetDefinitionVersion, Parameters = { diff --git a/specification/resources/Authorization.Management/routes.tsp b/specification/resources/Authorization.Management/routes.tsp index 09cf231e8a04..63bcd6750a2b 100644 --- a/specification/resources/Authorization.Management/routes.tsp +++ b/specification/resources/Authorization.Management/routes.tsp @@ -20,7 +20,6 @@ interface PolicyDefinitionVersionsOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all built-in policy definition versions.") - @operationId("PolicyDefinitionVersions_ListAllBuiltins") @autoRoute @action("listPolicyDefinitionVersions") listAllBuiltins is ArmProviderActionSync>; @@ -29,7 +28,6 @@ interface PolicyDefinitionVersionsOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all policy definition versions at management group scope.") - @operationId("PolicyDefinitionVersions_ListAllAtManagementGroup") @autoRoute @action("listPolicyDefinitionVersions") listAllAtManagementGroup is ArmProviderActionSync< @@ -50,7 +48,6 @@ interface PolicyDefinitionVersionsOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all policy definition versions within a subscription.") - @operationId("PolicyDefinitionVersions_ListAll") @autoRoute @action("listPolicyDefinitionVersions") listAll is ArmProviderActionSync< @@ -66,7 +63,6 @@ interface PolicySetDefinitionVersionsOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all built-in policy set definition versions.") - @operationId("PolicySetDefinitionVersions_ListAllBuiltins") @autoRoute @action("listPolicySetDefinitionVersions") listAllBuiltins is ArmProviderActionSync>; @@ -75,7 +71,6 @@ interface PolicySetDefinitionVersionsOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all policy set definition versions at management group scope.") - @operationId("PolicySetDefinitionVersions_ListAllAtManagementGroup") @autoRoute @action("listPolicySetDefinitionVersions") listAllAtManagementGroup is ArmProviderActionSync< @@ -96,7 +91,6 @@ interface PolicySetDefinitionVersionsOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all policy set definition versions within a subscription.") - @operationId("PolicySetDefinitionVersions_ListAll") @autoRoute @action("listPolicySetDefinitionVersions") listAll is ArmProviderActionSync< @@ -112,7 +106,6 @@ interface PolicyTokensOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Acquires a policy token.") - @operationId("PolicyTokens_Acquire") @autoRoute @action("acquirePolicyToken") acquire is ArmProviderActionSync< @@ -125,7 +118,6 @@ interface PolicyTokensOperationGroup { */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Acquires a policy token at management group level.") - @operationId("PolicyTokens_AcquireAtManagementGroup") @autoRoute @action("acquirePolicyToken") acquireAtManagementGroup is ArmProviderActionSync< From 18bbded179d6b7af839ab37fe597573708d0b3ce Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 13:20:20 +0800 Subject: [PATCH 15/45] fix listForResourceGroup --- .../PolicyAssignment.tsp | 5 +- .../stable/2025-03-01/openapi.json | 140 +++++++++--------- 2 files changed, 67 insertions(+), 78 deletions(-) diff --git a/specification/resources/Authorization.Management/PolicyAssignment.tsp b/specification/resources/Authorization.Management/PolicyAssignment.tsp index 1843a153c490..09996448f277 100644 --- a/specification/resources/Authorization.Management/PolicyAssignment.tsp +++ b/specification/resources/Authorization.Management/PolicyAssignment.tsp @@ -85,12 +85,9 @@ interface PolicyAssignments { * 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. */ listForResourceGroup is Extension.ListByTarget< - Extension.ScopeParameter, + Extension.ResourceGroup, PolicyAssignment, Parameters = { - ...SubscriptionIdParameter; - ...ResourceGroupParameter; - /** * 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}. */ diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 94fffff8046b..45d97e89a293 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -316,80 +316,6 @@ } } }, - "/{scope}/providers/Microsoft.Authorization/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/policyAssignments": { - "get": { - "operationId": "PolicyAssignments_ListForResourceGroup", - "tags": [ - "PolicyAssignments" - ], - "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.", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "name": "scope", - "in": "path", - "description": "The fully qualified Azure Resource manager identifier of the resource.", - "required": true, - "type": "string", - "x-ms-skip-url-encoding": true - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" - }, - { - "name": "$filter", - "in": "query", - "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}.", - "required": false, - "type": "string" - }, - { - "name": "$expand", - "in": "query", - "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", - "required": false, - "type": "string" - }, - { - "name": "$top", - "in": "query", - "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", - "required": false, - "type": "integer", - "format": "int32", - "minimum": 1, - "maximum": 1000 - } - ], - "responses": { - "200": { - "description": "Azure operation completed successfully.", - "schema": { - "$ref": "#/definitions/PolicyAssignmentListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "List policy assignments that apply to a resource group": { - "$ref": "./examples/listPolicyAssignmentsForResourceGroup.json" - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, "/providers/Microsoft.Authorization/listPolicyDefinitionVersions": { "post": { "operationId": "PolicyDefinitionVersions_ListAllBuiltins", @@ -2923,6 +2849,72 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments": { + "get": { + "operationId": "PolicyAssignments_ListForResourceGroup", + "tags": [ + "PolicyAssignments" + ], + "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.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "$filter", + "in": "query", + "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}.", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyAssignmentListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List policy assignments that apply to a resource group": { + "$ref": "./examples/listPolicyAssignmentsForResourceGroup.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } } }, "definitions": { From 204b2d373c51d4905547fd71bc70270c5c09a127 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 13:21:34 +0800 Subject: [PATCH 16/45] use v6 common-types --- .../Authorization.Management/main.tsp | 2 +- .../stable/2025-03-01/openapi.json | 264 +++++++++--------- 2 files changed, 133 insertions(+), 133 deletions(-) diff --git a/specification/resources/Authorization.Management/main.tsp b/specification/resources/Authorization.Management/main.tsp index a77bcb30e725..1341e97c1a7d 100644 --- a/specification/resources/Authorization.Management/main.tsp +++ b/specification/resources/Authorization.Management/main.tsp @@ -34,7 +34,7 @@ using TypeSpec.Versioning; @armProviderNamespace @service(#{ title: "PolicyClient" }) @versioned(Versions) -@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) +@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v6) namespace Microsoft.Authorization; /** diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 45d97e89a293..1c7d8dadf1c8 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -65,7 +65,7 @@ "description": "This operation retrieves a single policy assignment, given its name and the scope it was created at.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "scope", @@ -101,7 +101,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -131,7 +131,7 @@ "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.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "scope", @@ -169,7 +169,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -208,7 +208,7 @@ "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.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "scope", @@ -246,7 +246,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -273,7 +273,7 @@ "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}'.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "scope", @@ -305,7 +305,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -323,7 +323,7 @@ "description": "This operation lists all the built-in policy definition versions for all built-in policy definitions.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -336,7 +336,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -354,7 +354,7 @@ "description": "This operation lists all the built-in policy set definition versions for all built-in policy set definitions.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -367,7 +367,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -385,7 +385,7 @@ "description": "This operation acquires a policy token in the given management group for the given request body.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -414,7 +414,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -432,7 +432,7 @@ "description": "This operation lists all the policy definition versions for all policy definitions at the management group scope.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -454,7 +454,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -472,7 +472,7 @@ "description": "This operation lists all the policy set definition versions for all policy set definitions at the management group scope.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -494,7 +494,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -514,7 +514,7 @@ "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}.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "$filter", @@ -544,7 +544,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -567,7 +567,7 @@ "description": "This operation retrieves the built-in policy definition with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "policyDefinitionName", @@ -588,7 +588,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -608,7 +608,7 @@ "description": "This operation retrieves a list of all the built-in policy definition versions for the given policy definition.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "policyDefinitionName", @@ -639,7 +639,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -662,7 +662,7 @@ "description": "This operation retrieves the built-in policy definition version with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "policyDefinitionName", @@ -691,7 +691,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -711,7 +711,7 @@ "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}.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "$filter", @@ -748,7 +748,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -771,7 +771,7 @@ "description": "This operation retrieves the built-in policy set definition with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "policySetDefinitionName", @@ -799,7 +799,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -819,7 +819,7 @@ "description": "This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy set definition.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "policySetDefinitionName", @@ -857,7 +857,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -880,7 +880,7 @@ "description": "This operation retrieves the built-in policy set definition version with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "policySetDefinitionName", @@ -916,7 +916,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -936,7 +936,7 @@ "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}.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -973,7 +973,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -996,7 +996,7 @@ "description": "This operation retrieves the policy definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1024,7 +1024,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1042,7 +1042,7 @@ "description": "This operation creates or updates a policy definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1079,7 +1079,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1097,7 +1097,7 @@ "description": "This operation deletes the policy definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1125,7 +1125,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1145,7 +1145,7 @@ "description": "This operation retrieves a list of all the policy definition versions for the given policy definition in the given management group.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -1183,7 +1183,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1206,7 +1206,7 @@ "description": "This operation retrieves the policy definition version in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -1242,7 +1242,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1260,7 +1260,7 @@ "description": "This operation creates or updates a policy definition version in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -1311,7 +1311,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1329,7 +1329,7 @@ "description": "This operation deletes the policy definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -1365,7 +1365,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1385,7 +1385,7 @@ "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}.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1429,7 +1429,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1452,7 +1452,7 @@ "description": "This operation retrieves the policy set definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1487,7 +1487,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1505,7 +1505,7 @@ "description": "This operation creates or updates a policy set definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1548,7 +1548,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1569,7 +1569,7 @@ "description": "This operation deletes the policy set definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1597,7 +1597,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1617,7 +1617,7 @@ "description": "This operation retrieves a list of all the policy set definition versions for the given policy set definition in a given management group.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -1662,7 +1662,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1685,7 +1685,7 @@ "description": "This operation retrieves the policy set definition version in the given management group with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -1728,7 +1728,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1746,7 +1746,7 @@ "description": "This operation creates or updates a policy set definition version in the given management group with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -1797,7 +1797,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1815,7 +1815,7 @@ "description": "This operation deletes the policy set definition version in the given management group with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -1851,7 +1851,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1869,10 +1869,10 @@ "description": "This operation acquires a policy token in the given subscription for the given request body.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "body", @@ -1894,7 +1894,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1912,10 +1912,10 @@ "description": "This operation lists all the policy definition versions for all policy definitions within a subscription.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -1928,7 +1928,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1946,10 +1946,10 @@ "description": "This operation lists all the policy set definition versions for all policy set definitions within a subscription.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -1962,7 +1962,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -1982,10 +1982,10 @@ "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}.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "$filter", @@ -2015,7 +2015,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2038,10 +2038,10 @@ "description": "This operation retrieves the policy definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2062,7 +2062,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2080,10 +2080,10 @@ "description": "This operation creates or updates a policy definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2113,7 +2113,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2137,10 +2137,10 @@ "description": "This operation deletes the policy definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2161,7 +2161,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2181,10 +2181,10 @@ "description": "This operation retrieves a list of all the policy definition versions for the given policy definition.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2215,7 +2215,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2238,10 +2238,10 @@ "description": "This operation retrieves the policy definition version in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2270,7 +2270,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2288,10 +2288,10 @@ "description": "This operation creates or updates a policy definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2335,7 +2335,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2353,10 +2353,10 @@ "description": "This operation deletes the policy definition version in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2385,7 +2385,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2405,10 +2405,10 @@ "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}.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "$filter", @@ -2445,7 +2445,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2468,10 +2468,10 @@ "description": "This operation retrieves the policy set definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2499,7 +2499,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2517,10 +2517,10 @@ "description": "This operation creates or updates a policy set definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2556,7 +2556,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2577,10 +2577,10 @@ "description": "This operation deletes the policy set definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2601,7 +2601,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2621,10 +2621,10 @@ "description": "This operation retrieves a list of all the policy set definition versions for the given policy set definition.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2662,7 +2662,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2685,10 +2685,10 @@ "description": "This operation retrieves the policy set definition version in the given subscription with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2724,7 +2724,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2742,10 +2742,10 @@ "description": "This operation creates or updates a policy set definition version in the given subscription with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2789,7 +2789,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2807,10 +2807,10 @@ "description": "This operation deletes the policy set definition version in the given subscription with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2839,7 +2839,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -2859,13 +2859,13 @@ "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.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "$filter", @@ -2902,7 +2902,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" } } }, @@ -3268,7 +3268,7 @@ }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource" } ] }, @@ -3467,7 +3467,7 @@ }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource" } ] }, @@ -3629,7 +3629,7 @@ }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource" } ] }, @@ -3806,7 +3806,7 @@ }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource" } ] }, @@ -3905,7 +3905,7 @@ }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource" } ] }, From 4f2b11fd087872eb5adaf8ed3ec6fa3d3e9e953e Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 13:31:00 +0800 Subject: [PATCH 17/45] use CommonTypes.ManagementGroupNameParameter --- .../PolicyDefinitionVersion.tsp | 6 +-- .../PolicySetDefinitionVersion.tsp | 6 +-- .../stable/2025-03-01/openapi.json | 48 ++++--------------- 3 files changed, 10 insertions(+), 50 deletions(-) diff --git a/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp b/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp index 5fc0a59042f9..d08b05bf9a9c 100644 --- a/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp +++ b/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp @@ -93,11 +93,7 @@ alias PolicyDefinitionVersionManagementGroupOps = Azure.ResourceManager.Legacy.E @key providerNamespace: "Microsoft.Management"; - /** The name of the management group. The name is case insensitive. */ - @path - @segment("managementGroups") - @key - managementGroupName: string; + ...CommonTypes.ManagementGroupNameParameter; }, { ...Extension.ExtensionProviderNamespace; diff --git a/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp b/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp index 5671050ccba7..f575a3365af3 100644 --- a/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp +++ b/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp @@ -93,11 +93,7 @@ alias PolicySetDefinitionVersionManagementGroupOps = Azure.ResourceManager.Legac @key providerNamespace: "Microsoft.Management"; - /** The name of the management group. The name is case insensitive. */ - @path - @segment("managementGroups") - @key - managementGroupName: string; + ...CommonTypes.ManagementGroupNameParameter; }, { ...Extension.ExtensionProviderNamespace; diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 1c7d8dadf1c8..1ef8e84b24c8 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -1148,11 +1148,7 @@ "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "name": "managementGroupName", - "in": "path", - "description": "The name of the management group. The name is case insensitive.", - "required": true, - "type": "string" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policyDefinitionName", @@ -1209,11 +1205,7 @@ "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "name": "managementGroupName", - "in": "path", - "description": "The name of the management group. The name is case insensitive.", - "required": true, - "type": "string" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policyDefinitionName", @@ -1263,11 +1255,7 @@ "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "name": "managementGroupName", - "in": "path", - "description": "The name of the management group. The name is case insensitive.", - "required": true, - "type": "string" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policyDefinitionName", @@ -1332,11 +1320,7 @@ "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "name": "managementGroupName", - "in": "path", - "description": "The name of the management group. The name is case insensitive.", - "required": true, - "type": "string" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policyDefinitionName", @@ -1620,11 +1604,7 @@ "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "name": "managementGroupName", - "in": "path", - "description": "The name of the management group. The name is case insensitive.", - "required": true, - "type": "string" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policySetDefinitionName", @@ -1688,11 +1668,7 @@ "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "name": "managementGroupName", - "in": "path", - "description": "The name of the management group. The name is case insensitive.", - "required": true, - "type": "string" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policySetDefinitionName", @@ -1749,11 +1725,7 @@ "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "name": "managementGroupName", - "in": "path", - "description": "The name of the management group. The name is case insensitive.", - "required": true, - "type": "string" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policySetDefinitionName", @@ -1818,11 +1790,7 @@ "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" }, { - "name": "managementGroupName", - "in": "path", - "description": "The name of the management group. The name is case insensitive.", - "required": true, - "type": "string" + "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policySetDefinitionName", From b98663d7a1a5a0c21bcb937342293693ed850004 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 13:33:16 +0800 Subject: [PATCH 18/45] revert back to common-types v5 --- .../Authorization.Management/main.tsp | 2 +- .../stable/2025-03-01/openapi.json | 280 +++++++++--------- 2 files changed, 141 insertions(+), 141 deletions(-) diff --git a/specification/resources/Authorization.Management/main.tsp b/specification/resources/Authorization.Management/main.tsp index 1341e97c1a7d..a77bcb30e725 100644 --- a/specification/resources/Authorization.Management/main.tsp +++ b/specification/resources/Authorization.Management/main.tsp @@ -34,7 +34,7 @@ using TypeSpec.Versioning; @armProviderNamespace @service(#{ title: "PolicyClient" }) @versioned(Versions) -@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v6) +@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) namespace Microsoft.Authorization; /** diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 1ef8e84b24c8..d3356424aa07 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -65,7 +65,7 @@ "description": "This operation retrieves a single policy assignment, given its name and the scope it was created at.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "scope", @@ -101,7 +101,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -131,7 +131,7 @@ "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.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "scope", @@ -169,7 +169,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -208,7 +208,7 @@ "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.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "scope", @@ -246,7 +246,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -273,7 +273,7 @@ "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}'.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "scope", @@ -305,7 +305,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -323,7 +323,7 @@ "description": "This operation lists all the built-in policy definition versions for all built-in policy definitions.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -336,7 +336,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -354,7 +354,7 @@ "description": "This operation lists all the built-in policy set definition versions for all built-in policy set definitions.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -367,7 +367,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -385,7 +385,7 @@ "description": "This operation acquires a policy token in the given management group for the given request body.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -414,7 +414,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -432,7 +432,7 @@ "description": "This operation lists all the policy definition versions for all policy definitions at the management group scope.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -454,7 +454,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -472,7 +472,7 @@ "description": "This operation lists all the policy set definition versions for all policy set definitions at the management group scope.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupName", @@ -494,7 +494,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -514,7 +514,7 @@ "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}.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "$filter", @@ -544,7 +544,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -567,7 +567,7 @@ "description": "This operation retrieves the built-in policy definition with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "policyDefinitionName", @@ -588,7 +588,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -608,7 +608,7 @@ "description": "This operation retrieves a list of all the built-in policy definition versions for the given policy definition.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "policyDefinitionName", @@ -639,7 +639,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -662,7 +662,7 @@ "description": "This operation retrieves the built-in policy definition version with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "policyDefinitionName", @@ -691,7 +691,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -711,7 +711,7 @@ "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}.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "$filter", @@ -748,7 +748,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -771,7 +771,7 @@ "description": "This operation retrieves the built-in policy set definition with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "policySetDefinitionName", @@ -799,7 +799,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -819,7 +819,7 @@ "description": "This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy set definition.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "policySetDefinitionName", @@ -857,7 +857,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -880,7 +880,7 @@ "description": "This operation retrieves the built-in policy set definition version with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "policySetDefinitionName", @@ -916,7 +916,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -936,7 +936,7 @@ "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}.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -973,7 +973,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -996,7 +996,7 @@ "description": "This operation retrieves the policy definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1024,7 +1024,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1042,7 +1042,7 @@ "description": "This operation creates or updates a policy definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1079,7 +1079,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1097,7 +1097,7 @@ "description": "This operation deletes the policy definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1125,7 +1125,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1145,10 +1145,10 @@ "description": "This operation retrieves a list of all the policy definition versions for the given policy definition in the given management group.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policyDefinitionName", @@ -1179,7 +1179,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1202,10 +1202,10 @@ "description": "This operation retrieves the policy definition version in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policyDefinitionName", @@ -1234,7 +1234,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1252,10 +1252,10 @@ "description": "This operation creates or updates a policy definition version in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policyDefinitionName", @@ -1299,7 +1299,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1317,10 +1317,10 @@ "description": "This operation deletes the policy definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policyDefinitionName", @@ -1349,7 +1349,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1369,7 +1369,7 @@ "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}.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1413,7 +1413,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1436,7 +1436,7 @@ "description": "This operation retrieves the policy set definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1471,7 +1471,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1489,7 +1489,7 @@ "description": "This operation creates or updates a policy set definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1532,7 +1532,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1553,7 +1553,7 @@ "description": "This operation deletes the policy set definition in the given management group with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "name": "managementGroupId", @@ -1581,7 +1581,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1601,10 +1601,10 @@ "description": "This operation retrieves a list of all the policy set definition versions for the given policy set definition in a given management group.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policySetDefinitionName", @@ -1642,7 +1642,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1665,10 +1665,10 @@ "description": "This operation retrieves the policy set definition version in the given management group with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policySetDefinitionName", @@ -1704,7 +1704,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1722,10 +1722,10 @@ "description": "This operation creates or updates a policy set definition version in the given management group with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policySetDefinitionName", @@ -1769,7 +1769,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1787,10 +1787,10 @@ "description": "This operation deletes the policy set definition version in the given management group with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ManagementGroupNameParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "name": "policySetDefinitionName", @@ -1819,7 +1819,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1837,10 +1837,10 @@ "description": "This operation acquires a policy token in the given subscription for the given request body.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "body", @@ -1862,7 +1862,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1880,10 +1880,10 @@ "description": "This operation lists all the policy definition versions for all policy definitions within a subscription.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -1896,7 +1896,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1914,10 +1914,10 @@ "description": "This operation lists all the policy set definition versions for all policy set definitions within a subscription.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -1930,7 +1930,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -1950,10 +1950,10 @@ "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}.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "$filter", @@ -1983,7 +1983,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2006,10 +2006,10 @@ "description": "This operation retrieves the policy definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2030,7 +2030,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2048,10 +2048,10 @@ "description": "This operation creates or updates a policy definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2081,7 +2081,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2105,10 +2105,10 @@ "description": "This operation deletes the policy definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2129,7 +2129,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2149,10 +2149,10 @@ "description": "This operation retrieves a list of all the policy definition versions for the given policy definition.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2183,7 +2183,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2206,10 +2206,10 @@ "description": "This operation retrieves the policy definition version in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2238,7 +2238,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2256,10 +2256,10 @@ "description": "This operation creates or updates a policy definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2303,7 +2303,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2321,10 +2321,10 @@ "description": "This operation deletes the policy definition version in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policyDefinitionName", @@ -2353,7 +2353,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2373,10 +2373,10 @@ "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}.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "$filter", @@ -2413,7 +2413,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2436,10 +2436,10 @@ "description": "This operation retrieves the policy set definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2467,7 +2467,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2485,10 +2485,10 @@ "description": "This operation creates or updates a policy set definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2524,7 +2524,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2545,10 +2545,10 @@ "description": "This operation deletes the policy set definition in the given subscription with the given name.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2569,7 +2569,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2589,10 +2589,10 @@ "description": "This operation retrieves a list of all the policy set definition versions for the given policy set definition.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2630,7 +2630,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2653,10 +2653,10 @@ "description": "This operation retrieves the policy set definition version in the given subscription with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2692,7 +2692,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2710,10 +2710,10 @@ "description": "This operation creates or updates a policy set definition version in the given subscription with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2757,7 +2757,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2775,10 +2775,10 @@ "description": "This operation deletes the policy set definition version in the given subscription with the given name and version.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "policySetDefinitionName", @@ -2807,7 +2807,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -2827,13 +2827,13 @@ "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.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "$filter", @@ -2870,7 +2870,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -3236,7 +3236,7 @@ }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" } ] }, @@ -3435,7 +3435,7 @@ }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" } ] }, @@ -3597,7 +3597,7 @@ }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" } ] }, @@ -3774,7 +3774,7 @@ }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" } ] }, @@ -3873,7 +3873,7 @@ }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" } ] }, From 0a77e2437eca9fdea88169bb8073de5feeb23d8f Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 14:01:56 +0800 Subject: [PATCH 19/45] temp solution for /providers/microsoft.Management/managementGroups/{managementGroupName}/providers/microsoft.Authorization --- .../Authorization.Management/routes.tsp | 72 +++--- .../stable/2025-03-01/openapi.json | 238 ++++++++---------- 2 files changed, 145 insertions(+), 165 deletions(-) diff --git a/specification/resources/Authorization.Management/routes.tsp b/specification/resources/Authorization.Management/routes.tsp index 63bcd6750a2b..e6a36c453671 100644 --- a/specification/resources/Authorization.Management/routes.tsp +++ b/specification/resources/Authorization.Management/routes.tsp @@ -13,6 +13,18 @@ using TypeSpec.OpenAPI; namespace Microsoft.Authorization; +alias ManagementGroupParameters = { + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Management"; + + ...CommonTypes.ManagementGroupNameParameter; + ...ProviderNamespace; + ...ApiVersionParameter; +}; + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" interface PolicyDefinitionVersionsOperationGroup { /** @@ -23,26 +35,20 @@ interface PolicyDefinitionVersionsOperationGroup { @autoRoute @action("listPolicyDefinitionVersions") listAllBuiltins is ArmProviderActionSync>; + /** * This operation lists all the policy definition versions for all policy definitions at the management group scope. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all policy definition versions at management group scope.") @autoRoute + @post @action("listPolicyDefinitionVersions") - listAllAtManagementGroup is ArmProviderActionSync< - Response = ResourceListResult, - Parameters = { - /** - * The name of the management group. The name is case insensitive. - */ - @maxLength(90) - @minLength(1) - @path - @segment("managementGroups") - managementGroupName: string; - } - >; + @armResourceCollectionAction + listAllAtManagementGroup( + ...ManagementGroupParameters, + ): ResourceListResult | ErrorResponse; + /** * This operation lists all the policy definition versions for all policy definitions within a subscription. */ @@ -72,20 +78,13 @@ interface PolicySetDefinitionVersionsOperationGroup { #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all policy set definition versions at management group scope.") @autoRoute + @post @action("listPolicySetDefinitionVersions") - listAllAtManagementGroup is ArmProviderActionSync< - Response = ResourceListResult, - Parameters = { - /** - * The name of the management group. The name is case insensitive. - */ - @maxLength(90) - @minLength(1) - @path - @segment("managementGroups") - managementGroupName: string; - } - >; + @armResourceCollectionAction + listAllAtManagementGroup( + ...ManagementGroupParameters, + ): ResourceListResult | ErrorResponse; + /** * This operation lists all the policy set definition versions for all policy set definitions within a subscription. */ @@ -113,23 +112,20 @@ interface PolicyTokensOperationGroup { Response = PolicyTokenResponse, Scope = SubscriptionActionScope >; + /** * This operation acquires a policy token in the given management group for the given request body. */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Acquires a policy token at management group level.") @autoRoute + @post @action("acquirePolicyToken") - acquireAtManagementGroup is ArmProviderActionSync< - Request = PolicyTokenRequest, - Response = PolicyTokenResponse, - Parameters = { - /** - * The name of the management group. - */ - @path - @segment("managementGroups") - managementGroupName: string; - } - >; + @armResourceCollectionAction + acquireAtManagementGroup( + ...ManagementGroupParameters, + + /** The policy token properties. */ + @body parameters: PolicyTokenRequest, + ): PolicyTokenResponse | ErrorResponse; } diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index d3356424aa07..28b47d1e884b 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -378,133 +378,6 @@ } } }, - "/providers/Microsoft.Authorization/managementGroups/{managementGroupName}/acquirePolicyToken": { - "post": { - "operationId": "PolicyTokens_AcquireAtManagementGroup", - "summary": "Acquires a policy token at management group level.", - "description": "This operation acquires a policy token in the given management group for the given request body.", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "name": "managementGroupName", - "in": "path", - "description": "The name of the management group.", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "description": "The request body", - "required": true, - "schema": { - "$ref": "#/definitions/PolicyTokenRequest" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/PolicyTokenResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Acquire a policy token at management group level": { - "$ref": "./examples/acquirePolicyTokenAtManagementGroup.json" - } - } - } - }, - "/providers/Microsoft.Authorization/managementGroups/{managementGroupName}/listPolicyDefinitionVersions": { - "post": { - "operationId": "PolicyDefinitionVersions_ListAllAtManagementGroup", - "summary": "Lists all policy definition versions at management group scope.", - "description": "This operation lists all the policy definition versions for all policy definitions at the management group scope.", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "name": "managementGroupName", - "in": "path", - "description": "The name of the management group. The name is case insensitive.", - "required": true, - "type": "string", - "minLength": 1, - "maxLength": 90 - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/PolicyDefinitionVersionListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "List all policy definition versions at management group": { - "$ref": "./examples/listAllPolicyDefinitionVersionsByManagementGroup.json" - } - } - } - }, - "/providers/Microsoft.Authorization/managementGroups/{managementGroupName}/listPolicySetDefinitionVersions": { - "post": { - "operationId": "PolicySetDefinitionVersions_ListAllAtManagementGroup", - "summary": "Lists all policy set definition versions at management group scope.", - "description": "This operation lists all the policy set definition versions for all policy set definitions at the management group scope.", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" - }, - { - "name": "managementGroupName", - "in": "path", - "description": "The name of the management group. The name is case insensitive.", - "required": true, - "type": "string", - "minLength": 1, - "maxLength": 90 - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/PolicySetDefinitionVersionListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "List all policy definition versions at management group": { - "$ref": "./examples/listAllPolicySetDefinitionVersionsByManagementGroup.json" - } - } - } - }, "/providers/Microsoft.Authorization/policyDefinitions": { "get": { "operationId": "PolicyDefinitions_ListBuiltIn", @@ -927,6 +800,117 @@ } } }, + "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/acquirePolicyToken": { + "post": { + "operationId": "PolicyTokens_AcquireAtManagementGroup", + "summary": "Acquires a policy token at management group level.", + "description": "This operation acquires a policy token in the given management group for the given request body.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "description": "The policy token properties.", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyTokenRequest" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicyTokenResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Acquire a policy token at management group level": { + "$ref": "./examples/acquirePolicyTokenAtManagementGroup.json" + } + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicyDefinitionVersions": { + "post": { + "operationId": "PolicyDefinitionVersions_ListAllAtManagementGroup", + "summary": "Lists all policy definition versions at management group scope.", + "description": "This operation lists all the policy definition versions for all policy definitions at the management group scope.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicyDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List all policy definition versions at management group": { + "$ref": "./examples/listAllPolicyDefinitionVersionsByManagementGroup.json" + } + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions": { + "post": { + "operationId": "PolicySetDefinitionVersions_ListAllAtManagementGroup", + "summary": "Lists all policy set definition versions at management group scope.", + "description": "This operation lists all the policy set definition versions for all policy set definitions at the management group scope.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionVersionListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List all policy definition versions at management group": { + "$ref": "./examples/listAllPolicySetDefinitionVersionsByManagementGroup.json" + } + } + } + }, "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions": { "get": { "operationId": "PolicyDefinitions_ListByManagementGroup", From eeb6530f3ecc36e33c2e0641985cedb9fd8576a4 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 14:19:54 +0800 Subject: [PATCH 20/45] fix PolicyAssignments_ListForManagementGroup --- .../PolicyAssignment.tsp | 60 ++++++++++------ .../Authorization.Management/routes.tsp | 25 +++++-- .../stable/2025-03-01/openapi.json | 71 ++++++++++++++++++- 3 files changed, 129 insertions(+), 27 deletions(-) diff --git a/specification/resources/Authorization.Management/PolicyAssignment.tsp b/specification/resources/Authorization.Management/PolicyAssignment.tsp index 09996448f277..1c8c73fb3b5e 100644 --- a/specification/resources/Authorization.Management/PolicyAssignment.tsp +++ b/specification/resources/Authorization.Management/PolicyAssignment.tsp @@ -35,6 +35,28 @@ model PolicyAssignment identity?: Identity; } +alias PolicyAssignmentListParameters = { + /** + * 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}. + */ + @query("$filter") + $filter?: string; + + /** + * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + */ + @query("$expand") + $expand?: string; + + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + */ + @maxValue(1000) + @minValue(1) + @query("$top") + $top?: int32; +}; + @armResourceOperations interface PolicyAssignments { /** @@ -87,28 +109,24 @@ interface PolicyAssignments { listForResourceGroup is Extension.ListByTarget< Extension.ResourceGroup, PolicyAssignment, - Parameters = { - /** - * 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}. - */ - @query("$filter") - $filter?: string; - - /** - * Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - */ - @query("$expand") - $expand?: string; - - /** - * Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - */ - @maxValue(1000) - @minValue(1) - @query("$top") - $top?: int32; - } + Parameters = PolicyAssignmentListParameters >; + + /** + * 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. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @summary("Retrieves all policy assignments that apply to a management group.") + @autoRoute + @list + @listsResource(PolicyAssignment) + @segmentOf(PolicyAssignment) + @armResourceList(PolicyAssignment) + @get + listForManagementGroup( + ...ManagementGroupIdParameters, + ...PolicyAssignmentListParameters, + ): ResourceListResult | ErrorResponse; } @@doc(PolicyAssignment.name, "The name of the policy assignment to get."); diff --git a/specification/resources/Authorization.Management/routes.tsp b/specification/resources/Authorization.Management/routes.tsp index e6a36c453671..0a639fbbcda0 100644 --- a/specification/resources/Authorization.Management/routes.tsp +++ b/specification/resources/Authorization.Management/routes.tsp @@ -13,7 +13,7 @@ using TypeSpec.OpenAPI; namespace Microsoft.Authorization; -alias ManagementGroupParameters = { +alias ManagementGroupNameParameters = { /** the provider namespace */ @path @segment("providers") @@ -25,6 +25,23 @@ alias ManagementGroupParameters = { ...ApiVersionParameter; }; +alias ManagementGroupIdParameters = { + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Management"; + + /** The ID of the management group. */ + @path + @segment("managementGroups") + @key + managementGroupId: string; + + ...ProviderNamespace; + ...ApiVersionParameter; +}; + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" interface PolicyDefinitionVersionsOperationGroup { /** @@ -46,7 +63,7 @@ interface PolicyDefinitionVersionsOperationGroup { @action("listPolicyDefinitionVersions") @armResourceCollectionAction listAllAtManagementGroup( - ...ManagementGroupParameters, + ...ManagementGroupNameParameters, ): ResourceListResult | ErrorResponse; /** @@ -82,7 +99,7 @@ interface PolicySetDefinitionVersionsOperationGroup { @action("listPolicySetDefinitionVersions") @armResourceCollectionAction listAllAtManagementGroup( - ...ManagementGroupParameters, + ...ManagementGroupIdParameters, ): ResourceListResult | ErrorResponse; /** @@ -123,7 +140,7 @@ interface PolicyTokensOperationGroup { @action("acquirePolicyToken") @armResourceCollectionAction acquireAtManagementGroup( - ...ManagementGroupParameters, + ...ManagementGroupNameParameters, /** The policy token properties. */ @body parameters: PolicyTokenRequest, diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 28b47d1e884b..8d48af63bccd 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -877,14 +877,18 @@ } } }, - "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions": { + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions": { "post": { "operationId": "PolicySetDefinitionVersions_ListAllAtManagementGroup", "summary": "Lists all policy set definition versions at management group scope.", "description": "This operation lists all the policy set definition versions for all policy set definitions at the management group scope.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" + "name": "managementGroupId", + "in": "path", + "description": "The ID of the management group.", + "required": true, + "type": "string" }, { "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" @@ -911,6 +915,69 @@ } } }, + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments": { + "get": { + "operationId": "PolicyAssignments_ListForManagementGroup", + "tags": [ + "PolicyAssignments" + ], + "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.", + "parameters": [ + { + "name": "managementGroupId", + "in": "path", + "description": "The ID of the management group.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "$filter", + "in": "query", + "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}.", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicyAssignmentListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions": { "get": { "operationId": "PolicyDefinitions_ListByManagementGroup", From 9803a452d155e717c838483dd9801cb7a1710912 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 14:21:59 +0800 Subject: [PATCH 21/45] remove suppress --- .../Authorization.Management/PolicyAssignment.tsp | 1 - .../Authorization.Management/PolicyDefinition.tsp | 6 ------ .../Authorization.Management/PolicyDefinitionVersion.tsp | 6 ------ .../Authorization.Management/PolicySetDefinition.tsp | 6 ------ .../PolicySetDefinitionVersion.tsp | 6 ------ .../resources/Authorization.Management/routes.tsp | 8 -------- 6 files changed, 33 deletions(-) diff --git a/specification/resources/Authorization.Management/PolicyAssignment.tsp b/specification/resources/Authorization.Management/PolicyAssignment.tsp index 1c8c73fb3b5e..171df1ebb8ae 100644 --- a/specification/resources/Authorization.Management/PolicyAssignment.tsp +++ b/specification/resources/Authorization.Management/PolicyAssignment.tsp @@ -115,7 +115,6 @@ interface PolicyAssignments { /** * 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. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Retrieves all policy assignments that apply to a management group.") @autoRoute @list diff --git a/specification/resources/Authorization.Management/PolicyDefinition.tsp b/specification/resources/Authorization.Management/PolicyDefinition.tsp index ca8b156dac47..3282c263e828 100644 --- a/specification/resources/Authorization.Management/PolicyDefinition.tsp +++ b/specification/resources/Authorization.Management/PolicyDefinition.tsp @@ -144,13 +144,11 @@ interface PolicyDefinitions { /** * This operation retrieves the built-in policy definition with the given name. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" getBuiltIn is PolicyDefinitionTenantOps.Read; /** * 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}. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" listBuiltIn is PolicyDefinitionTenantOps.List< PolicyDefinition, Parameters = { @@ -173,13 +171,11 @@ interface PolicyDefinitions { /** * This operation retrieves the policy definition in the given management group with the given name. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" getAtManagementGroup is PolicyDefinitionManagementGroupOps.Read; /** * This operation creates or updates a policy definition in the given management group with the given name. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility" createOrUpdateAtManagementGroup is PolicyDefinitionManagementGroupOps.CreateOrUpdateSync< PolicyDefinition, @@ -189,13 +185,11 @@ interface PolicyDefinitions { /** * This operation deletes the policy definition in the given management group with the given name. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" deleteAtManagementGroup is PolicyDefinitionManagementGroupOps.DeleteSync; /** * 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}. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" listByManagementGroup is PolicyDefinitionManagementGroupOps.List< PolicyDefinition, Parameters = { diff --git a/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp b/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp index d08b05bf9a9c..90a1df14af15 100644 --- a/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp +++ b/specification/resources/Authorization.Management/PolicyDefinitionVersion.tsp @@ -160,13 +160,11 @@ interface PolicyDefinitionVersions { /** * This operation retrieves the built-in policy definition version with the given name. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" getBuiltIn is PolicyDefinitionVersionTenantOps.Read; /** * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" listBuiltIn is PolicyDefinitionVersionTenantOps.List< PolicyDefinitionVersion, Parameters = { @@ -183,25 +181,21 @@ interface PolicyDefinitionVersions { /** * This operation retrieves the policy definition version in the given management group with the given name. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" getAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.Read; /** * This operation creates or updates a policy definition version in the given management group with the given name. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" createOrUpdateAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.CreateOrUpdateSync; /** * This operation deletes the policy definition in the given management group with the given name. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" deleteAtManagementGroup is PolicyDefinitionVersionManagementGroupOps.DeleteSync; /** * This operation retrieves a list of all the policy definition versions for the given policy definition in the given management group. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" listByManagementGroup is PolicyDefinitionVersionManagementGroupOps.List< PolicyDefinitionVersion, Parameters = { diff --git a/specification/resources/Authorization.Management/PolicySetDefinition.tsp b/specification/resources/Authorization.Management/PolicySetDefinition.tsp index 9b582fe48634..d5dad6be1f49 100644 --- a/specification/resources/Authorization.Management/PolicySetDefinition.tsp +++ b/specification/resources/Authorization.Management/PolicySetDefinition.tsp @@ -155,7 +155,6 @@ interface PolicySetDefinitions { /** * This operation retrieves the built-in policy set definition with the given name. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" getBuiltIn is PolicySetDefinitionTenantOps.Read< PolicySetDefinition, Parameters = { @@ -170,7 +169,6 @@ interface PolicySetDefinitions { /** * 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}. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" listBuiltIn is PolicySetDefinitionTenantOps.List< PolicySetDefinition, Parameters = { @@ -199,7 +197,6 @@ interface PolicySetDefinitions { /** * This operation retrieves the policy set definition in the given management group with the given name. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" getAtManagementGroup is PolicySetDefinitionManagementGroupOps.Read< PolicySetDefinition, Parameters = { @@ -214,19 +211,16 @@ interface PolicySetDefinitions { /** * This operation creates or updates a policy set definition in the given management group with the given name. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" createOrUpdateAtManagementGroup is PolicySetDefinitionManagementGroupOps.CreateOrUpdateSync; /** * This operation deletes the policy set definition in the given management group with the given name. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" deleteAtManagementGroup is PolicySetDefinitionManagementGroupOps.DeleteSync; /** * 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}. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" listByManagementGroup is PolicySetDefinitionManagementGroupOps.List< PolicySetDefinition, Parameters = { diff --git a/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp b/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp index f575a3365af3..d0592ebdd356 100644 --- a/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp +++ b/specification/resources/Authorization.Management/PolicySetDefinitionVersion.tsp @@ -175,7 +175,6 @@ interface PolicySetDefinitionVersions { /** * This operation retrieves the built-in policy set definition version with the given name and version. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" getBuiltIn is PolicySetDefinitionVersionTenantOps.Read< PolicySetDefinitionVersion, Parameters = { @@ -190,7 +189,6 @@ interface PolicySetDefinitionVersions { /** * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy set definition. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" listBuiltIn is PolicySetDefinitionVersionTenantOps.List< PolicySetDefinitionVersion, Parameters = { @@ -213,7 +211,6 @@ interface PolicySetDefinitionVersions { /** * This operation retrieves the policy set definition version in the given management group with the given name and version. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" getAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.Read< PolicySetDefinitionVersion, Parameters = { @@ -228,19 +225,16 @@ interface PolicySetDefinitionVersions { /** * This operation creates or updates a policy set definition version in the given management group with the given name and version. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" createOrUpdateAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.CreateOrUpdateSync; /** * This operation deletes the policy set definition version in the given management group with the given name and version. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" deleteAtManagementGroup is PolicySetDefinitionVersionManagementGroupOps.DeleteSync; /** * This operation retrieves a list of all the policy set definition versions for the given policy set definition in a given management group. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" listByManagementGroup is PolicySetDefinitionVersionManagementGroupOps.List< PolicySetDefinitionVersion, Parameters = { diff --git a/specification/resources/Authorization.Management/routes.tsp b/specification/resources/Authorization.Management/routes.tsp index 0a639fbbcda0..29ce37ef1cf1 100644 --- a/specification/resources/Authorization.Management/routes.tsp +++ b/specification/resources/Authorization.Management/routes.tsp @@ -47,7 +47,6 @@ interface PolicyDefinitionVersionsOperationGroup { /** * This operation lists all the built-in policy definition versions for all built-in policy definitions. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all built-in policy definition versions.") @autoRoute @action("listPolicyDefinitionVersions") @@ -56,7 +55,6 @@ interface PolicyDefinitionVersionsOperationGroup { /** * This operation lists all the policy definition versions for all policy definitions at the management group scope. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all policy definition versions at management group scope.") @autoRoute @post @@ -69,7 +67,6 @@ interface PolicyDefinitionVersionsOperationGroup { /** * This operation lists all the policy definition versions for all policy definitions within a subscription. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all policy definition versions within a subscription.") @autoRoute @action("listPolicyDefinitionVersions") @@ -84,7 +81,6 @@ interface PolicySetDefinitionVersionsOperationGroup { /** * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all built-in policy set definition versions.") @autoRoute @action("listPolicySetDefinitionVersions") @@ -92,7 +88,6 @@ interface PolicySetDefinitionVersionsOperationGroup { /** * This operation lists all the policy set definition versions for all policy set definitions at the management group scope. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all policy set definition versions at management group scope.") @autoRoute @post @@ -105,7 +100,6 @@ interface PolicySetDefinitionVersionsOperationGroup { /** * This operation lists all the policy set definition versions for all policy set definitions within a subscription. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Lists all policy set definition versions within a subscription.") @autoRoute @action("listPolicySetDefinitionVersions") @@ -120,7 +114,6 @@ interface PolicyTokensOperationGroup { /** * This operation acquires a policy token in the given subscription for the given request body. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Acquires a policy token.") @autoRoute @action("acquirePolicyToken") @@ -133,7 +126,6 @@ interface PolicyTokensOperationGroup { /** * This operation acquires a policy token in the given management group for the given request body. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" @summary("Acquires a policy token at management group level.") @autoRoute @post From 75c40887e26b56a620871a02aa0201974f069053 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 14:24:05 +0800 Subject: [PATCH 22/45] fix PolicyAssignments_List --- .../PolicyAssignment.tsp | 10 ++++ .../stable/2025-03-01/openapi.json | 59 +++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/specification/resources/Authorization.Management/PolicyAssignment.tsp b/specification/resources/Authorization.Management/PolicyAssignment.tsp index 171df1ebb8ae..797017c24256 100644 --- a/specification/resources/Authorization.Management/PolicyAssignment.tsp +++ b/specification/resources/Authorization.Management/PolicyAssignment.tsp @@ -126,6 +126,16 @@ interface PolicyAssignments { ...ManagementGroupIdParameters, ...PolicyAssignmentListParameters, ): ResourceListResult | ErrorResponse; + + /** + * 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}. + */ + @summary("Retrieves all policy assignments that apply to a subscription.") + list is Extension.ListByTarget< + Extension.Subscription, + PolicyAssignment, + Parameters = PolicyAssignmentListParameters + >; } @@doc(PolicyAssignment.name, "The name of the policy assignment to get."); diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 8d48af63bccd..1c31fded32f2 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -1992,6 +1992,65 @@ } } }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments": { + "get": { + "operationId": "PolicyAssignments_List", + "tags": [ + "PolicyAssignments" + ], + "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}.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "$filter", + "in": "query", + "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}.", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/PolicyAssignmentListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions": { "get": { "operationId": "PolicyDefinitions_List", From 52c87fa9d4883d834f288e8ddaa77439137fe92c Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 14:32:26 +0800 Subject: [PATCH 23/45] fix PolicyAssignments_ListForResource --- .../PolicyAssignment.tsp | 45 +++++++++ .../stable/2025-03-01/openapi.json | 93 +++++++++++++++++++ 2 files changed, 138 insertions(+) diff --git a/specification/resources/Authorization.Management/PolicyAssignment.tsp b/specification/resources/Authorization.Management/PolicyAssignment.tsp index 797017c24256..b6a549a898ec 100644 --- a/specification/resources/Authorization.Management/PolicyAssignment.tsp +++ b/specification/resources/Authorization.Management/PolicyAssignment.tsp @@ -136,6 +136,51 @@ interface PolicyAssignments { PolicyAssignment, Parameters = PolicyAssignmentListParameters >; + + /** + * 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'). + */ + @summary("Retrieves all policy assignments that apply to a resource.") + @autoRoute + @list + @listsResource(PolicyAssignment) + @segmentOf(PolicyAssignment) + @armResourceList(PolicyAssignment) + @get + listForResource( + ...SubscriptionIdParameter, + ...ResourceGroupParameter, + + /** + * The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + */ + @path + @segment("providers") + resourceProviderNamespace: string, + + /** + * The parent resource path. Use empty string if there is none. + */ + @path(#{ allowReserved: true }) + parentResourcePath: string, + + /** + * The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). + */ + @path(#{ allowReserved: true }) + resourceType: string, + + /** + * The name of the resource. + */ + @path + @pattern("^.+$") + resourceName: string, + + ...ProviderNamespace, + ...ApiVersionParameter, + ...PolicyAssignmentListParameters, + ): ResourceListResult | ErrorResponse; } @@doc(PolicyAssignment.name, "The name of the policy assignment to get."); diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 1c31fded32f2..82f95461ec61 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -2928,6 +2928,99 @@ } } }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments": { + "get": { + "operationId": "PolicyAssignments_ListForResource", + "tags": [ + "PolicyAssignments" + ], + "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').", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceProviderNamespace", + "in": "path", + "description": "The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines)", + "required": true, + "type": "string" + }, + { + "name": "parentResourcePath", + "in": "path", + "description": "The parent resource path. Use empty string if there is none.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true + }, + { + "name": "resourceType", + "in": "path", + "description": "The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites).", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the resource.", + "required": true, + "type": "string", + "pattern": "^.+$" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "$filter", + "in": "query", + "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}.", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "in": "query", + "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", + "required": false, + "type": "string" + }, + { + "name": "$top", + "in": "query", + "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PolicyAssignmentListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments": { "get": { "operationId": "PolicyAssignments_ListForResourceGroup", From 2d9d161efd25fae9f9d18600b62d2f577046a26a Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 14:37:25 +0800 Subject: [PATCH 24/45] add examples --- .../2025-03-01/listPolicyAssignments.json | 65 +++++++++++++++++++ ...stPolicyAssignmentsForManagementGroup.json | 65 +++++++++++++++++++ .../listPolicyAssignmentsForResource.json | 64 ++++++++++++++++++ .../examples/listPolicyAssignments.json | 2 + ...stPolicyAssignmentsForManagementGroup.json | 2 + .../listPolicyAssignmentsForResource.json | 2 + .../stable/2025-03-01/openapi.json | 15 +++++ 7 files changed, 215 insertions(+) create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignments.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForManagementGroup.json create mode 100644 specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForResource.json diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignments.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignments.json new file mode 100644 index 000000000000..f2d9c3c189ac --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignments.json @@ -0,0 +1,65 @@ +{ + "operationId": "PolicyAssignments_List", + "title": "List policy assignments that apply to a subscription", + "parameters": { + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-01", + "$filter": "atScope()", + "$expand": "LatestDefinitionVersion, EffectiveDefinitionVersion" + }, + "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", + "definitionVersion": "1.*.*", + "latestDefinitionVersion": "1.0.0", + "effectiveDefinitionVersion": "1.0.0", + "parameters": { + "allowedSkus": { + "value": "Standard_A1" + } + }, + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "notScopes": [], + "instanceId": "a3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e" + } + }, + { + "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", + "definitionVersion": "1.*.*", + "latestDefinitionVersion": "1.0.0", + "effectiveDefinitionVersion": "1.0.0", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "notScopes": [], + "instanceId": "b6d7e8f9-a0b1-2c3d-4e5f-6a7b8c9d0e1f" + } + } + ] + } + } + } +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForManagementGroup.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForManagementGroup.json new file mode 100644 index 000000000000..024b8b286e49 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForManagementGroup.json @@ -0,0 +1,65 @@ +{ + "operationId": "PolicyAssignments_ListForManagementGroup", + "title": "List policy assignments that apply to a management group", + "parameters": { + "managementGroupId": "TestManagementGroup", + "api-version": "2025-03-01", + "$filter": "atScope()", + "$expand": "LatestDefinitionVersion, EffectiveDefinitionVersion" + }, + "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", + "definitionVersion": "1.*.*", + "latestDefinitionVersion": "1.0.0", + "effectiveDefinitionVersion": "1.0.0", + "parameters": { + "allowedSkus": { + "value": "Standard_A1" + } + }, + "scope": "/providers/Microsoft.Management/managementGroups/TestManagementGroup", + "notScopes": [], + "instanceId": "c7e8f9a0-b1c2-3d4e-5f6a-7b8c9d0e1f2a" + } + }, + { + "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", + "definitionVersion": "1.*.*", + "latestDefinitionVersion": "1.0.0", + "effectiveDefinitionVersion": "1.0.0", + "scope": "/providers/Microsoft.Management/managementGroups/TestManagementGroup", + "notScopes": [], + "instanceId": "d8f9a0b1-c2d3-4e5f-6a7b-8c9d0e1f2a3b" + } + } + ] + } + } + } +} diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForResource.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForResource.json new file mode 100644 index 000000000000..226a1b016837 --- /dev/null +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyAssignmentsForResource.json @@ -0,0 +1,64 @@ +{ + "operationId": "PolicyAssignments_ListForResource", + "title": "List policy assignments that apply to a resource group", + "parameters": { + "resourceGroupName": "TestResourceGroup", + "resourceProviderNamespace": "Microsoft.Compute", + "parentResourcePath": "virtualMachines/MyTestVm", + "resourceType": "domainNames", + "resourceName": "MyTestComputer.cloudapp.net", + "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", + "api-version": "2025-03-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", + "definitionVersion": "1.*.*", + "parameters": { + "allowedSkus": { + "value": "Standard_A1" + } + }, + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup", + "notScopes": [], + "instanceId": "e9a0b1c2-d3e4-5f6a-7b8c-9d0e1f2a3b4c" + } + }, + { + "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", + "definitionVersion": "1.*.*", + "scope": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/TestResourceGroup", + "notScopes": [], + "instanceId": "f0b1c2d3-e4f5-6a7b-8c9d-0e1f2a3b4c5d" + } + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignments.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignments.json index 92062c71726d..f2d9c3c189ac 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignments.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignments.json @@ -1,4 +1,6 @@ { + "operationId": "PolicyAssignments_List", + "title": "List policy assignments that apply to a subscription", "parameters": { "subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "api-version": "2025-03-01", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignmentsForManagementGroup.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignmentsForManagementGroup.json index 0806c968fed0..024b8b286e49 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignmentsForManagementGroup.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignmentsForManagementGroup.json @@ -1,4 +1,6 @@ { + "operationId": "PolicyAssignments_ListForManagementGroup", + "title": "List policy assignments that apply to a management group", "parameters": { "managementGroupId": "TestManagementGroup", "api-version": "2025-03-01", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignmentsForResource.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignmentsForResource.json index 85d210c3d825..226a1b016837 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignmentsForResource.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyAssignmentsForResource.json @@ -1,4 +1,6 @@ { + "operationId": "PolicyAssignments_ListForResource", + "title": "List policy assignments that apply to a resource group", "parameters": { "resourceGroupName": "TestResourceGroup", "resourceProviderNamespace": "Microsoft.Compute", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 82f95461ec61..dc6813f15c91 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -973,6 +973,11 @@ } } }, + "x-ms-examples": { + "List policy assignments that apply to a management group": { + "$ref": "./examples/listPolicyAssignmentsForManagementGroup.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -2046,6 +2051,11 @@ } } }, + "x-ms-examples": { + "List policy assignments that apply to a subscription": { + "$ref": "./examples/listPolicyAssignments.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -3016,6 +3026,11 @@ } } }, + "x-ms-examples": { + "List policy assignments that apply to a resource group": { + "$ref": "./examples/listPolicyAssignmentsForResource.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } From 662271fc96adb657c13adc904728d18747a03e71 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 14:43:03 +0800 Subject: [PATCH 25/45] fix go tspconfig --- .../resources/Authorization.Management/tspconfig.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/resources/Authorization.Management/tspconfig.yaml b/specification/resources/Authorization.Management/tspconfig.yaml index 7d12b3f9e78c..7ca0e30a6063 100644 --- a/specification/resources/Authorization.Management/tspconfig.yaml +++ b/specification/resources/Authorization.Management/tspconfig.yaml @@ -35,9 +35,9 @@ options: package-details: name: "@azure/arm-resourcespolicy" "@azure-tools/typespec-go": - service-dir: "sdk/resourcemanager/resources/armpolicy" - emitter-output-dir: "{output-dir}/{service-dir}/resources/armpolicy" - module: "github.com/Azure/azure-sdk-for-go/{service-dir}/resources/armpolicy" + service-dir: "sdk/resourcemanager/resources" + emitter-output-dir: "{output-dir}/{service-dir}/armpolicy" + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/armpolicy" fix-const-stuttering: true flavor: "azure" generate-samples: true From 5b81ce184846d53c3a2f7bde323e2db13512a143 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 14:48:20 +0800 Subject: [PATCH 26/45] fix --- .../Authorization.Management/back-compatible.tsp | 1 + .../resources/Authorization.Management/routes.tsp | 2 +- .../stable/2025-03-01/openapi.json | 10 +++------- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/specification/resources/Authorization.Management/back-compatible.tsp b/specification/resources/Authorization.Management/back-compatible.tsp index 505a41496c59..771080ec25a7 100644 --- a/specification/resources/Authorization.Management/back-compatible.tsp +++ b/specification/resources/Authorization.Management/back-compatible.tsp @@ -71,3 +71,4 @@ using Microsoft.Authorization; @@clientLocation(PolicyTokensOperationGroup.acquireAtManagementGroup, "PolicyTokens" ); +@@clientName(PolicyTokensOperationGroup.acquire::parameters.body, "parameters"); diff --git a/specification/resources/Authorization.Management/routes.tsp b/specification/resources/Authorization.Management/routes.tsp index 29ce37ef1cf1..fdc5037826a3 100644 --- a/specification/resources/Authorization.Management/routes.tsp +++ b/specification/resources/Authorization.Management/routes.tsp @@ -94,7 +94,7 @@ interface PolicySetDefinitionVersionsOperationGroup { @action("listPolicySetDefinitionVersions") @armResourceCollectionAction listAllAtManagementGroup( - ...ManagementGroupIdParameters, + ...ManagementGroupNameParameters, ): ResourceListResult | ErrorResponse; /** diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index dc6813f15c91..7e452c2c5f7f 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -877,18 +877,14 @@ } } }, - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions": { + "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions": { "post": { "operationId": "PolicySetDefinitionVersions_ListAllAtManagementGroup", "summary": "Lists all policy set definition versions at management group scope.", "description": "This operation lists all the policy set definition versions for all policy set definitions at the management group scope.", "parameters": [ { - "name": "managementGroupId", - "in": "path", - "description": "The ID of the management group.", - "required": true, - "type": "string" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" @@ -1899,7 +1895,7 @@ "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { - "name": "body", + "name": "parameters", "in": "body", "description": "The request body", "required": true, From f7ebb41d248de252c8af5ff68a9008e774e7565b Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 14:51:43 +0800 Subject: [PATCH 27/45] fix example --- .../examples/2025-03-01/listAllPolicyDefinitionVersions.json | 2 +- .../examples/2025-03-01/listPolicyDefinitionVersions.json | 2 +- .../2025-03-01/examples/listAllPolicyDefinitionVersions.json | 2 +- .../2025-03-01/examples/listPolicyDefinitionVersions.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersions.json index d9bc957c17f8..40c4c8a59de4 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listAllPolicyDefinitionVersions.json @@ -52,7 +52,7 @@ { "name": "1.0.0", "type": "Microsoft.Authorization/policyDefinitions", - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/versions/1.0.0", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.0.0", "properties": { "description": "Force resource names to begin with 'prefix' and end with 'suffix'", "displayName": "Naming Convention", diff --git a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersions.json b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersions.json index 8f89677cb450..e9b75f33f184 100644 --- a/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersions.json +++ b/specification/resources/Authorization.Management/examples/2025-03-01/listPolicyDefinitionVersions.json @@ -53,7 +53,7 @@ { "name": "1.0.0", "type": "Microsoft.Authorization/policyDefinitions", - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/versions/1.0.0", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.0.0", "properties": { "description": "Force resource names to begin with 'prefix' and end with 'suffix'", "displayName": "Naming Convention", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicyDefinitionVersions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicyDefinitionVersions.json index d9bc957c17f8..40c4c8a59de4 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicyDefinitionVersions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listAllPolicyDefinitionVersions.json @@ -52,7 +52,7 @@ { "name": "1.0.0", "type": "Microsoft.Authorization/policyDefinitions", - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/versions/1.0.0", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.0.0", "properties": { "description": "Force resource names to begin with 'prefix' and end with 'suffix'", "displayName": "Naming Convention", diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionVersions.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionVersions.json index 8f89677cb450..e9b75f33f184 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionVersions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/examples/listPolicyDefinitionVersions.json @@ -53,7 +53,7 @@ { "name": "1.0.0", "type": "Microsoft.Authorization/policyDefinitions", - "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/versions/1.0.0", + "id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.0.0", "properties": { "description": "Force resource names to begin with 'prefix' and end with 'suffix'", "displayName": "Naming Convention", From 2d4e1670a733d304e659df219ddf31306040fccd Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 30 Oct 2025 14:57:23 +0800 Subject: [PATCH 28/45] use template for listForManagementGroup --- .../Authorization.Management/PolicyAssignment.tsp | 15 +++++---------- .../stable/2025-03-01/openapi.json | 13 +++++++------ 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/specification/resources/Authorization.Management/PolicyAssignment.tsp b/specification/resources/Authorization.Management/PolicyAssignment.tsp index b6a549a898ec..e818724a538d 100644 --- a/specification/resources/Authorization.Management/PolicyAssignment.tsp +++ b/specification/resources/Authorization.Management/PolicyAssignment.tsp @@ -116,16 +116,11 @@ interface PolicyAssignments { * 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. */ @summary("Retrieves all policy assignments that apply to a management group.") - @autoRoute - @list - @listsResource(PolicyAssignment) - @segmentOf(PolicyAssignment) - @armResourceList(PolicyAssignment) - @get - listForManagementGroup( - ...ManagementGroupIdParameters, - ...PolicyAssignmentListParameters, - ): ResourceListResult | ErrorResponse; + listForManagementGroup is Extension.ListByTarget< + Extension.ManagementGroup<"managementGroupId">, + PolicyAssignment, + Parameters = PolicyAssignmentListParameters + >; /** * 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}. diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 7e452c2c5f7f..1aee8c5248da 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -920,15 +920,16 @@ "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.", "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, { "name": "managementGroupId", "in": "path", - "description": "The ID of the management group.", + "description": "The management group ID.", "required": true, - "type": "string" - }, - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + "type": "string", + "minLength": 1 }, { "name": "$filter", @@ -957,7 +958,7 @@ ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/PolicyAssignmentListResult" } From 7aa87901641cea06aa6f227d085fa7a3acd6a311 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 4 Nov 2025 16:27:06 +0800 Subject: [PATCH 29/45] use ListSinglePage --- .../Authorization.Management/routes.tsp | 71 +++++++++++++++---- .../stable/2025-03-01/openapi.json | 6 +- 2 files changed, 59 insertions(+), 18 deletions(-) diff --git a/specification/resources/Authorization.Management/routes.tsp b/specification/resources/Authorization.Management/routes.tsp index fdc5037826a3..09ce3ba32458 100644 --- a/specification/resources/Authorization.Management/routes.tsp +++ b/specification/resources/Authorization.Management/routes.tsp @@ -76,37 +76,78 @@ interface PolicyDefinitionVersionsOperationGroup { >; } +alias PolicySetDefinitionVersionListOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + ...SubscriptionIdParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + }, + {}, + {} +>; + +alias PolicySetDefinitionVersionTenantListOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Authorization"; + }, + {}, + {} +>; + +alias PolicySetDefinitionVersionManagementGroupListOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Management"; + + ...CommonTypes.ManagementGroupNameParameter; + ...ApiVersionParameter; + }, + { + ...Extension.ExtensionProviderNamespace; + }, + { + ...Extension.ExtensionProviderNamespace; + } +>; + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" interface PolicySetDefinitionVersionsOperationGroup { /** * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. */ @summary("Lists all built-in policy set definition versions.") - @autoRoute - @action("listPolicySetDefinitionVersions") - listAllBuiltins is ArmProviderActionSync>; + @post + @segment("listPolicySetDefinitionVersions") + listAllBuiltins is PolicySetDefinitionVersionTenantListOps.ListSinglePage; /** * This operation lists all the policy set definition versions for all policy set definitions at the management group scope. */ @summary("Lists all policy set definition versions at management group scope.") - @autoRoute @post - @action("listPolicySetDefinitionVersions") - @armResourceCollectionAction - listAllAtManagementGroup( - ...ManagementGroupNameParameters, - ): ResourceListResult | ErrorResponse; + @segment("listPolicySetDefinitionVersions") + listAllAtManagementGroup is PolicySetDefinitionVersionManagementGroupListOps.ListSinglePage; /** * This operation lists all the policy set definition versions for all policy set definitions within a subscription. */ @summary("Lists all policy set definition versions within a subscription.") - @autoRoute - @action("listPolicySetDefinitionVersions") - listAll is ArmProviderActionSync< - Response = ResourceListResult, - Scope = SubscriptionActionScope - >; + @post + @segment("listPolicySetDefinitionVersions") + listAll is PolicySetDefinitionVersionListOps.ListSinglePage; } #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 1aee8c5248da..406cb76909ff 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -359,7 +359,7 @@ ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersionListResult" } @@ -892,7 +892,7 @@ ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersionListResult" } @@ -1975,7 +1975,7 @@ ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersionListResult" } From 1b81221251a688007d9644689dc703f2b3359e52 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 4 Nov 2025 16:35:00 +0800 Subject: [PATCH 30/45] use PolicyAssignmentGenericOps --- .../PolicyAssignment.tsp | 87 ++++++++++--------- .../stable/2025-03-01/openapi.json | 2 +- 2 files changed, 49 insertions(+), 40 deletions(-) diff --git a/specification/resources/Authorization.Management/PolicyAssignment.tsp b/specification/resources/Authorization.Management/PolicyAssignment.tsp index e818724a538d..da13e0195645 100644 --- a/specification/resources/Authorization.Management/PolicyAssignment.tsp +++ b/specification/resources/Authorization.Management/PolicyAssignment.tsp @@ -57,6 +57,50 @@ alias PolicyAssignmentListParameters = { $top?: int32; }; +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" +interface PolicyAssignmentGenericOps + extends Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...SubscriptionIdParameter, + ...ResourceGroupParameter, + + /** + * The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + */ + @path + @segment("providers") + resourceProviderNamespace: string, + + /** + * The parent resource path. Use empty string if there is none. + */ + @path(#{ allowReserved: true }) + parentResourcePath: string, + + /** + * The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). + */ + @path(#{ allowReserved: true }) + resourceType: string, + + /** + * The name of the resource. + */ + @path + @pattern("^.+$") + resourceName: string, + + ...ApiVersionParameter, + }, + { + ...Extension.ExtensionProviderNamespace, + }, + { + ...Extension.ExtensionProviderNamespace, + ...KeysOf, + } + > {} + @armResourceOperations interface PolicyAssignments { /** @@ -136,46 +180,11 @@ interface PolicyAssignments { * 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'). */ @summary("Retrieves all policy assignments that apply to a resource.") - @autoRoute - @list - @listsResource(PolicyAssignment) - @segmentOf(PolicyAssignment) - @armResourceList(PolicyAssignment) @get - listForResource( - ...SubscriptionIdParameter, - ...ResourceGroupParameter, - - /** - * The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) - */ - @path - @segment("providers") - resourceProviderNamespace: string, - - /** - * The parent resource path. Use empty string if there is none. - */ - @path(#{ allowReserved: true }) - parentResourcePath: string, - - /** - * The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). - */ - @path(#{ allowReserved: true }) - resourceType: string, - - /** - * The name of the resource. - */ - @path - @pattern("^.+$") - resourceName: string, - - ...ProviderNamespace, - ...ApiVersionParameter, - ...PolicyAssignmentListParameters, - ): ResourceListResult | ErrorResponse; + listForResource is PolicyAssignmentGenericOps.List< + PolicyAssignment, + PolicyAssignmentListParameters + >; } @@doc(PolicyAssignment.name, "The name of the policy assignment to get."); diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 406cb76909ff..6d5a16cdd8b6 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -3011,7 +3011,7 @@ ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/PolicyAssignmentListResult" } From be323dcdd4c6904130b165b270c6ccad04883f4a Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 4 Nov 2025 17:06:37 +0800 Subject: [PATCH 31/45] update others --- .../Authorization.Management/routes.tsp | 113 +++++++----------- .../stable/2025-03-01/openapi.json | 6 +- 2 files changed, 46 insertions(+), 73 deletions(-) diff --git a/specification/resources/Authorization.Management/routes.tsp b/specification/resources/Authorization.Management/routes.tsp index 09ce3ba32458..a9bb674826d9 100644 --- a/specification/resources/Authorization.Management/routes.tsp +++ b/specification/resources/Authorization.Management/routes.tsp @@ -13,70 +13,7 @@ using TypeSpec.OpenAPI; namespace Microsoft.Authorization; -alias ManagementGroupNameParameters = { - /** the provider namespace */ - @path - @segment("providers") - @key - providerNamespace: "Microsoft.Management"; - - ...CommonTypes.ManagementGroupNameParameter; - ...ProviderNamespace; - ...ApiVersionParameter; -}; - -alias ManagementGroupIdParameters = { - /** the provider namespace */ - @path - @segment("providers") - @key - providerNamespace: "Microsoft.Management"; - - /** The ID of the management group. */ - @path - @segment("managementGroups") - @key - managementGroupId: string; - - ...ProviderNamespace; - ...ApiVersionParameter; -}; - -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" -interface PolicyDefinitionVersionsOperationGroup { - /** - * This operation lists all the built-in policy definition versions for all built-in policy definitions. - */ - @summary("Lists all built-in policy definition versions.") - @autoRoute - @action("listPolicyDefinitionVersions") - listAllBuiltins is ArmProviderActionSync>; - - /** - * This operation lists all the policy definition versions for all policy definitions at the management group scope. - */ - @summary("Lists all policy definition versions at management group scope.") - @autoRoute - @post - @action("listPolicyDefinitionVersions") - @armResourceCollectionAction - listAllAtManagementGroup( - ...ManagementGroupNameParameters, - ): ResourceListResult | ErrorResponse; - - /** - * This operation lists all the policy definition versions for all policy definitions within a subscription. - */ - @summary("Lists all policy definition versions within a subscription.") - @autoRoute - @action("listPolicyDefinitionVersions") - listAll is ArmProviderActionSync< - Response = ResourceListResult, - Scope = SubscriptionActionScope - >; -} - -alias PolicySetDefinitionVersionListOps = Azure.ResourceManager.Legacy.ExtensionOperations< +alias PolicyDefinitionListOps = Azure.ResourceManager.Legacy.ExtensionOperations< { ...ApiVersionParameter; ...SubscriptionIdParameter; @@ -91,7 +28,7 @@ alias PolicySetDefinitionVersionListOps = Azure.ResourceManager.Legacy.Extension {} >; -alias PolicySetDefinitionVersionTenantListOps = Azure.ResourceManager.Legacy.ExtensionOperations< +alias PolicyDefinitionTenantListOps = Azure.ResourceManager.Legacy.ExtensionOperations< { ...ApiVersionParameter; @@ -105,7 +42,7 @@ alias PolicySetDefinitionVersionTenantListOps = Azure.ResourceManager.Legacy.Ext {} >; -alias PolicySetDefinitionVersionManagementGroupListOps = Azure.ResourceManager.Legacy.ExtensionOperations< +alias PolicyDefinitionManagementGroupListOps = Azure.ResourceManager.Legacy.ExtensionOperations< { /** the provider namespace */ @path @@ -124,6 +61,33 @@ alias PolicySetDefinitionVersionManagementGroupListOps = Azure.ResourceManager.L } >; +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" +interface PolicyDefinitionVersionsOperationGroup { + /** + * This operation lists all the built-in policy definition versions for all built-in policy definitions. + */ + @summary("Lists all built-in policy definition versions.") + @post + @segment("listPolicyDefinitionVersions") + listAllBuiltins is PolicyDefinitionTenantListOps.ListSinglePage; + + /** + * This operation lists all the policy definition versions for all policy definitions at the management group scope. + */ + @summary("Lists all policy definition versions at management group scope.") + @post + @segment("listPolicyDefinitionVersions") + listAllAtManagementGroup is PolicyDefinitionManagementGroupListOps.ListSinglePage; + + /** + * This operation lists all the policy definition versions for all policy definitions within a subscription. + */ + @summary("Lists all policy definition versions within a subscription.") + @post + @segment("listPolicyDefinitionVersions") + listAll is PolicyDefinitionListOps.ListSinglePage; +} + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" interface PolicySetDefinitionVersionsOperationGroup { /** @@ -132,14 +96,15 @@ interface PolicySetDefinitionVersionsOperationGroup { @summary("Lists all built-in policy set definition versions.") @post @segment("listPolicySetDefinitionVersions") - listAllBuiltins is PolicySetDefinitionVersionTenantListOps.ListSinglePage; + listAllBuiltins is PolicyDefinitionTenantListOps.ListSinglePage; + /** * This operation lists all the policy set definition versions for all policy set definitions at the management group scope. */ @summary("Lists all policy set definition versions at management group scope.") @post @segment("listPolicySetDefinitionVersions") - listAllAtManagementGroup is PolicySetDefinitionVersionManagementGroupListOps.ListSinglePage; + listAllAtManagementGroup is PolicyDefinitionManagementGroupListOps.ListSinglePage; /** * This operation lists all the policy set definition versions for all policy set definitions within a subscription. @@ -147,7 +112,7 @@ interface PolicySetDefinitionVersionsOperationGroup { @summary("Lists all policy set definition versions within a subscription.") @post @segment("listPolicySetDefinitionVersions") - listAll is PolicySetDefinitionVersionListOps.ListSinglePage; + listAll is PolicyDefinitionListOps.ListSinglePage; } #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" @@ -173,7 +138,15 @@ interface PolicyTokensOperationGroup { @action("acquirePolicyToken") @armResourceCollectionAction acquireAtManagementGroup( - ...ManagementGroupNameParameters, + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Management", + + ...CommonTypes.ManagementGroupNameParameter, + ...ProviderNamespace, + ...ApiVersionParameter, /** The policy token properties. */ @body parameters: PolicyTokenRequest, diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 6d5a16cdd8b6..d05803bb5e95 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -328,7 +328,7 @@ ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/PolicyDefinitionVersionListResult" } @@ -858,7 +858,7 @@ ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/PolicyDefinitionVersionListResult" } @@ -1941,7 +1941,7 @@ ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/PolicyDefinitionVersionListResult" } From e7bdedaddd49a26edf2419c421db4171c4df2f42 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 4 Nov 2025 17:21:07 +0800 Subject: [PATCH 32/45] backward compatible --- .../Authorization.Management/models.tsp | 22 +++++++-- .../stable/2025-03-01/openapi.json | 49 +++++++++---------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/specification/resources/Authorization.Management/models.tsp b/specification/resources/Authorization.Management/models.tsp index d3437fbbb63c..a7c40a32665d 100644 --- a/specification/resources/Authorization.Management/models.tsp +++ b/specification/resources/Authorization.Management/models.tsp @@ -300,7 +300,7 @@ model PolicyAssignmentProperties { * The parameter values for the assigned policy rule. The keys are the parameter names. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" - parameters?: Record; + parameters?: ParameterValues; /** * This message will be part of response in case of policy violation. @@ -348,6 +348,12 @@ model PolicyAssignmentProperties { instanceId?: string; } +/** + * The parameter values for the policy rule. The keys are the parameter names. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" +model ParameterValues is Record; + /** * The value of a parameter. */ @@ -552,7 +558,7 @@ model PolicyDefinitionProperties { * The parameter definitions for parameters used in the policy rule. The keys are the parameter names. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" - parameters?: Record; + parameters?: ParameterDefinitions; /** * The policy definition version in #.#.# format. @@ -570,6 +576,12 @@ model PolicyDefinitionProperties { externalEvaluationEnforcementSettings?: ExternalEvaluationEnforcementSettings; } +/** + * The parameter definitions for parameters used in the policy. The keys are the parameter names. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" +model ParameterDefinitions is Record; + /** * The definition of a parameter that can be provided to the policy. */ @@ -711,7 +723,7 @@ model PolicyDefinitionVersionProperties { * The parameter definitions for parameters used in the policy rule. The keys are the parameter names. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" - parameters?: Record; + parameters?: ParameterDefinitions; /** * The policy definition version in #.#.# format. @@ -754,7 +766,7 @@ model PolicySetDefinitionProperties { * The policy set definition parameters that can be used in policy definition references. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" - parameters?: Record; + parameters?: ParameterDefinitions; /** * An array of policy definition references. @@ -809,7 +821,7 @@ model PolicyDefinitionReference { * The parameter values for the referenced policy rule. The keys are the parameter names. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" - parameters?: Record; + parameters?: ParameterValues; /** * A unique id (within the policy set definition) for this policy definition reference. diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index d05803bb5e95..716c628ccfb2 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -3320,6 +3320,13 @@ ] } }, + "ParameterDefinitions": { + "type": "object", + "description": "The parameter definitions for parameters used in the policy. The keys are the parameter names.", + "additionalProperties": { + "$ref": "#/definitions/ParameterDefinitionsValue" + } + }, "ParameterDefinitionsValue": { "type": "object", "description": "The definition of a parameter that can be provided to the policy.", @@ -3422,6 +3429,13 @@ ] } }, + "ParameterValues": { + "type": "object", + "description": "The parameter values for the policy rule. The keys are the parameter names.", + "additionalProperties": { + "$ref": "#/definitions/ParameterValuesValue" + } + }, "ParameterValuesValue": { "type": "object", "description": "The value of a parameter.", @@ -3515,11 +3529,8 @@ } }, "parameters": { - "type": "object", - "description": "The parameter values for the assigned policy rule. The keys are the parameter names.", - "additionalProperties": { - "$ref": "#/definitions/ParameterValuesValue" - } + "$ref": "#/definitions/ParameterValues", + "description": "The parameter values for the assigned policy rule. The keys are the parameter names." }, "description": { "type": "string", @@ -3732,11 +3743,8 @@ "description": "The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." }, "parameters": { - "type": "object", - "description": "The parameter definitions for parameters used in the policy rule. The keys are the parameter names.", - "additionalProperties": { - "$ref": "#/definitions/ParameterDefinitionsValue" - } + "$ref": "#/definitions/ParameterDefinitions", + "description": "The parameter definitions for parameters used in the policy rule. The keys are the parameter names." }, "version": { "type": "string", @@ -3778,11 +3786,8 @@ "readOnly": true }, "parameters": { - "type": "object", - "description": "The parameter values for the referenced policy rule. The keys are the parameter names.", - "additionalProperties": { - "$ref": "#/definitions/ParameterValuesValue" - } + "$ref": "#/definitions/ParameterValues", + "description": "The parameter values for the referenced policy rule. The keys are the parameter names." }, "policyDefinitionReferenceId": { "type": "string", @@ -3865,11 +3870,8 @@ "description": "The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." }, "parameters": { - "type": "object", - "description": "The parameter definitions for parameters used in the policy rule. The keys are the parameter names.", - "additionalProperties": { - "$ref": "#/definitions/ParameterDefinitionsValue" - } + "$ref": "#/definitions/ParameterDefinitions", + "description": "The parameter definitions for parameters used in the policy rule. The keys are the parameter names." }, "version": { "type": "string", @@ -4034,11 +4036,8 @@ "description": "The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." }, "parameters": { - "type": "object", - "description": "The policy set definition parameters that can be used in policy definition references.", - "additionalProperties": { - "$ref": "#/definitions/ParameterDefinitionsValue" - } + "$ref": "#/definitions/ParameterDefinitions", + "description": "The policy set definition parameters that can be used in policy definition references." }, "policyDefinitions": { "type": "array", From 2967570d3729aaa27c0bd0d01e3e762065e445b6 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 10 Nov 2025 13:38:56 +0800 Subject: [PATCH 33/45] api in client --- .../Authorization.Management/client.tsp | 91 +++++++++++++++++-- .../resources/resource-manager/readme.md | 7 +- 2 files changed, 83 insertions(+), 15 deletions(-) diff --git a/specification/resources/Authorization.Management/client.tsp b/specification/resources/Authorization.Management/client.tsp index 7d3306d8c2dc..61352dc50ec0 100644 --- a/specification/resources/Authorization.Management/client.tsp +++ b/specification/resources/Authorization.Management/client.tsp @@ -3,14 +3,87 @@ import "@azure-tools/typespec-client-generator-core"; import "./main.tsp"; using Azure.ClientGenerator.Core; +using Azure.ResourceManager; using TypeSpec.Http; -// namespace Microsoft.Authorization { -// @clientLocation(PolicyAssignments) -// @get -// @route("/{policyAssignmentId}") -// op getById( -// @path policyAssignmentId: string, -// ...Azure.Core.Foundations.ApiVersionParameter, -// ): PolicyAssignment; -// } +/** + * To manage and control access to your resources, you can define customized policies and assign them at a scope. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "For client" +namespace Microsoft.Authorization { + alias PolicyAssignmentIdParameter = { + /** + * The ID of the policy assignment to get. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + */ + @path policyAssignmentId: string; + }; + + /** + * 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}'. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "For client" + @summary("Retrieves the policy assignment with the given ID.") + @scope("java") + @clientLocation(PolicyAssignments) + @get + @route("/{policyAssignmentId}") + op getById( + ...PolicyAssignmentIdParameter, + ...Azure.Core.Foundations.ApiVersionParameter, + ): PolicyAssignment | ErrorResponse; + + /** + * 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}'. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "For client" + @summary("Creates or updates a policy assignment.") + @scope("java") + @clientLocation(PolicyAssignments) + @put + @route("/{policyAssignmentId}") + op createById( + ...PolicyAssignmentIdParameter, + + /** + * Parameters for policy assignment. + */ + @bodyRoot parameters: PolicyAssignment, + + ...Azure.Core.Foundations.ApiVersionParameter, + ): ArmResourceCreatedSyncResponse | ErrorResponse; + + /** + * 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}'. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "For client" + #suppress "@typespec/http/patch-implicit-optional" "For client" + @summary("Updates a policy assignment.") + @scope("java") + @clientLocation(PolicyAssignments) + @patch + @route("/{policyAssignmentId}") + op updateById( + ...PolicyAssignmentIdParameter, + + /** + * Parameters for policy assignment patch request. + */ + @bodyRoot parameters: PolicyAssignmentUpdate, + + ...Azure.Core.Foundations.ApiVersionParameter, + ): PolicyAssignment | ErrorResponse; + + /** + * 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). + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "For client" + @summary("Deletes a policy assignment.") + @scope("java") + @clientLocation(PolicyAssignments) + @delete + @route("/{policyAssignmentId}") + op deleteById( + ...PolicyAssignmentIdParameter, + ...Azure.Core.Foundations.ApiVersionParameter, + ): PolicyAssignment | ArmDeletedNoContentResponse | ErrorResponse; +} diff --git a/specification/resources/resource-manager/readme.md b/specification/resources/resource-manager/readme.md index bae627943ae5..f1c5504393fd 100644 --- a/specification/resources/resource-manager/readme.md +++ b/specification/resources/resource-manager/readme.md @@ -79,12 +79,7 @@ These settings apply only when `--tag=package-policy-2025-03-stable` is specifie ```yaml $(tag) == 'package-policy-2025-03-stable' input-file: - - Microsoft.Authorization/stable/2025-03-01/policyAssignments.json - - Microsoft.Authorization/stable/2025-03-01/policyDefinitions.json - - Microsoft.Authorization/stable/2025-03-01/policyDefinitionVersions.json - - Microsoft.Authorization/stable/2025-03-01/policySetDefinitions.json - - Microsoft.Authorization/stable/2025-03-01/policySetDefinitionVersions.json - - Microsoft.Authorization/stable/2025-03-01/policyTokens.json + - Microsoft.Authorization/stable/2025-03-01/openapi.json # Needed when there is more than one input file override-info: From 898d94187ccf17685b8bffc68e809d9923f2b258 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 10 Nov 2025 13:44:09 +0800 Subject: [PATCH 34/45] skip-url-encoding --- .../resources/Authorization.Management/client.tsp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/resources/Authorization.Management/client.tsp b/specification/resources/Authorization.Management/client.tsp index 61352dc50ec0..e039b8a2185e 100644 --- a/specification/resources/Authorization.Management/client.tsp +++ b/specification/resources/Authorization.Management/client.tsp @@ -26,7 +26,7 @@ namespace Microsoft.Authorization { @scope("java") @clientLocation(PolicyAssignments) @get - @route("/{policyAssignmentId}") + @route("/{+policyAssignmentId}") op getById( ...PolicyAssignmentIdParameter, ...Azure.Core.Foundations.ApiVersionParameter, @@ -40,7 +40,7 @@ namespace Microsoft.Authorization { @scope("java") @clientLocation(PolicyAssignments) @put - @route("/{policyAssignmentId}") + @route("/{+policyAssignmentId}") op createById( ...PolicyAssignmentIdParameter, @@ -61,7 +61,7 @@ namespace Microsoft.Authorization { @scope("java") @clientLocation(PolicyAssignments) @patch - @route("/{policyAssignmentId}") + @route("/{+policyAssignmentId}") op updateById( ...PolicyAssignmentIdParameter, @@ -81,7 +81,7 @@ namespace Microsoft.Authorization { @scope("java") @clientLocation(PolicyAssignments) @delete - @route("/{policyAssignmentId}") + @route("/{+policyAssignmentId}") op deleteById( ...PolicyAssignmentIdParameter, ...Azure.Core.Foundations.ApiVersionParameter, From e530012e198fac9be489ec09f18c043181eaaa32 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 10 Nov 2025 13:56:17 +0800 Subject: [PATCH 35/45] fix a ref --- .../resources/Authorization.Management/models.tsp | 2 +- .../Microsoft.Authorization/stable/2025-03-01/openapi.json | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/specification/resources/Authorization.Management/models.tsp b/specification/resources/Authorization.Management/models.tsp index a7c40a32665d..e57fa1459a19 100644 --- a/specification/resources/Authorization.Management/models.tsp +++ b/specification/resources/Authorization.Management/models.tsp @@ -894,7 +894,7 @@ model PolicySetDefinitionVersionProperties { * The policy set definition parameters that can be used in policy definition references. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" - parameters?: Record; + parameters?: ParameterDefinitions; /** * An array of policy definition references. diff --git a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json index 716c628ccfb2..67368b4ced55 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/stable/2025-03-01/openapi.json @@ -4132,11 +4132,8 @@ "description": "The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." }, "parameters": { - "type": "object", - "description": "The policy set definition parameters that can be used in policy definition references.", - "additionalProperties": { - "$ref": "#/definitions/ParameterDefinitionsValue" - } + "$ref": "#/definitions/ParameterDefinitions", + "description": "The policy set definition parameters that can be used in policy definition references." }, "policyDefinitions": { "type": "array", From 81d3906ba99e2a63d9205f937c0fdede2bce071b Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 10 Nov 2025 14:20:48 +0800 Subject: [PATCH 36/45] copy existing suppress to openapi.json file --- .../resources/resource-manager/readme.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/specification/resources/resource-manager/readme.md b/specification/resources/resource-manager/readme.md index f1c5504393fd..4e03a9db5778 100644 --- a/specification/resources/resource-manager/readme.md +++ b/specification/resources/resource-manager/readme.md @@ -1012,6 +1012,9 @@ directive: - suppress: UniqueResourcePaths from: policySetDefinitions.json reason: policy set definition under an extension resource with Microsoft.Management + - suppress: UniqueResourcePaths + from: openapi.json + reason: policy set definition under an extension resource with Microsoft.Management - suppress: UniqueResourcePaths from: resources.json where: $.paths @@ -1019,16 +1022,29 @@ directive: - suppress: UniqueResourcePaths from: policyDefinitions.json reason: policy definition under an extension resource with Microsoft.Management + - suppress: UniqueResourcePaths + from: openapi.json + reason: policy definition under an extension resource with Microsoft.Management - suppress: UniqueResourcePaths from: policyAssignments.json reason: policy assignment under an extension resource with Microsoft.Management + - suppress: UniqueResourcePaths + from: openapi.json + reason: policy assignment under an extension resource with Microsoft.Management - suppress: UniqueResourcePaths from: policyExemptions.json where: $.paths reason: policy exemption under an extension resource with Microsoft.Management + - suppress: UniqueResourcePaths + from: openapi.json + where: $.paths + reason: policy exemption under an extension resource with Microsoft.Management - suppress: OperationsAPIImplementation from: policyAssignments.json reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger + - suppress: OperationsAPIImplementation + from: openapi.json + reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger - suppress: OperationsAPIImplementation from: privateLinks.json where: $.paths @@ -1036,43 +1052,83 @@ directive: - suppress: OperationsAPIImplementation from: policyDefinitions.json reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger + - suppress: OperationsAPIImplementation + from: openapi.json + reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger - suppress: OperationsAPIImplementation from: policyDefinitionVersions.json reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger + - suppress: OperationsAPIImplementation + from: openapi.json + reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger - suppress: OperationsAPIImplementation from: policySetDefinitions.json reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger + - suppress: OperationsAPIImplementation + from: openapi.json + reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger - suppress: OperationsAPIImplementation from: policySetDefinitionVersions.json reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger + - suppress: OperationsAPIImplementation + from: openapi.json + reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger - suppress: OperationsAPIImplementation from: policyExemptions.json reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger + - suppress: OperationsAPIImplementation + from: openapi.json + reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger - suppress: OperationsAPIImplementation from: policyVariables.json reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger + - suppress: OperationsAPIImplementation + from: openapi.json + reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger - suppress: OperationsAPIImplementation from: policyVariableValues.json reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger + - suppress: OperationsAPIImplementation + from: openapi.json + reason: operation APIs for Microsoft.Authorization are to be defined in RBAC swagger - suppress: BodyTopLevelProperties from: policyAssignments.json reason: Currently systemData is not allowed. Lint bug - collection GET result contains value and nextLink properties. + - suppress: BodyTopLevelProperties + from: openapi.json + reason: Currently systemData is not allowed. Lint bug - collection GET result contains value and nextLink properties. - suppress: BodyTopLevelProperties from: policyDefinitions.json reason: Currently systemData is not allowed. Lint bug - collection GET result contains value and nextLink properties. + - suppress: BodyTopLevelProperties + from: openapi.json + reason: Currently systemData is not allowed. Lint bug - collection GET result contains value and nextLink properties. - suppress: BodyTopLevelProperties from: policyDefinitionVersions.json reason: Currently systemData is not allowed. Lint bug - collection GET result contains value and nextLink properties. + - suppress: BodyTopLevelProperties + from: openapi.json + reason: Currently systemData is not allowed. Lint bug - collection GET result contains value and nextLink properties. - suppress: BodyTopLevelProperties from: policySetDefinitions.json reason: Currently systemData is not allowed. Lint bug - collection GET result contains value and nextLink properties. + - suppress: BodyTopLevelProperties + from: openapi.json + reason: Currently systemData is not allowed. Lint bug - collection GET result contains value and nextLink properties. - suppress: BodyTopLevelProperties from: policySetDefinitionVersions.json reason: Currently systemData is not allowed. Lint bug - collection GET result contains value and nextLink properties. + - suppress: BodyTopLevelProperties + from: openapi.json + reason: Currently systemData is not allowed. Lint bug - collection GET result contains value and nextLink properties. - suppress: BodyTopLevelProperties from: policyExemptions.json where: $.definitions.PolicyExemption.properties reason: Currently systemData is not allowed + - suppress: BodyTopLevelProperties + from: openapi.json + where: $.definitions.PolicyExemption.properties + reason: Currently systemData is not allowed - suppress: BodyTopLevelProperties from: resources.json where: $.definitions.ResourceGroup.properties @@ -1144,15 +1200,27 @@ directive: - suppress: TopLevelResourcesListByResourceGroup from: policyDefinitions.json reason: Policy definitions are a proxy resource that is only usable on subscriptions or management groups + - suppress: TopLevelResourcesListByResourceGroup + from: openapi.json + reason: Policy definitions are a proxy resource that is only usable on subscriptions or management groups - suppress: TopLevelResourcesListByResourceGroup from: policyVariables.json reason: Policy variables are a proxy resource that is only usable on subscriptions or management groups + - suppress: TopLevelResourcesListByResourceGroup + from: openapi.json + reason: Policy variables are a proxy resource that is only usable on subscriptions or management groups - suppress: TopLevelResourcesListByResourceGroup from: policyVariableValues.json reason: Policy variable values are a proxy resource that is only usable on subscriptions or management groups + - suppress: TopLevelResourcesListByResourceGroup + from: openapi.json + reason: Policy variable values are a proxy resource that is only usable on subscriptions or management groups - suppress: TopLevelResourcesListByResourceGroup from: policySetDefinitions.json reason: Policy set definitions are a proxy resource that is only usable on subscriptions or management groups + - suppress: TopLevelResourcesListByResourceGroup + from: openapi.json + reason: Policy set definitions are a proxy resource that is only usable on subscriptions or management groups - suppress: RequiredReadOnlySystemData from: privateLinks.json reason: We do not yet support system data From a61d2d7ecf7d6be76c3f718af9712f6901047e60 Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" Date: Wed, 19 Nov 2025 16:43:54 +0800 Subject: [PATCH 37/45] update package name --- .../resources/Authorization.Management/tspconfig.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/specification/resources/Authorization.Management/tspconfig.yaml b/specification/resources/Authorization.Management/tspconfig.yaml index 7ca0e30a6063..b83495652a4f 100644 --- a/specification/resources/Authorization.Management/tspconfig.yaml +++ b/specification/resources/Authorization.Management/tspconfig.yaml @@ -29,11 +29,12 @@ options: service-name: "Policy" flavor: azure "@azure-tools/typespec-ts": - emitter-output-dir: "{output-dir}/{service-dir}/arm-resourcespolicy" + service-dir: "sdk/policy" + emitter-output-dir: "{output-dir}/{service-dir}/arm-policy" flavor: azure experimental-extensible-enums: true package-details: - name: "@azure/arm-resourcespolicy" + name: "@azure/arm-policy" "@azure-tools/typespec-go": service-dir: "sdk/resourcemanager/resources" emitter-output-dir: "{output-dir}/{service-dir}/armpolicy" From 3c83b6f6d6a88de541a53e13f4b46fc253d636b6 Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" Date: Wed, 19 Nov 2025 17:02:00 +0800 Subject: [PATCH 38/45] update client name --- specification/resources/Authorization.Management/client.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/resources/Authorization.Management/client.tsp b/specification/resources/Authorization.Management/client.tsp index e039b8a2185e..90f409de08aa 100644 --- a/specification/resources/Authorization.Management/client.tsp +++ b/specification/resources/Authorization.Management/client.tsp @@ -87,3 +87,4 @@ namespace Microsoft.Authorization { ...Azure.Core.Foundations.ApiVersionParameter, ): PolicyAssignment | ArmDeletedNoContentResponse | ErrorResponse; } +@@clientName(Microsoft.Authorization, "PolicyClient", "javascript"); From 8770a178fc000a4f5c29552d58288b4102a9a192 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 25 Nov 2025 11:03:06 +0800 Subject: [PATCH 39/45] for tsp 1.6.0 --- specification/resources/Authorization.Management/models.tsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/resources/Authorization.Management/models.tsp b/specification/resources/Authorization.Management/models.tsp index e57fa1459a19..29b0f655e0e8 100644 --- a/specification/resources/Authorization.Management/models.tsp +++ b/specification/resources/Authorization.Management/models.tsp @@ -973,7 +973,7 @@ model PolicyTokenResponse { /** * An array of external evaluation endpoint invocation results. */ - @OpenAPI.extension("x-ms-identifiers", #[]) + @identifiers(#[]) results?: ExternalEvaluationEndpointInvocationResult[]; /** @@ -984,6 +984,7 @@ model PolicyTokenResponse { /** * The issued policy token. */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "TODO: Check if this is a secret and add @secret or update reason" token?: string; /** From 5265bc07a2bcc1dd315ef209ea0285e357f778fc Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Tue, 16 Dec 2025 14:46:59 +0800 Subject: [PATCH 40/45] Update client.tsp --- .../resource-manager/Microsoft.Authorization/policy/client.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/resources/resource-manager/Microsoft.Authorization/policy/client.tsp b/specification/resources/resource-manager/Microsoft.Authorization/policy/client.tsp index 90f409de08aa..dcbd888ba88a 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/policy/client.tsp +++ b/specification/resources/resource-manager/Microsoft.Authorization/policy/client.tsp @@ -88,3 +88,4 @@ namespace Microsoft.Authorization { ): PolicyAssignment | ArmDeletedNoContentResponse | ErrorResponse; } @@clientName(Microsoft.Authorization, "PolicyClient", "javascript"); +@@clientName(Microsoft.Authorization, "PolicyMgmtClient", "python"); From 9161354f2ac7b09c4dbb6d35e281b137156f3d33 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Wed, 17 Dec 2025 17:27:56 +0800 Subject: [PATCH 41/45] Update client.tsp --- .../Microsoft.Authorization/policy/client.tsp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Authorization/policy/client.tsp b/specification/resources/resource-manager/Microsoft.Authorization/policy/client.tsp index dcbd888ba88a..0b0b59ee3db7 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/policy/client.tsp +++ b/specification/resources/resource-manager/Microsoft.Authorization/policy/client.tsp @@ -35,10 +35,10 @@ namespace Microsoft.Authorization { /** * 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}'. */ - #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "For client" + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "For " @summary("Creates or updates a policy assignment.") @scope("java") - @clientLocation(PolicyAssignments) + @Location(PolicyAssignments) @put @route("/{+policyAssignmentId}") op createById( @@ -87,5 +87,4 @@ namespace Microsoft.Authorization { ...Azure.Core.Foundations.ApiVersionParameter, ): PolicyAssignment | ArmDeletedNoContentResponse | ErrorResponse; } -@@clientName(Microsoft.Authorization, "PolicyClient", "javascript"); -@@clientName(Microsoft.Authorization, "PolicyMgmtClient", "python"); +@@clientName(Microsoft.Authorization, "PolicyClient", "javascript,python"); From c9f3accae75faaa78af4fe01eabced83e3f69422 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Wed, 17 Dec 2025 17:28:48 +0800 Subject: [PATCH 42/45] Update tspconfig.yaml --- .../Microsoft.Authorization/policy/tspconfig.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Authorization/policy/tspconfig.yaml b/specification/resources/resource-manager/Microsoft.Authorization/policy/tspconfig.yaml index 8e70a3a62447..eced5da06ab6 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/policy/tspconfig.yaml +++ b/specification/resources/resource-manager/Microsoft.Authorization/policy/tspconfig.yaml @@ -19,8 +19,8 @@ options: model-namespace: true namespace: "Azure.ResourceManager.Resources.Policy" "@azure-tools/typespec-python": - emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-resources-policy" - namespace: "azure.mgmt.resources.policy" + emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-resource-policy" + namespace: "azure.mgmt.resource.policy" generate-test: true generate-sample: true flavor: "azure" From 3e509b10bbe51fda8e2a1032584f77334489d9d7 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Mon, 22 Dec 2025 10:42:54 +0800 Subject: [PATCH 43/45] Update client location annotation in policy client --- .../Microsoft.Authorization/policy/client.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Authorization/policy/client.tsp b/specification/resources/resource-manager/Microsoft.Authorization/policy/client.tsp index 0b0b59ee3db7..5d07196314ae 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/policy/client.tsp +++ b/specification/resources/resource-manager/Microsoft.Authorization/policy/client.tsp @@ -35,10 +35,10 @@ namespace Microsoft.Authorization { /** * 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}'. */ - #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "For " + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "For client" @summary("Creates or updates a policy assignment.") @scope("java") - @Location(PolicyAssignments) + @clientLocation(PolicyAssignments) @put @route("/{+policyAssignmentId}") op createById( From c131197f8ee69a3486ffaf6c3d640e116c5c9bda Mon Sep 17 00:00:00 2001 From: Judy Liu Date: Mon, 22 Dec 2025 10:52:01 +0800 Subject: [PATCH 44/45] add code --- .../Microsoft.Authorization/policy/tspconfig.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/resources/resource-manager/Microsoft.Authorization/policy/tspconfig.yaml b/specification/resources/resource-manager/Microsoft.Authorization/policy/tspconfig.yaml index eced5da06ab6..29dc7d17a72e 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/policy/tspconfig.yaml +++ b/specification/resources/resource-manager/Microsoft.Authorization/policy/tspconfig.yaml @@ -40,7 +40,7 @@ options: service-dir: "sdk/resourcemanager/resources" emitter-output-dir: "{output-dir}/{service-dir}/armpolicy" module: "github.com/Azure/azure-sdk-for-go/{service-dir}/armpolicy" - fix-const-stuttering: true + fix-const-stuttering: false flavor: "azure" generate-samples: true generate-fakes: true From bc62110dbb3774a2062af62720e3599a70640ac0 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 6 Jan 2026 09:41:18 +0800 Subject: [PATCH 45/45] use Record type directly on property --- .../Microsoft.Authorization/policy/models.tsp | 24 ++------ .../policy/stable/2025-03-01/openapi.json | 56 ++++++++++--------- 2 files changed, 36 insertions(+), 44 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Authorization/policy/models.tsp b/specification/resources/resource-manager/Microsoft.Authorization/policy/models.tsp index 29b0f655e0e8..d3c68971f29d 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/policy/models.tsp +++ b/specification/resources/resource-manager/Microsoft.Authorization/policy/models.tsp @@ -300,7 +300,7 @@ model PolicyAssignmentProperties { * The parameter values for the assigned policy rule. The keys are the parameter names. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" - parameters?: ParameterValues; + parameters?: Record; /** * This message will be part of response in case of policy violation. @@ -348,12 +348,6 @@ model PolicyAssignmentProperties { instanceId?: string; } -/** - * The parameter values for the policy rule. The keys are the parameter names. - */ -#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" -model ParameterValues is Record; - /** * The value of a parameter. */ @@ -558,7 +552,7 @@ model PolicyDefinitionProperties { * The parameter definitions for parameters used in the policy rule. The keys are the parameter names. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" - parameters?: ParameterDefinitions; + parameters?: Record; /** * The policy definition version in #.#.# format. @@ -576,12 +570,6 @@ model PolicyDefinitionProperties { externalEvaluationEnforcementSettings?: ExternalEvaluationEnforcementSettings; } -/** - * The parameter definitions for parameters used in the policy. The keys are the parameter names. - */ -#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" -model ParameterDefinitions is Record; - /** * The definition of a parameter that can be provided to the policy. */ @@ -723,7 +711,7 @@ model PolicyDefinitionVersionProperties { * The parameter definitions for parameters used in the policy rule. The keys are the parameter names. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" - parameters?: ParameterDefinitions; + parameters?: Record; /** * The policy definition version in #.#.# format. @@ -766,7 +754,7 @@ model PolicySetDefinitionProperties { * The policy set definition parameters that can be used in policy definition references. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" - parameters?: ParameterDefinitions; + parameters?: Record; /** * An array of policy definition references. @@ -821,7 +809,7 @@ model PolicyDefinitionReference { * The parameter values for the referenced policy rule. The keys are the parameter names. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" - parameters?: ParameterValues; + parameters?: Record; /** * A unique id (within the policy set definition) for this policy definition reference. @@ -894,7 +882,7 @@ model PolicySetDefinitionVersionProperties { * The policy set definition parameters that can be used in policy definition references. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" - parameters?: ParameterDefinitions; + parameters?: Record; /** * An array of policy definition references. diff --git a/specification/resources/resource-manager/Microsoft.Authorization/policy/stable/2025-03-01/openapi.json b/specification/resources/resource-manager/Microsoft.Authorization/policy/stable/2025-03-01/openapi.json index d64720ed1b76..6ce8aa44bd78 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/policy/stable/2025-03-01/openapi.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/policy/stable/2025-03-01/openapi.json @@ -3320,13 +3320,6 @@ ] } }, - "ParameterDefinitions": { - "type": "object", - "description": "The parameter definitions for parameters used in the policy. The keys are the parameter names.", - "additionalProperties": { - "$ref": "#/definitions/ParameterDefinitionsValue" - } - }, "ParameterDefinitionsValue": { "type": "object", "description": "The definition of a parameter that can be provided to the policy.", @@ -3429,13 +3422,6 @@ ] } }, - "ParameterValues": { - "type": "object", - "description": "The parameter values for the policy rule. The keys are the parameter names.", - "additionalProperties": { - "$ref": "#/definitions/ParameterValuesValue" - } - }, "ParameterValuesValue": { "type": "object", "description": "The value of a parameter.", @@ -3529,8 +3515,11 @@ } }, "parameters": { - "$ref": "#/definitions/ParameterValues", - "description": "The parameter values for the assigned policy rule. The keys are the parameter names." + "type": "object", + "description": "The parameter values for the assigned policy rule. The keys are the parameter names.", + "additionalProperties": { + "$ref": "#/definitions/ParameterValuesValue" + } }, "description": { "type": "string", @@ -3743,8 +3732,11 @@ "description": "The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." }, "parameters": { - "$ref": "#/definitions/ParameterDefinitions", - "description": "The parameter definitions for parameters used in the policy rule. The keys are the parameter names." + "type": "object", + "description": "The parameter definitions for parameters used in the policy rule. The keys are the parameter names.", + "additionalProperties": { + "$ref": "#/definitions/ParameterDefinitionsValue" + } }, "version": { "type": "string", @@ -3786,8 +3778,11 @@ "readOnly": true }, "parameters": { - "$ref": "#/definitions/ParameterValues", - "description": "The parameter values for the referenced policy rule. The keys are the parameter names." + "type": "object", + "description": "The parameter values for the referenced policy rule. The keys are the parameter names.", + "additionalProperties": { + "$ref": "#/definitions/ParameterValuesValue" + } }, "policyDefinitionReferenceId": { "type": "string", @@ -3870,8 +3865,11 @@ "description": "The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." }, "parameters": { - "$ref": "#/definitions/ParameterDefinitions", - "description": "The parameter definitions for parameters used in the policy rule. The keys are the parameter names." + "type": "object", + "description": "The parameter definitions for parameters used in the policy rule. The keys are the parameter names.", + "additionalProperties": { + "$ref": "#/definitions/ParameterDefinitionsValue" + } }, "version": { "type": "string", @@ -4036,8 +4034,11 @@ "description": "The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." }, "parameters": { - "$ref": "#/definitions/ParameterDefinitions", - "description": "The policy set definition parameters that can be used in policy definition references." + "type": "object", + "description": "The policy set definition parameters that can be used in policy definition references.", + "additionalProperties": { + "$ref": "#/definitions/ParameterDefinitionsValue" + } }, "policyDefinitions": { "type": "array", @@ -4132,8 +4133,11 @@ "description": "The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." }, "parameters": { - "$ref": "#/definitions/ParameterDefinitions", - "description": "The policy set definition parameters that can be used in policy definition references." + "type": "object", + "description": "The policy set definition parameters that can be used in policy definition references.", + "additionalProperties": { + "$ref": "#/definitions/ParameterDefinitionsValue" + } }, "policyDefinitions": { "type": "array",