Skip to content

Add sovereign cloud support to AzureCloudInstance enum#5709

Open
Copilot wants to merge 2 commits intomainfrom
copilot/add-sovereign-cloud-examples
Open

Add sovereign cloud support to AzureCloudInstance enum#5709
Copilot wants to merge 2 commits intomainfrom
copilot/add-sovereign-cloud-examples

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 3, 2026

Changes proposed in this request

PR #5671 added instance discovery support for Bleu (France), Delos (Germany), and GovSG (Singapore) sovereign clouds, but the AzureCloudInstance enum was not updated to expose them.

This PR adds:

  • Three new enum values: AzureBleu, AzureDelos, AzureGovSG
  • URL mappings in AuthorityInfo.GetCloudUrl() for the new clouds
  • Test coverage for all authority audience combinations

Developers can now use the enum instead of hardcoding URLs:

// Before: had to use custom authority URL
var app = PublicClientApplicationBuilder.Create(clientId)
    .WithAuthority("https://login.sovcloud-identity.fr/tenantId/")
    .Build();

// After: use the enum
var app = PublicClientApplicationBuilder.Create(clientId)
    .WithAuthority(AzureCloudInstance.AzureBleu, tenantId)
    .Build();

Testing

Added 9 test cases covering all three new clouds with AzureAdMultipleOrgs, AzureAdAndPersonalMicrosoftAccount, and PersonalMicrosoftAccount audiences.

Performance impact

None. Changes are additive enum values and switch cases.

Documentation

  • All relevant documentation is updated.
Original prompt

This section details on the original issue you should resolve

<issue_title>[Documentation] Sovereign cloud usage examples and AzureCloudInstance enum</issue_title>
<issue_description>Documentation related to component
Authentication to sovereign clouds

Please check those that apply

  • typo
  • documentation doesn't exist
  • documentation needs clarification
  • error(s) in example
  • needs example

Description of the issue
In PR #5671, support for sovereign clouds (Bleu, Delos, GovSG) has been added to MSAL.Net.

It would be great to have a usage example on how to authenticate against these clouds.

I would also like to see how the Microsoft.Identity.Client.AzureCloudInstance enum is connected to this, as the enum does not yet contain any hint to the new sovereig clouds.
</issue_description>

<agent_instructions>Update the AzureCloudInstance enum</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@bgavrilMS bgavrilMS force-pushed the copilot/add-sovereign-cloud-examples branch from d72646f to a59c9a6 Compare March 19, 2026 20:27
@bgavrilMS bgavrilMS marked this pull request as ready for review March 19, 2026 20:28
@bgavrilMS bgavrilMS requested a review from a team as a code owner March 19, 2026 20:28
Copilot AI review requested due to automatic review settings March 19, 2026 20:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR exposes newly supported sovereign clouds (Bleu/France, Delos/Germany, GovSG/Singapore) through the public AzureCloudInstance enum and wires them into authority host resolution, with unit tests validating authority construction for common AAD audiences.

Changes:

  • Add AzureBleu, AzureDelos, and AzureGovSG to AzureCloudInstance.
  • Map the new enum values to their login hosts in AuthorityInfo.GetCloudUrl().
  • Extend PublicClientApplicationBuilderTests to cover the new clouds across multiple authority audiences.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/Microsoft.Identity.Test.Unit/AppConfigTests/PublicClientApplicationBuilderTests.cs Adds authority-construction test cases for the three new clouds across multiple audiences.
src/client/Microsoft.Identity.Client/AppConfig/AzureCloud.cs Extends the public AzureCloudInstance enum with three sovereign cloud values.
src/client/Microsoft.Identity.Client/AppConfig/AuthorityInfo.cs Adds URL mappings for the new enum values used when constructing AAD authorities.

Comment on lines +38 to +48
AzureBleu,

/// <summary>
/// Azure Delos sovereign cloud (Germany). Maps to https://login.sovcloud-identity.de
/// </summary>
AzureDelos,

/// <summary>
/// Azure GovSG sovereign cloud (Singapore). Maps to https://login.sovcloud-identity.sg
/// </summary>
AzureGovSG,
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

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

These new enum members are a public API surface change. The repo uses PublicApiAnalyzers with per-TFM API baselines; please add the new AzureCloudInstance members (AzureBleu=5, AzureDelos=6, AzureGovSG=7) to the corresponding src/client/Microsoft.Identity.Client/PublicApi/<tfm>/PublicAPI.Unshipped.txt files (or move to Shipped if appropriate), otherwise the public API analyzer will fail the build.

Suggested change
AzureBleu,
/// <summary>
/// Azure Delos sovereign cloud (Germany). Maps to https://login.sovcloud-identity.de
/// </summary>
AzureDelos,
/// <summary>
/// Azure GovSG sovereign cloud (Singapore). Maps to https://login.sovcloud-identity.sg
/// </summary>
AzureGovSG,
AzureBleu = 5,
/// <summary>
/// Azure Delos sovereign cloud (Germany). Maps to https://login.sovcloud-identity.de
/// </summary>
AzureDelos = 6,
/// <summary>
/// Azure GovSG sovereign cloud (Singapore). Maps to https://login.sovcloud-identity.sg
/// </summary>
AzureGovSG = 7,

Copilot uses AI. Check for mistakes.
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.

[Documentation] Sovereign cloud usage examples and AzureCloudInstance enum

3 participants