From 2b088b99cad8d97d74d419076eb26e5bed21adc7 Mon Sep 17 00:00:00 2001 From: Scott Addie <10702007+scottaddie@users.noreply.github.com> Date: Thu, 18 Jul 2024 11:03:20 -0500 Subject: [PATCH] Remove duplicate credential instantiation line in ACS Email README (#45076) --- sdk/communication/Azure.Communication.Email/README.md | 3 +-- .../tests/EmailClientLiveTestBase.cs | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sdk/communication/Azure.Communication.Email/README.md b/sdk/communication/Azure.Communication.Email/README.md index 7f26c6a9074a0..eb9264ea49764 100644 --- a/sdk/communication/Azure.Communication.Email/README.md +++ b/sdk/communication/Azure.Communication.Email/README.md @@ -38,8 +38,7 @@ Alternatively, Email clients can also be authenticated using a valid token crede ```C# Snippet:Azure_Communication_Email_CreateEmailClientWithToken string endpoint = ""; -TokenCredential tokenCredential = new DefaultAzureCredential(); -tokenCredential = new DefaultAzureCredential(); +var tokenCredential = new DefaultAzureCredential(); EmailClient emailClient = new EmailClient(new Uri(endpoint), tokenCredential); ``` ## Examples diff --git a/sdk/communication/Azure.Communication.Email/tests/EmailClientLiveTestBase.cs b/sdk/communication/Azure.Communication.Email/tests/EmailClientLiveTestBase.cs index ceb67ac889dd7..cb376d333e279 100644 --- a/sdk/communication/Azure.Communication.Email/tests/EmailClientLiveTestBase.cs +++ b/sdk/communication/Azure.Communication.Email/tests/EmailClientLiveTestBase.cs @@ -46,11 +46,10 @@ public EmailClient CreateSmsClientWithToken() } else { + tokenCredential = new DefaultAzureCredential(); #region Snippet:Azure_Communication_Email_CreateEmailClientWithToken //@@ string endpoint = ""; - //@@ TokenCredential tokenCredential = new DefaultAzureCredential(); - /*@@*/ - tokenCredential = new DefaultAzureCredential(); + //@@ var tokenCredential = new DefaultAzureCredential(); //@@ EmailClient emailClient = new EmailClient(new Uri(endpoint), tokenCredential); #endregion Snippet:Azure_Communication_Email_CreateEmailClientWithToken }