-
Notifications
You must be signed in to change notification settings - Fork 223
Add support for new sovereign cloud environments #1727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ public static void TestFixtureSetup(TestContext context) | |
|
|
||
| [TestMethod()] | ||
| [DataRow("https://bertonline.sharepoint.com/sites/prov-2", Microsoft365Environment.Production)] | ||
| [DataRow("https://bertonline.sharepoint.de/sites/prov-2", Microsoft365Environment.Germany)] | ||
| [DataRow("https://bertonline.sharepoint.de/sites/prov-2", Microsoft365Environment.DelosCloud)] | ||
| [DataRow("https://bertonline.sharepoint.cn/sites/prov-2", Microsoft365Environment.China)] | ||
| [DataRow("https://bertonline.sharepoint.us/sites/prov-2", Microsoft365Environment.USGovernment)] | ||
| [DataRow("https://bertonline.sharepoint.oops/sites/prov-2", Microsoft365Environment.Production)] | ||
|
|
@@ -33,11 +33,13 @@ public void UriToMicrosoft365Environment(string url, Microsoft365Environment exp | |
| [TestMethod()] | ||
| [DataRow("graph.microsoft.com", Microsoft365Environment.Production)] | ||
| [DataRow("graph.microsoft.com", Microsoft365Environment.PreProduction)] | ||
| [DataRow("graph.microsoft.com", Microsoft365Environment.USGovernment)] | ||
| [DataRow("graph.microsoft.de", Microsoft365Environment.Germany)] | ||
| [DataRow("graph.microsoft.com", Microsoft365Environment.USGovernment)] | ||
| [DataRow("microsoftgraph.chinacloudapi.cn", Microsoft365Environment.China)] | ||
| [DataRow("graph.microsoft.us", Microsoft365Environment.USGovernmentHigh)] | ||
| [DataRow("dod-graph.microsoft.us", Microsoft365Environment.USGovernmentDoD)] | ||
| [DataRow("graph.svc.sovcloud.fr", Microsoft365Environment.BleuCloud)] | ||
| [DataRow("graph.svc.sovcloud.de", Microsoft365Environment.DelosCloud)] | ||
| [DataRow("graph.svc.sovcloud.sg", Microsoft365Environment.GovSGCloud)] | ||
| public void Microsoft365EnvironmentToGraph(string graph, Microsoft365Environment env) | ||
| { | ||
| Assert.AreEqual(graph, CloudManager.GetMicrosoftGraphAuthority(env)); | ||
|
|
@@ -46,11 +48,13 @@ public void Microsoft365EnvironmentToGraph(string graph, Microsoft365Environment | |
| [TestMethod()] | ||
| [DataRow("login.microsoftonline.com", Microsoft365Environment.Production)] | ||
| [DataRow("login.windows-ppe.net", Microsoft365Environment.PreProduction)] | ||
| [DataRow("login.microsoftonline.com", Microsoft365Environment.USGovernment)] | ||
| [DataRow("login.microsoftonline.de", Microsoft365Environment.Germany)] | ||
| [DataRow("login.microsoftonline.com", Microsoft365Environment.USGovernment)] | ||
| [DataRow("login.chinacloudapi.cn", Microsoft365Environment.China)] | ||
| [DataRow("login.microsoftonline.us", Microsoft365Environment.USGovernmentHigh)] | ||
| [DataRow("login.microsoftonline.us", Microsoft365Environment.USGovernmentDoD)] | ||
| [DataRow("login.sovcloud-identity.fr", Microsoft365Environment.BleuCloud)] | ||
| [DataRow("login.sovcloud-identity.de", Microsoft365Environment.DelosCloud)] | ||
| [DataRow("login.sovcloud-identity.sg", Microsoft365Environment.GovSGCloud)] | ||
| public void Microsoft365EnvironmentToAzureADLogin(string azureADLogin, Microsoft365Environment env) | ||
| { | ||
| Assert.AreEqual(azureADLogin, CloudManager.GetAzureADLoginAuthority(env)); | ||
|
|
@@ -73,10 +77,7 @@ public async Task Microsoft365EnvironmentToGraphUri() | |
| Assert.AreEqual(CloudManager.GetGraphBaseUri(context), new Uri($"https://graph.microsoft.com")); | ||
|
|
||
| context.Environment = Microsoft365Environment.USGovernment; | ||
| Assert.AreEqual(CloudManager.GetGraphBaseUri(context), new Uri($"https://graph.microsoft.com")); | ||
|
|
||
| context.Environment = Microsoft365Environment.Germany; | ||
| Assert.AreEqual(CloudManager.GetGraphBaseUri(context), new Uri($"https://graph.microsoft.de")); | ||
| Assert.AreEqual(CloudManager.GetGraphBaseUri(context), new Uri($"https://graph.microsoft.com")); | ||
|
|
||
| context.Environment = Microsoft365Environment.China; | ||
| Assert.AreEqual(CloudManager.GetGraphBaseUri(context), new Uri($"https://microsoftgraph.chinacloudapi.cn")); | ||
|
Comment on lines
+73
to
83
|
||
|
|
@@ -87,6 +88,15 @@ public async Task Microsoft365EnvironmentToGraphUri() | |
| context.Environment = Microsoft365Environment.USGovernmentDoD; | ||
| Assert.AreEqual(CloudManager.GetGraphBaseUri(context), new Uri($"https://dod-graph.microsoft.us")); | ||
|
|
||
| context.Environment = Microsoft365Environment.BleuCloud; | ||
| Assert.AreEqual(CloudManager.GetGraphBaseUri(context), new Uri($"https://graph.svc.sovcloud.fr")); | ||
|
|
||
| context.Environment = Microsoft365Environment.DelosCloud; | ||
| Assert.AreEqual(CloudManager.GetGraphBaseUri(context), new Uri($"https://graph.svc.sovcloud.de")); | ||
|
|
||
| context.Environment = Microsoft365Environment.GovSGCloud; | ||
| Assert.AreEqual(CloudManager.GetGraphBaseUri(context), new Uri($"https://graph.svc.sovcloud.sg")); | ||
|
|
||
| context.Environment = Microsoft365Environment.Custom; | ||
| context.MicrosoftGraphAuthority = "graph.microsoft.be"; | ||
| Assert.AreEqual(CloudManager.GetGraphBaseUri(context), new Uri($"https://graph.microsoft.be")); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,8 +12,10 @@ internal static Microsoft365Environment GetEnvironmentFromUri(Uri url) | |||||
| { | ||||||
| "com" => Microsoft365Environment.Production, | ||||||
| "us" => Microsoft365Environment.USGovernment, | ||||||
| "de" => Microsoft365Environment.Germany, | ||||||
| "de" => Microsoft365Environment.DelosCloud, | ||||||
|
||||||
| "de" => Microsoft365Environment.DelosCloud, | |
| "de" => Microsoft365Environment.Germany, |
Copilot
AI
Feb 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Microsoft365Environment.Germany is still a valid enum value, but GetMicrosoftGraphAuthority no longer has a case for it, so it will fall back to the production authority. If Germany is still supported, add an explicit mapping (and keep/adjust tests). If it’s intentionally retired, consider marking the enum value [Obsolete] (or removing it in a major version) to avoid surprising behavior.
Copilot
AI
Feb 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Microsoft365Environment.Germany is still present in the enum, but GetAzureADLoginAuthority no longer maps it and will default to login.microsoftonline.com. If Germany is still a supported environment, add the missing mapping (and tests). If it’s deprecated, mark it as such so callers don’t unknowingly authenticate against the wrong authority.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests were updated to remove
Germanycoverage and replace.dewithDelosCloud. SinceMicrosoft365Environment.Germanystill exists, this leaves its authority/base-URI behavior untested (and currently it falls back to production due to missing mappings). Either restore tests forGermanyor remove/deprecate the enum value so the supported surface matches the test suite.