File tree Expand file tree Collapse file tree
src/ServiceControl.Transports.ASBS Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22{
33 using System ;
44 using System . Data . Common ;
5+ using Azure . Identity ;
56 using Azure . Messaging . ServiceBus ;
67
78 public static class ConnectionStringParser
Original file line number Diff line number Diff line change 1- namespace ServiceControl . Transports . ASBS
1+ #nullable enable
2+ namespace ServiceControl . Transports . ASBS
23{
34 using Azure . Core ;
45 using Azure . Identity ;
@@ -13,21 +14,17 @@ public TokenCredentialAuthentication(string fullyQualifiedNamespace)
1314 Credential = new DefaultAzureCredential ( ) ;
1415 }
1516
16- public TokenCredentialAuthentication ( string fullyQualifiedNamespace , string clientId )
17+ public TokenCredentialAuthentication ( string fullyQualifiedNamespace , string ? clientId )
1718 {
1819 FullyQualifiedNamespace = fullyQualifiedNamespace ;
19- ClientId = clientId ;
20- Credential = new ManagedIdentityCredential ( clientId ) ;
20+ Credential = new ManagedIdentityCredential ( clientId is not null ? ManagedIdentityId . FromUserAssignedClientId ( clientId ) : ManagedIdentityId . SystemAssigned ) ;
2121 }
2222
23- public string FullyQualifiedNamespace { get ; }
23+ string FullyQualifiedNamespace { get ; }
2424
2525 public TokenCredential Credential { get ; }
2626
27- public string ClientId { get ; }
28-
29- public override ServiceBusAdministrationClient BuildManagementClient ( )
30- => new ServiceBusAdministrationClient ( FullyQualifiedNamespace , Credential ) ;
27+ public override ServiceBusAdministrationClient BuildManagementClient ( ) => new ( FullyQualifiedNamespace , Credential ) ;
3128
3229 public override AzureServiceBusTransport CreateTransportDefinition ( ConnectionSettings connectionSettings , TopicTopology topology )
3330 {
You can’t perform that action at this time.
0 commit comments