To download a file from a blob storage, first you have to download the reference or assembly from the nuget package "Azure.Storage.Blobs". You also have to obtain the connection string from azure blob storage account private BlobServiceClient blobServiceClient = new BlobServiceClient(connectionString); var container = _blobServiceClient.GetBlobContainerClient(containerName); await container.CreateIfNotExistsAsync(Azure.Storage.Blobs.Models.PublicAccessType.BlobContainer); var blob = container.GetBlobClient("image.png"); await blob.DownloadToAsync("c:\users\documents\image.png");
In order to display the description of the parameter specified in the action. You have to enable xml generation in your project property and enable it in swagger option. services.AddSwaggerGen(swagger => { swagger.SwaggerDoc("v1", new OpenApiInfo { Title = "ArchiveOne WebApi", Version = "v1" }); var basePath = PlatformServices.Default.Application.ApplicationBasePath; foreach (var name in Directory.GetFiles(basePath, "*.XML", SearchOption.AllDirectories)) { swagger.IncludeXmlComments(name); } });
Comments
Post a Comment