Skip to content

Commit a9c661d

Browse files
committed
Use chained credentials for Azure Event Grid.
1 parent 53d64ff commit a9c661d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dotnet/src/dotnetcore/Providers/Messaging/GXAzureEventGrid/AzureEventGrid.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ private void Initialize(GXService providerService)
4343
else
4444
//Try authenticating using AD
4545
{
46+
ChainedTokenCredential credential = new ChainedTokenCredential(new ManagedIdentityCredential(), new ManagedIdentityCredential(Environment.GetEnvironmentVariable("AZURE_CLIENT_ID")), new EnvironmentCredential(), new AzureCliCredential());
4647
GXLogging.Debug(logger,"Authentication using Oauth 2.0.");
4748
_client = new EventGridPublisherClient(
4849
new Uri(_endpoint),
49-
new DefaultAzureCredential());
50+
credential);
5051
}
5152
}
5253
else

0 commit comments

Comments
 (0)