diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 9e9155baad88..6b2573fd0ab9 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -70,6 +70,7 @@ "apos", "azsdk", "blazor", + "bleu", "byok", "centralus", "clippy", @@ -166,6 +167,7 @@ "skus", "somaxconn", "southcentralus", + "sovcloud", "structs", "sybase", "sysctls", diff --git a/sdk/core/Azure.Core/CHANGELOG.md b/sdk/core/Azure.Core/CHANGELOG.md index dfe7e72274c2..3bb4d6f1f578 100644 --- a/sdk/core/Azure.Core/CHANGELOG.md +++ b/sdk/core/Azure.Core/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Added `AzureAuthorityHosts.AzureBleuCloud` (`https://login.sovcloud-identity.fr/`), the Microsoft Entra authority host for Bleu Cloud, the national partner cloud for France. Interactive credentials' `Authenticate` methods now also resolve the default Azure Resource Manager scope for Bleu Cloud. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/core/Azure.Core/api/Azure.Core.net10.0.cs b/sdk/core/Azure.Core/api/Azure.Core.net10.0.cs index a8b5b86c4daa..157ad18aa4af 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net10.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net10.0.cs @@ -1254,6 +1254,7 @@ public AuthorizationCodeCredentialOptions() { } [System.Runtime.CompilerServices.TypeForwardedFromAttribute("Azure.Identity, Version=1.0.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8")] public static partial class AzureAuthorityHosts { + public static System.Uri AzureBleuCloud { get { throw null; } } public static System.Uri AzureChina { get { throw null; } } [System.ObsoleteAttribute("Microsoft Cloud Germany was closed on October 29th, 2021.")] public static System.Uri AzureGermany { get { throw null; } } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net462.cs b/sdk/core/Azure.Core/api/Azure.Core.net462.cs index 55d04a3179f0..d32d3effcb6c 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net462.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net462.cs @@ -1228,6 +1228,7 @@ public AuthorizationCodeCredentialOptions() { } [System.Runtime.CompilerServices.TypeForwardedFromAttribute("Azure.Identity, Version=1.0.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8")] public static partial class AzureAuthorityHosts { + public static System.Uri AzureBleuCloud { get { throw null; } } public static System.Uri AzureChina { get { throw null; } } [System.ObsoleteAttribute("Microsoft Cloud Germany was closed on October 29th, 2021.")] public static System.Uri AzureGermany { get { throw null; } } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net472.cs b/sdk/core/Azure.Core/api/Azure.Core.net472.cs index 55d04a3179f0..d32d3effcb6c 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net472.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net472.cs @@ -1228,6 +1228,7 @@ public AuthorizationCodeCredentialOptions() { } [System.Runtime.CompilerServices.TypeForwardedFromAttribute("Azure.Identity, Version=1.0.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8")] public static partial class AzureAuthorityHosts { + public static System.Uri AzureBleuCloud { get { throw null; } } public static System.Uri AzureChina { get { throw null; } } [System.ObsoleteAttribute("Microsoft Cloud Germany was closed on October 29th, 2021.")] public static System.Uri AzureGermany { get { throw null; } } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net8.0.cs b/sdk/core/Azure.Core/api/Azure.Core.net8.0.cs index a8b5b86c4daa..157ad18aa4af 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net8.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net8.0.cs @@ -1254,6 +1254,7 @@ public AuthorizationCodeCredentialOptions() { } [System.Runtime.CompilerServices.TypeForwardedFromAttribute("Azure.Identity, Version=1.0.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8")] public static partial class AzureAuthorityHosts { + public static System.Uri AzureBleuCloud { get { throw null; } } public static System.Uri AzureChina { get { throw null; } } [System.ObsoleteAttribute("Microsoft Cloud Germany was closed on October 29th, 2021.")] public static System.Uri AzureGermany { get { throw null; } } diff --git a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs index 55d04a3179f0..d32d3effcb6c 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs @@ -1228,6 +1228,7 @@ public AuthorizationCodeCredentialOptions() { } [System.Runtime.CompilerServices.TypeForwardedFromAttribute("Azure.Identity, Version=1.0.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8")] public static partial class AzureAuthorityHosts { + public static System.Uri AzureBleuCloud { get { throw null; } } public static System.Uri AzureChina { get { throw null; } } [System.ObsoleteAttribute("Microsoft Cloud Germany was closed on October 29th, 2021.")] public static System.Uri AzureGermany { get { throw null; } } diff --git a/sdk/core/Azure.Core/src/Identity/AzureAuthorityHosts.cs b/sdk/core/Azure.Core/src/Identity/AzureAuthorityHosts.cs index c79f0d024e47..b579ef3be272 100644 --- a/sdk/core/Azure.Core/src/Identity/AzureAuthorityHosts.cs +++ b/sdk/core/Azure.Core/src/Identity/AzureAuthorityHosts.cs @@ -16,6 +16,7 @@ namespace Azure.Identity public static class AzureAuthorityHosts { private const string AzurePublicCloudHostUrl = "https://login.microsoftonline.com/"; + private const string AzureBleuCloudHostUrl = "https://login.sovcloud-identity.fr/"; private const string AzureChinaHostUrl = "https://login.chinacloudapi.cn/"; private const string AzureGermanyHostUrl = "https://login.microsoftonline.de/"; private const string AzureGovernmentHostUrl = "https://login.microsoftonline.us/"; @@ -24,6 +25,11 @@ public static class AzureAuthorityHosts /// public static Uri AzurePublicCloud { get; } = new Uri(AzurePublicCloudHostUrl); + /// + /// The host of the Microsoft Entra authority for tenants in Bleu Cloud, the national partner cloud for France. + /// + public static Uri AzureBleuCloud { get; } = new Uri(AzureBleuCloudHostUrl); + /// /// The host of the Microsoft Entra authority for tenants in the Azure China Cloud. /// @@ -57,6 +63,9 @@ internal static string GetDefaultScope(Uri authorityHost) case AzurePublicCloudHostUrl: // The double slash is intentional for public cloud. return "https://management.azure.com//.default"; + case AzureBleuCloudHostUrl: + // The double slash is intentional for Bleu Cloud. + return "https://management.sovcloud-api.fr//.default"; case AzureChinaHostUrl: return "https://management.chinacloudapi.cn/.default"; case AzureGermanyHostUrl: diff --git a/sdk/core/Azure.Core/tests/Identity/AzureAuthorityHostsTests.cs b/sdk/core/Azure.Core/tests/Identity/AzureAuthorityHostsTests.cs new file mode 100644 index 000000000000..fa9340ddc96b --- /dev/null +++ b/sdk/core/Azure.Core/tests/Identity/AzureAuthorityHostsTests.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Core.Tests.Identity +{ + public class AzureAuthorityHostsTests + { + [Test] + public void WellKnownAuthorityHostsHaveExpectedValues() + { + Assert.AreEqual(new Uri("https://login.microsoftonline.com/"), AzureAuthorityHosts.AzurePublicCloud); + Assert.AreEqual(new Uri("https://login.sovcloud-identity.fr/"), AzureAuthorityHosts.AzureBleuCloud); + Assert.AreEqual(new Uri("https://login.chinacloudapi.cn/"), AzureAuthorityHosts.AzureChina); + Assert.AreEqual(new Uri("https://login.microsoftonline.us/"), AzureAuthorityHosts.AzureGovernment); + } + + [Test] + public void GetDefaultScopeReturnsExpectedScopeForKnownAuthorityHosts() + { + Assert.AreEqual("https://management.azure.com//.default", AzureAuthorityHosts.GetDefaultScope(AzureAuthorityHosts.AzurePublicCloud)); + Assert.AreEqual("https://management.sovcloud-api.fr//.default", AzureAuthorityHosts.GetDefaultScope(AzureAuthorityHosts.AzureBleuCloud)); + Assert.AreEqual("https://management.chinacloudapi.cn/.default", AzureAuthorityHosts.GetDefaultScope(AzureAuthorityHosts.AzureChina)); + Assert.AreEqual("https://management.usgovcloudapi.net/.default", AzureAuthorityHosts.GetDefaultScope(AzureAuthorityHosts.AzureGovernment)); + Assert.IsNull(AzureAuthorityHosts.GetDefaultScope(new Uri("https://login.contoso.com/"))); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md b/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md index a71c8eefec9f..86682b965349 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md +++ b/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Added `ArmEnvironment.AzureBleuCloud` (`https://management.sovcloud-api.fr`) for Bleu Cloud, the national partner cloud for France. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.net10.0.cs b/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.net10.0.cs index 322db429c894..5ad8caaad89a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.net10.0.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.net10.0.cs @@ -82,6 +82,7 @@ protected ArmCollection(Azure.ResourceManager.ArmClient client, Azure.Core.Resou { private readonly object _dummy; private readonly int _dummyPrimitive; + public static readonly Azure.ResourceManager.ArmEnvironment AzureBleuCloud; public static readonly Azure.ResourceManager.ArmEnvironment AzureChina; public static readonly Azure.ResourceManager.ArmEnvironment AzureGermany; public static readonly Azure.ResourceManager.ArmEnvironment AzureGovernment; diff --git a/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.net8.0.cs b/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.net8.0.cs index 322db429c894..5ad8caaad89a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.net8.0.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.net8.0.cs @@ -82,6 +82,7 @@ protected ArmCollection(Azure.ResourceManager.ArmClient client, Azure.Core.Resou { private readonly object _dummy; private readonly int _dummyPrimitive; + public static readonly Azure.ResourceManager.ArmEnvironment AzureBleuCloud; public static readonly Azure.ResourceManager.ArmEnvironment AzureChina; public static readonly Azure.ResourceManager.ArmEnvironment AzureGermany; public static readonly Azure.ResourceManager.ArmEnvironment AzureGovernment; diff --git a/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs b/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs index 7b7544951574..9ecf0c7663c6 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs @@ -79,6 +79,7 @@ protected ArmCollection(Azure.ResourceManager.ArmClient client, Azure.Core.Resou { private readonly object _dummy; private readonly int _dummyPrimitive; + public static readonly Azure.ResourceManager.ArmEnvironment AzureBleuCloud; public static readonly Azure.ResourceManager.ArmEnvironment AzureChina; public static readonly Azure.ResourceManager.ArmEnvironment AzureGermany; public static readonly Azure.ResourceManager.ArmEnvironment AzureGovernment; diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ArmEnvironment.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ArmEnvironment.cs index 5d9aa409ce24..1ea3fd06ac04 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ArmEnvironment.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ArmEnvironment.cs @@ -17,6 +17,9 @@ namespace Azure.ResourceManager /// Azure Public Cloud. public static readonly ArmEnvironment AzurePublicCloud = new(new Uri("https://management.azure.com"), "https://management.azure.com/"); + /// Bleu Cloud, the national partner cloud for France. + public static readonly ArmEnvironment AzureBleuCloud = new(new Uri("https://management.sovcloud-api.fr"), "https://management.sovcloud-api.fr/"); + /// Azure China Cloud. public static readonly ArmEnvironment AzureChina = new(new Uri("https://management.chinacloudapi.cn"), "https://management.chinacloudapi.cn"); diff --git a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/ArmEnvironmentTests.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/ArmEnvironmentTests.cs index 5962f565a360..337ec27356e5 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/ArmEnvironmentTests.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/ArmEnvironmentTests.cs @@ -37,6 +37,7 @@ public void DefaultValueIsNull() public void DefaultScope() { Assert.AreEqual("https://management.azure.com//.default", ArmEnvironment.AzurePublicCloud.DefaultScope); + Assert.AreEqual("https://management.sovcloud-api.fr//.default", ArmEnvironment.AzureBleuCloud.DefaultScope); Assert.AreEqual("https://management.chinacloudapi.cn/.default", ArmEnvironment.AzureChina.DefaultScope); Assert.AreEqual("https://management.usgovcloudapi.net/.default", ArmEnvironment.AzureGovernment.DefaultScope); Assert.AreEqual("https://management.microsoftazure.de/.default", ArmEnvironment.AzureGermany.DefaultScope);