From 28bae8e9306d520390878e682292727ca7bba634 Mon Sep 17 00:00:00 2001 From: Martin Arndt <5111490+Eagle3386@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:16:59 +0200 Subject: [PATCH] Mark AzureAuthorityHosts.AzureGermany as Obsolete. (#46371) --- .../Azure.Identity/api/Azure.Identity.netstandard2.0.cs | 1 + sdk/identity/Azure.Identity/src/AzureAuthorityHosts.cs | 1 + .../Azure.Identity/tests/ManagedIdentityCredentialTests.cs | 1 - .../Azure.Identity/tests/TokenCredentialOptionsTests.cs | 2 +- 4 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/identity/Azure.Identity/api/Azure.Identity.netstandard2.0.cs b/sdk/identity/Azure.Identity/api/Azure.Identity.netstandard2.0.cs index 57b0740f6d9f..8592b1736eb4 100644 --- a/sdk/identity/Azure.Identity/api/Azure.Identity.netstandard2.0.cs +++ b/sdk/identity/Azure.Identity/api/Azure.Identity.netstandard2.0.cs @@ -46,6 +46,7 @@ public AuthorizationCodeCredentialOptions() { } public static partial class AzureAuthorityHosts { 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; } } public static System.Uri AzureGovernment { get { throw null; } } public static System.Uri AzurePublicCloud { get { throw null; } } diff --git a/sdk/identity/Azure.Identity/src/AzureAuthorityHosts.cs b/sdk/identity/Azure.Identity/src/AzureAuthorityHosts.cs index d831421ddd78..6567cbf63c07 100644 --- a/sdk/identity/Azure.Identity/src/AzureAuthorityHosts.cs +++ b/sdk/identity/Azure.Identity/src/AzureAuthorityHosts.cs @@ -27,6 +27,7 @@ public static class AzureAuthorityHosts /// /// The host of the Microsoft Entra authority for tenants in the Azure German Cloud. /// + [Obsolete("Microsoft Cloud Germany was closed on October 29th, 2021.")] public static Uri AzureGermany { get; } = new Uri(AzureGermanyHostUrl); /// diff --git a/sdk/identity/Azure.Identity/tests/ManagedIdentityCredentialTests.cs b/sdk/identity/Azure.Identity/tests/ManagedIdentityCredentialTests.cs index 5f600c5f3748..c2286530ddad 100644 --- a/sdk/identity/Azure.Identity/tests/ManagedIdentityCredentialTests.cs +++ b/sdk/identity/Azure.Identity/tests/ManagedIdentityCredentialTests.cs @@ -1113,7 +1113,6 @@ public static IEnumerable AuthorityHostValues() // params // az thrown Exception message, expected message, expected exception yield return new object[] { AzureAuthorityHosts.AzureChina }; - yield return new object[] { AzureAuthorityHosts.AzureGermany }; yield return new object[] { AzureAuthorityHosts.AzureGovernment }; yield return new object[] { AzureAuthorityHosts.AzurePublicCloud }; } diff --git a/sdk/identity/Azure.Identity/tests/TokenCredentialOptionsTests.cs b/sdk/identity/Azure.Identity/tests/TokenCredentialOptionsTests.cs index 31d5dfda9fec..49429ef7a989 100644 --- a/sdk/identity/Azure.Identity/tests/TokenCredentialOptionsTests.cs +++ b/sdk/identity/Azure.Identity/tests/TokenCredentialOptionsTests.cs @@ -57,7 +57,7 @@ public void EnvAuthorityHost() [Test] public void CustomAuthorityHost() { - string envHostValue = AzureAuthorityHosts.AzureGermany.ToString(); + string envHostValue = AzureAuthorityHosts.AzureGovernment.ToString(); using (new TestEnvVar("AZURE_AUTHORITY_HOST", envHostValue)) {