Add Azure BLOB provider to your .NET Core application
1 min
Install EPiserver.Azure package that has the extension methods on IServiceCollection interface. See also Create and deploy a CMS site.
The following example shows how to use and add Azure BLOB provider in the application:
using EPiServer.ServiceLocation;
using Microsoft.Extensions.DependencyInjection;
using System;
namespace SampleBlob
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddAzureBlobProvider("Azure", o =>
{
o.ConnectionString = "YOUR_AZURE_STORAGE_CONNECTION_STRING"; // <-- Needs to be a string literal
o.ContainerName = "YOUR_CONTAINER_NAME"; // <-- Needs to be a string literal
});
}
}
}Replace "YOUR_AZURE_STORAGE_CONNECTION_STRING" and "YOUR_CONTAINER_NAME" with your actual Azure storage connection string and container name, respectively.