Skip to content

Add DenyAssignment TypeSpec with 2024-07-01-preview CreateOrUpdate/Delete operations#42007

Closed
jruttle wants to merge 6 commits intoAzure:mainfrom
jruttle:jruttle/deny-assignment-typespec
Closed

Add DenyAssignment TypeSpec with 2024-07-01-preview CreateOrUpdate/Delete operations#42007
jruttle wants to merge 6 commits intoAzure:mainfrom
jruttle:jruttle/deny-assignment-typespec

Conversation

@jruttle
Copy link
Copy Markdown
Contributor

@jruttle jruttle commented Apr 1, 2026

Summary

Adds TypeSpec definitions for the DenyAssignment sub-service under Microsoft.Authorization, covering:

  • Stable 2022-04-01: Read-only operations (Get, List, ListForScope, ListForResourceGroup, ListForResource, GetById)
  • Preview 2024-07-01-preview: Adds CreateOrUpdate and Delete operations, plus the DenyAssignmentEffect enum

Context

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 enum
  • DenyAssignment.Management/back-compatible.tsp — Flatten property compatibility
  • DenyAssignment.Management/tspconfig.yaml — Autorest emitter configuration
  • DenyAssignment.Management/examples/ — Example files for both API versions
  • Common/main.tsp — Shared types (Principal, PrincipalType, CloudError)
  • Regenerated swagger for stable/2022-04-01 and preview/2024-07-01-preview from TypeSpec

Validation

  • TypeSpec compiles cleanly with zero errors (1 expected warning for operationId override)
  • Generated Swagger matches the existing hand-written spec (all 8 operations, correct response codes, matching operationIds)

Related

…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>
@github-actions github-actions bot added ARMReview resource-manager TypeSpec Authored with TypeSpec WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Apr 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Next Steps to Merge

Next steps that must be taken to merge this PR:
  • ❌ This PR targets either the main branch of the public specs repo or the RPSaaSMaster branch of the private specs repo. These branches are not intended for iterative development. Therefore, you must acknowledge you understand that after this PR is merged, the APIs are considered shipped to Azure customers. Any further attempts at in-place modifications to the APIs will be subject to Azure's versioning and breaking change policies. Additionally, for control plane APIs, you must acknowledge that you are following all the best practices documented by ARM at aka.ms/armapibestpractices. If you do intend to release the APIs to your customers by merging this PR, add the PublishToCustomers label to your PR in acknowledgement of the above. Otherwise, retarget this PR onto a feature branch, i.e. with prefix release- (see aka.ms/azsdk/api-versions#release--branches).
  • ❌ This PR is in purview of the ARM review (label: ARMReview). This PR must get ARMSignedOff label from an ARM reviewer.
    This PR is awaiting ARM reviewer feedback (label: WaitForARMFeedback).
    To learn when this PR will get reviewed, see ARM review queue at aka.ms/azsdk/pr-arm-review
    For details of the ARM review, see aka.ms/azsdk/pr-arm-review
  • ❌ The required check named Swagger LintDiff has failed. Refer to the check in the PR's 'Checks' tab for details on how to fix it and consult the aka.ms/ci-fix guide


Comment generated by summarize-checks workflow run.

@github-actions github-actions bot added BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required NotReadyForARMReview and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Apr 1, 2026
…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>
@jruttle jruttle added Approved-Avocado BreakingChange-Approved-Benign Changes are not breaking at the REST API level and have at most minor impact to generated SDKs. labels Apr 1, 2026
@github-actions github-actions bot added WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required and removed NotReadyForARMReview labels Apr 1, 2026
@jruttle
Copy link
Copy Markdown
Contributor Author

jruttle commented Apr 1, 2026

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:

  • AddedPath: New PUT/DELETE operations for deny assignments (additive — new preview API version)
  • DifferentStructure (1032): TypeSpec generates parameters inline vs \ — functionally equivalent
  • AddedRequiredProperty (1034): \�alue\ property on list response — standard ARM list pattern
  • RemovedClientParameter (1007): Parameters like \ScopeParameter, \FilterParameter\ etc. are now inline per TypeSpec conventions rather than top-level \ parameters — functionally identical

All changes are benign structural differences from the TypeSpec conversion, not breaking API behavior changes.

Jonathan Ruttle and others added 4 commits April 1, 2026 14:25
…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>
Copy link
Copy Markdown
Member

@pshao25 pshao25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under TypeSpec conversion. Please hold on.

@jruttle
Copy link
Copy Markdown
Contributor Author

jruttle commented Apr 2, 2026

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.

@jruttle jruttle closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved-Avocado ARMReview Authorization BreakingChange-Approved-Benign Changes are not breaking at the REST API level and have at most minor impact to generated SDKs. BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required resource-manager TypeSpec Authored with TypeSpec WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants