Azure Blob Storage saves message bodies in a blob container. Set ServiceControl/ on an Error instance, or ServiceControl. on an Audit instance, to AzureBlob when the instance uses SQL Server or PostgreSQL storage.
Authentication
Azure Blob Storage supports two mutually exclusive authentication methods. Configure exactly one:
- Connection string — authenticates with shared key or shared access signature (SAS) credentials.
- Service URI with Microsoft Entra credentials — authenticates using the Azure SDK's
DefaultAzureCredential, which can use managed identity. SetManagedIdentityClientIdto select a user-assigned managed identity.
Required settings
ServiceControl/MessageBody/Azure/ConnectionString
Added in version 7.0.0
The Azure Storage connection string used to authenticate with shared key or shared access signature (SAS) credentials when MessageBody/ is AzureBlob. Configure either this setting or ServiceControl/, but not both.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_MESSAGEBODY_AZURE_CONNECTIONSTRING |
| App config key | ServiceControl/ |
| SCMU field | N/A |
| Type | Default value |
|---|---|
| string | None |
ServiceControl.Audit/MessageBody/Azure/ConnectionString
Added in version 7.0.0
The Azure Storage connection string used to authenticate with shared key or shared access signature (SAS) credentials when MessageBody/ is AzureBlob. Configure either this setting or ServiceControl., but not both.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_AUDIT_MESSAGEBODY_AZURE_CONNECTIONSTRING |
| App config key | ServiceControl. |
| SCMU field | N/A |
| Type | Default value |
|---|---|
| string | None |
ServiceControl/MessageBody/Azure/ServiceUri
Added in version 7.0.0
The Azure Blob Storage service URI used with managed identity when MessageBody/ is AzureBlob. Configure either this setting or ServiceControl/, but not both.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_MESSAGEBODY_AZURE_SERVICEURI |
| App config key | ServiceControl/ |
| SCMU field | N/A |
| Type | Default value |
|---|---|
| string | None |
ServiceControl.Audit/MessageBody/Azure/ServiceUri
Added in version 7.0.0
The Azure Blob Storage service URI used with managed identity when MessageBody/ is AzureBlob. Configure either this setting or ServiceControl., but not both.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_AUDIT_MESSAGEBODY_AZURE_SERVICEURI |
| App config key | ServiceControl. |
| SCMU field | N/A |
| Type | Default value |
|---|---|
| string | None |
ServiceUri must be an absolute URI.
Optional settings
ServiceControl/MessageBody/Azure/ContainerName
Added in version 7.0.0
The Azure Blob Storage container used to store message bodies.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_MESSAGEBODY_AZURE_CONTAINERNAME |
| App config key | ServiceControl/ |
| SCMU field | N/A |
| Type | Default value |
|---|---|
| string | error-bodies |
ServiceControl.Audit/MessageBody/Azure/ContainerName
Added in version 7.0.0
The Azure Blob Storage container used to store message bodies. Every Audit instance has the same default, so set a different container name for each Audit instance that uses the same storage account. The exception is Audit instances that share a database, which must all use the same container.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_AUDIT_MESSAGEBODY_AZURE_CONTAINERNAME |
| App config key | ServiceControl. |
| SCMU field | N/A |
| Type | Default value |
|---|---|
| string | audit-bodies |
Audit instances with different retention periods must use separate containers, even when they share an Azure Storage account. Audit instances use the same default container name, so explicitly configure a different ServiceControl. for each instance. Retention cleanup deletes blobs by time prefix across the container. An instance with shorter retention can delete bodies that another instance still needs, leaving message records visible but their bodies unavailable.
ServiceControl/MessageBody/Azure/ManagedIdentityClientId
Added in version 7.0.0
The client ID of the user-assigned managed identity used to access Azure Blob Storage. When this setting is not specified, the default Azure credential chain is used.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_MESSAGEBODY_AZURE_MANAGEDIDENTITYCLIENTID |
| App config key | ServiceControl/ |
| SCMU field | N/A |
| Type | Default value |
|---|---|
| string | None |
ServiceControl.Audit/MessageBody/Azure/ManagedIdentityClientId
Added in version 7.0.0
The client ID of the user-assigned managed identity used to access Azure Blob Storage. When this setting is not specified, the default Azure credential chain is used.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_AUDIT_MESSAGEBODY_AZURE_MANAGEDIDENTITYCLIENTID |
| App config key | ServiceControl. |
| SCMU field | N/A |
| Type | Default value |
|---|---|
| string | None |
ServiceControl/MessageBody/Azure/AuthorityHost
Added in version 7.0.0
The Microsoft Entra authority host URI used for managed identity authentication in sovereign clouds. When this setting is not specified, the Azure SDK uses the AZURE_AUTHORITY_HOST environment variable or its default authority host.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_MESSAGEBODY_AZURE_AUTHORITYHOST |
| App config key | ServiceControl/ |
| SCMU field | N/A |
| Type | Default value |
|---|---|
| string | None |
ServiceControl.Audit/MessageBody/Azure/AuthorityHost
Added in version 7.0.0
The Microsoft Entra authority host URI used for managed identity authentication in sovereign clouds. When this setting is not specified, the Azure SDK uses the AZURE_AUTHORITY_HOST environment variable or its default authority host.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_AUDIT_MESSAGEBODY_AZURE_AUTHORITYHOST |
| App config key | ServiceControl. |
| SCMU field | N/A |
| Type | Default value |
|---|---|
| string | None |
Setup and runtime
Setup creates the configured container if it does not exist. The identity used for setup needs permission to create the container, and the runtime identity needs read, write, and delete permissions on blobs in the container:
- Service URI with Microsoft Entra ID: assign the
Storage Blob Data Contributorrole on the storage account, or on the container if it is created in advance. This role covers both setup and normal operation. - Connection string: the account key, or the shared access signature's permissions, must allow creating the container during setup, and reading, writing, and deleting blobs at runtime. Setup always sends a create request, even when the container already exists, so a SAS scoped to a single container cannot be used for setup; use the account key or an account SAS that allows creating containers. The retention sweeper deletes body blobs before removing the corresponding database records.
Set these variables in the instance's environment to use a connection string. Replace the account and credential placeholders with values supplied by the deployment environment:
SERVICECONTROL_MESSAGEBODY_STORAGETYPE=AzureBlob
SERVICECONTROL_MESSAGEBODY_AZURE_CONNECTIONSTRING="DefaultEndpointsProtocol=https;AccountName=storageaccount;AccountKey=..."
Example environment variables using a service URI with managed identity:
SERVICECONTROL_MESSAGEBODY_STORAGETYPE=AzureBlob
SERVICECONTROL_MESSAGEBODY_AZURE_SERVICEURI=https://storageaccount.blob.core.windows.net
Audit instances use the same settings with the SERVICECONTROL_AUDIT_ prefix. Set a container name for each Audit instance that uses the same storage account, except Audit instances that share a database:
SERVICECONTROL_AUDIT_MESSAGEBODY_STORAGETYPE=AzureBlob
SERVICECONTROL_AUDIT_MESSAGEBODY_AZURE_SERVICEURI=https://storageaccount.blob.core.windows.net
SERVICECONTROL_AUDIT_MESSAGEBODY_AZURE_CONTAINERNAME=audit-bodies-instance1
See the external message body storage overview for shared configuration, retention, and backup guidance.