public AzureServiceTokenProviderCredentials(string tenantIdentity, string resourceIdentity, string clientIdentity) { if (string.IsNullOrWhiteSpace(_resourceIdentity)) { _resourceIdentity = "https://eventhubs.azure.net/"; } else { _resourceIdentity = resourceIdentity; } if (!string.IsNullOrWhiteSpace(tenantIdentity)) { _tenantIdentity = tenantIdentity; } if (string.IsNullOrWhiteSpace(clientIdentity)) { _tokenProvider = new Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProvider(); } else { _tokenProvider = new Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProvider($"RunAs=App;AppId={clientIdentity}"); } }