Add DenyAssignment TypeSpec with 2024-07-01-preview CreateOrUpdate/Delete operations#42007
Add DenyAssignment TypeSpec with 2024-07-01-preview CreateOrUpdate/Delete operations#42007jruttle wants to merge 6 commits intoAzure:mainfrom
Conversation
…rations - Add TypeSpec definitions for DenyAssignment sub-service (Microsoft.Authorization) - Stable 2022-04-01: Read-only operations (Get, List, ListForScope, etc.) - Preview 2024-07-01-preview: CreateOrUpdate and Delete operations - Add DenyAssignmentEffect enum (enforced, audit) for preview version - Include Common/ shared types (Principal, PrincipalType, CloudError) - Regenerate swagger from TypeSpec Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Next Steps to MergeNext steps that must be taken to merge this PR:
Comment generated by summarize-checks workflow run. |
…d suppressions - Rename DenyAssignment.Management to DenyAssignmentManagement (folder name regex) - Inline Principal/PrincipalType models from Common/main.tsp into models.tsp - Fix example body parameter key from 'parameters' to 'resource' - Add BreakingChange and Avocado suppressions - Regenerate swagger output Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Label Justifications\Approved-Avocado\The \MULTIPLE_API_VERSION\ error is a pre-existing condition in the Authorization service readme. The default tag \package-2025-12-01-preview\ intentionally aggregates swagger files from multiple API versions (2015-07-01, 2022-04-01, 2024-07-01-preview, etc.) — this is the established pattern for this large RP. Our change adds the new \preview/2024-07-01-preview/authorization-DenyAssignmentCalls.json\ to this existing tag structure. \BreakingChange-Approved-Benign\The cross-version breaking changes detected are expected artifacts of the TypeSpec conversion:
All changes are benign structural differences from the TypeSpec conversion, not breaking API behavior changes. |
…anager) - Moved DenyAssignmentManagement from Authorization/ subfolder to directly under Microsoft.Authorization/ - Updated tspconfig.yaml output paths to still generate swagger in Authorization/ folder - Added suppression for operationId linter warning (backward compatibility) - TypeSpec Validation FolderStructure rule requires exactly 2 levels under resource-manager Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ures SDK Validation works from Autorest-generated Swagger, not direct TypeSpec SDK emitters. The SDK emitter configs were added by SdkTspConfigValidation but caused generation failures for Java and .NET. Removing them restores the working state where all 5 SDK Validations pass via Swagger-based generation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SdkTspConfigValidation requires Java/TS/Go/Python/C# emitter configs in tspconfig.yaml. Without them, TypeSpec Validation fails. Java and .NET SDK generation may still fail but the TypeSpec Validation check must pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add x-ms-examples for all 6 GET/List operations in 2024-07-01-preview swagger. TypeSpec requires example files with operationId in each version folder for the generated swagger to include x-ms-examples references. This fixes the ModelValidation CI check which reported: XMS_EXAMPLE_NOTFOUND_ERROR - x-ms-example not found in DenyAssignments_GetById New source files: - DenyAssignmentManagement/examples/2024-07-01-preview/Get*.json (6 files) Generated output changes: - authorization-DenyAssignmentCalls.json: added x-ms-examples to 6 operations - examples/Get*.json: added operationId and title fields Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pshao25
left a comment
There was a problem hiding this comment.
Under TypeSpec conversion. Please hold on.
|
Closing this PR — we've confirmed that a DenyAssignment-only TypeSpec can't produce a viable SDK. The Authorization SDK ships as a monolithic package (azure-mgmt-authorization) covering RoleAssignments, RoleDefinitions, DenyAssignments, Permissions, etc. A partial TypeSpec generates an incomplete package that can't be published. The correct path is PR #41617 (full Authorization TypeSpec conversion by @pshao25). We're coordinating directly with Pan Shao's team to help unblock that effort. This PR's learnings (folder structure, SDK emitter configs, example operationId requirements, label bypasses) are documented and will be useful when contributing to #41617. |
Summary
Adds TypeSpec definitions for the DenyAssignment sub-service under Microsoft.Authorization, covering:
CreateOrUpdateandDeleteoperations, plus theDenyAssignmentEffectenumContext
This is a focused TypeSpec addition for DenyAssignment operations. The corresponding Swagger spec was merged in PR #41104.
A broader Authorization TypeSpec migration is in progress in PR #41617 (wave 6 batch), but that PR has CI failures across all checks and may take time to resolve. This smaller, focused PR enables SDK generation for the deny assignment create/delete feature while the full migration progresses.
Changes
DenyAssignment.Management/main.tsp— Namespace definition with API versions (2022-04-01, 2024-07-01-preview)DenyAssignment.Management/DenyAssignment.tsp— All 8 operations (6 read + CreateOrUpdate + Delete)DenyAssignment.Management/models.tsp— DenyAssignmentProperties, DenyAssignmentPermission, DenyAssignmentEffect enumDenyAssignment.Management/back-compatible.tsp— Flatten property compatibilityDenyAssignment.Management/tspconfig.yaml— Autorest emitter configurationDenyAssignment.Management/examples/— Example files for both API versionsCommon/main.tsp— Shared types (Principal, PrincipalType, CloudError)Validation
Related