Add the cloudSetting option for ARM Modular SDK#3233
Merged
MaryGao merged 35 commits intoAzure:mainfrom Jul 16, 2025
Merged
Conversation
MaryGao
commented
Jun 3, 2025
...ics.Management/generated/typespec-ts/sdk/test/arm-test/src/api/networkAnalyticsApiContext.ts
Show resolved
Hide resolved
MaryGao
commented
Jun 3, 2025
...ics.Management/generated/typespec-ts/sdk/test/arm-test/src/api/networkAnalyticsApiContext.ts
Outdated
Show resolved
Hide resolved
MaryGao
commented
Jun 3, 2025
...ics.Management/generated/typespec-ts/sdk/test/arm-test/src/api/networkAnalyticsApiContext.ts
Outdated
Show resolved
Hide resolved
MaryGao
commented
Jun 23, 2025
packages/typespec-test/test/ai/generated/typespec-ts/src/index.ts
Outdated
Show resolved
Hide resolved
MaryGao
commented
Jun 23, 2025
...lytics.Management/generated/typespec-ts/sdk/test/arm-test/review/arm-networkanalytics.api.md
Outdated
Show resolved
Hide resolved
7c43cac to
ed48054
Compare
lirenhe
reviewed
Jun 23, 2025
...lytics.Management/generated/typespec-ts/sdk/test/arm-test/review/arm-networkanalytics.api.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
qiaozha
reviewed
Jun 24, 2025
packages/typespec-test/test/ai/generated/typespec-ts/src/index.ts
Outdated
Show resolved
Hide resolved
MaryGao
commented
Jul 15, 2025
packages/typespec-test/test/ai/generated/typespec-ts/src/index.ts
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds multi-cloud support for Azure ARM Modular SDK clients, enabling them to connect to different Azure cloud environments (Public, China, US Government). The implementation includes a new AzureClouds enum and cloud-specific endpoint resolution logic.
Key changes:
- Added
AzureCloudsenum with predefined cloud environment values and endpoint mapping function - Updated client options interface to include optional
cloudSettingparameter for ARM clients - Modified endpoint resolution logic to use cloud-specific endpoints when
cloudSettingis provided
Reviewed Changes
Copilot reviewed 8 out of 32 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/typespec-ts/static/static-helpers/cloudSettingHelpers.ts | New helper file defining AzureClouds enum and getArmEndpoint function for cloud endpoint resolution |
| packages/typespec-ts/src/modular/static-helpers-metadata.ts | Added metadata definitions for cloud setting helpers |
| packages/typespec-ts/src/modular/helpers/clientHelpers.ts | Updated endpoint parameter building to support cloud setting fallback for ARM clients |
| packages/typespec-ts/src/modular/buildRootIndex.ts | Added export logic for AzureClouds enum and refactored export helper functions |
| packages/typespec-ts/src/modular/buildClientContext.ts | Added cloudSetting property to ARM client options and parameter name conflict detection |
| packages/typespec-ts/src/lib.ts | Added new diagnostic for parameter name conflicts |
| packages/typespec-ts/src/index.ts | Registered CloudSettingHelpers in the static helpers collection |
| packages/typespec-ts/src/framework/load-static-helpers.ts | Extended framework to support enum declarations in static helpers |
packages/typespec-ts/static/static-helpers/cloudSettingHelpers.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cloudSetting option for ARM Modular SDK
xirzec
approved these changes
Jul 15, 2025
Member
xirzec
left a comment
There was a problem hiding this comment.
Small comments on the generated code, only one that I feel strongly about is fixing the error message.
...lytics.Management/generated/typespec-ts/sdk/test/arm-test/review/arm-networkanalytics.api.md
Outdated
Show resolved
Hide resolved
...Management/generated/typespec-ts/sdk/test/arm-test/src/static-helpers/cloudSettingHelpers.ts
Outdated
Show resolved
Hide resolved
...Management/generated/typespec-ts/sdk/test/arm-test/src/static-helpers/cloudSettingHelpers.ts
Outdated
Show resolved
Hide resolved
…ted/typespec-ts/sdk/test/arm-test/src/static-helpers/cloudSettingHelpers.ts Co-authored-by: Jeff Fisher <xirzec@xirzec.com>
…ted/typespec-ts/sdk/test/arm-test/src/static-helpers/cloudSettingHelpers.ts Co-authored-by: Jeff Fisher <xirzec@xirzec.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #3188
This PR adds multi-cloud support for MPG, enabling generated clients to connect to different Azure cloud environments.
Changes made:
AzureCloudsfixed enum with values for different cloud environments (Public, China, US Government)cloudSettingparameter in client optionsNow users can specify which Azure cloud environment to connect to when creating a client: