Ejemplo n.º 1
0
        private static AzureClientFactoryBuilder AddBlobServiceClient(this AzureClientFactoryBuilder builder, IConfiguration configuration)
        {
            var blobStorageSettings = configuration.GetSection("BlobStorage").Get <BlobStorageSettings>();

            builder.AddBlobServiceClient(blobStorageSettings.ConnectionString);

            return(builder);
        }
Ejemplo n.º 2
0
 public static IAzureClientBuilder <QueueServiceClient, QueueClientOptions> AddQueueServiceClient(
     this AzureClientFactoryBuilder builder, string serviceUriOrConnectionString, bool preferMsi)
 {
     if (preferMsi && Uri.TryCreate(serviceUriOrConnectionString, UriKind.Absolute, out var serviceUri))
     {
         return(builder.AddQueueServiceClient(serviceUri));
     }
     return(builder.AddQueueServiceClient(serviceUriOrConnectionString));
 }
Ejemplo n.º 3
0
        private static AzureClientFactoryBuilder AddAzureEventGrid(this AzureClientFactoryBuilder builder, IConfiguration configuration)
        {
            var topicSettings = configuration.GetSection("Topics").Get <TopicSettings[]>();

            foreach (TopicSettings topicSetting in topicSettings)
            {
                // TODO: get 'key' from key vault
                builder
                .AddEventGridPublisherClient(new Uri(topicSetting.Uri), new AzureKeyCredential(topicSetting.Key))
                .WithName(topicSetting.Name);
            }

            return(builder);
        }
 public static IAzureClientBuilder <BlobServiceClient, BlobClientOptions> AddBlobServiceClient(this AzureClientFactoryBuilder builder, string serviceUriOrConnectionString, bool preferMsi)
 {
     if (preferMsi && Uri.TryCreate(serviceUriOrConnectionString, UriKind.Absolute, out Uri? serviceUri))
     {
         return(builder.AddBlobServiceClient(serviceUri));
     }
     else
     {
         return(builder.AddBlobServiceClient(serviceUriOrConnectionString));
     }
 }