Skip to content

[Python] TypeSpec migration for azure-mgmt-network#45896

Draft
msyyc wants to merge 11 commits intoAzure:mainfrom
msyyc:sdk-azure-mgmt-network
Draft

[Python] TypeSpec migration for azure-mgmt-network#45896
msyyc wants to merge 11 commits intoAzure:mainfrom
msyyc:sdk-azure-mgmt-network

Conversation

@msyyc
Copy link
Member

@msyyc msyyc commented Mar 25, 2026

[Python] TypeSpec migration for azure-mgmt-network

Spec Source

Spec PR: Azure/azure-rest-api-specs#40226

Pre-migration Swagger

specification/network/resource-manager/Microsoft.Network/Network@56166c71

Swagger API Version

Swagger API version: 2025-05-01 (default tag: package-2025-05-01)

Breaking Change Analysis

1120 breaking changes detected — ALL classified as ACCEPT

No mitigations required. All changes are expected outcomes of the TypeSpec migration.

Category Count Classification Rationale
Instance variables moved behind properties bag (un-flattening) 1067 ACCEPT Expected TypeSpec behavior — ARM resource properties correctly nested under properties (§11)
Enum values deleted (ProvisioningState.CANCELED, .CREATING) 2 ACCEPT Values available in ResourceProvisioningState (renamed NetworkResourceProvisioningState for Python); unions include string base type
Pagination/list models removed 37 ACCEPT TypeSpec uses generic Azure.Core.Page<T> paging (§8)
Enum-to-union type conversions 6 ACCEPT Same names and values, different type representation
Common/unreferenced/internal types removed 8 ACCEPT ARM common types, internal async models, auto-generated names (§6/§7)

Compiler Fix Applied

A @@clientName(Microsoft.Network.ResourceProvisioningState, "NetworkResourceProvisioningState", "python") decorator was added to client.tsp to resolve a duplicate-client-name compiler error (conflicts with Azure.ResourceManager.ResourceProvisioningState).

Spec Mitigation PR

mcgallan/azure-rest-api-specs#2

Accepted Breaking Changes Summary

The following breaking changes will remain in the migrated SDK:

  1. Un-flattening (1067 items): Properties previously flattened directly onto models are now accessed via .properties.*. This is the correct ARM resource structure. Example: gateway.provisioning_stategateway.properties.provisioning_state.

  2. Enum values (2 items): ProvisioningState.CANCELED and ProvisioningState.CREATING removed from ProvisioningState enum but available in NetworkResourceProvisioningState and as string literals.

  3. Deleted models (51 items): Pagination wrappers (37), enum-to-union conversions (6), internal/common types (8). These are expected TypeSpec migration artifacts with low customer impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants