Azure Storage grain persistence

The Azure Storage grain persistence provider supports both Azure Blob Storage and Azure Table Storage.

Install Azure Table Storage

Install the Microsoft.Orleans.Persistence.AzureStorage package from NuGet. The Azure Table Storage provider stores state in a table row, splitting the state over multiple columns if the limits of a single column are exceeded. Each row can hold a maximum length of 1 megabyte, as imposed by Azure Table Storage.

Configure the Azure Table Storage grain persistence provider using the AzureTableSiloBuilderExtensions.AddAzureTableGrainStorage extension methods.

siloBuilder.AddAzureTableGrainStorage(
    name: "profileStore",
    configureOptions: options =>
    {
        options.ConfigureTableServiceClient(
            "DefaultEndpointsProtocol=https;AccountName=data1;AccountKey=SOMETHING1");
    });

Install Azure Blob Storage

The Azure Blob Storage provider stores state in a blob.

Configure the Azure Blob Storage grain persistence provider using the AzureBlobSiloBuilderExtensions.AddAzureBlobGrainStorage extension methods.

siloBuilder.AddAzureBlobGrainStorage(
    name: "profileStore",
    configureOptions: options =>
    {
        options.ConfigureBlobServiceClient(
             "DefaultEndpointsProtocol=https;AccountName=data1;AccountKey=SOMETHING1");
    });