Skip to content

Network 2025-07-01: regenerate SDK with autorest directives (replaces shim commits)#29709

Open
santoshgh317 wants to merge 2 commits into
Azure:release-network-2025-07-01from
santoshgh317:Vslokar/release-network-2025-07-01-backup
Open

Network 2025-07-01: regenerate SDK with autorest directives (replaces shim commits)#29709
santoshgh317 wants to merge 2 commits into
Azure:release-network-2025-07-01from
santoshgh317:Vslokar/release-network-2025-07-01-backup

Conversation

@santoshgh317
Copy link
Copy Markdown
Contributor

Description

Fixes the persistent build failures on the release-network-2025-07-01 branch (PR #29635) by regenerating the Az.Network Management SDK with a corrected README.md that includes autorest directives addressing the underlying spec-level issues. This replaces the prior shim commits (header rename, CommonCloudError stubs) which were treating symptoms rather than the cause.

Root cause

The 2025-07-01 Microsoft.Network spec has structural issues that confuse @autorest/powershell unless they are explicitly worked around via directives:

  • LRO response headers (Location, Retry-After, Azure-AsyncOperation) on 201/202 produced header-type drift between operations and customizations
  • Redundant tags on DdosProtectionPlan collided with the inherited Common.TrackedResource property
  • Common.CloudError needed a clean public name (CloudError)
  • x-ms-azure-resource had to be relocated to CommonResource / Common.SubResource so the inheritance chain resolves correctly (otherwise SubResource constructors lose their arity, producing CS1729)
  • The original README was missing common.json and networkSecurityPerimeter.json from the input list and pointed at a non-existent spec path (Microsoft.Network/stable/... instead of Microsoft.Network/Network/stable/...)

Changes

  • src/Network/Network.Management.Sdk/README.md — rewritten with the full 16-file input list, spec commit 587a15661041e26ff8a3059a4886ff9e092adfda, and the directive block described above
  • src/Network/Network.Management.Sdk/Generated/ — full regeneration (1673 files) with @autorest/powershell@4.x (4.0.754) + @autorest/modelerfour 4.26.2
  • src/Network/Network.Management.Sdk/Customizations/ConnectionMonitorOperation.cs — patched 4 lines: Client.SubscriptionId is now a System.Guid (not string), so we use the same SafeJsonConvert idiom that the generator emits

Validation

Build succeeded.
    0 Warning(s)
    0 Error(s)
```n
For comparison, the prior state of this branch had **104 build errors** (84 CS1729 + 10 CS1503 + 10 CS0029).

## Notes

- The autorest PreCheck warnings (`PropertyRedeclarationWarning` x6, `DeduplicateName: CommonResource → CommonResourceAutoGenerated`) still appear during generation but are non-fatal — autorest handles them internally and the generated code compiles cleanly.
- Directive set was supplied by xiaogang.

Apply autorest directives (from xiaogang) to address spec-level issues:

- Strip LRO response headers (Location, Retry-After, Azure-AsyncOperation) from 201/202 to prevent header drift

- Remove redundant 'tags' on DdosProtectionPlan

- Rename Common.CloudError -> CloudError via x-ms-client-name

- Move x-ms-azure-resource from CommonProxyResource/CommonTrackedResource and SecurityPerimeter* variants down to CommonResource and Common.SubResource pairs

- Use spec commit 587a15661041e26ff8a3059a4886ff9e092adfda with full 16-file input set (including common.json and networkSecurityPerimeter.json)

Patch hand-written Customizations/ConnectionMonitorOperation.cs to use the same SafeJsonConvert idiom the generator now emits for the Guid SubscriptionId (fixes 4 CS1503 errors).

Result: build succeeds with 0 errors / 0 warnings, replacing the prior shim commits.
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

@thomas-temby
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

- Add wildcard x-ms-client-name directive in README.md to strip the 'Common.' prefix from all swagger definitions so generated C# classes keep their legacy names (RouteTable, SubResource, NetworkInterface, etc.), unblocking the handwritten Az.Network layer.
- Add directive to delete 'format: uuid' on the subscriptionId parameter so NetworkManagementClient.SubscriptionId regenerates as string (was System.Guid in 2025-07-01).
- Update final rename directive: the legacy ManagedServiceIdentityUserAssignedIdentities generated name is now retargeted to ManagedServiceIdentityUserAssignedIdentitiesValue.
- Regenerate Network.Management.Sdk via autorest --use:@autorest/powershell@4.x.
- Compatibility workaround for TypeSpec/common prefix drift; remove once the source spec drops the 'Common.' prefix.
@thomas-temby
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

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