You are developing a .NET background worker service that consumes high-throughput sensor telemetry from an Azure Event Hub using the EventProcessorClient class from the Azure.Messaging.EventHubs.Processor library. The service is containerized and deployed to Azure Container Apps with multiple replica instances sharing the same consumer group.
To coordinate partition ownership and perform checkpointing, you configure the EventProcessorClient to use a container in an Azure Blob Storage account. You configure the Azure Container App to use a User-Assigned Managed Identity.
During deployment, the service instances start up but fail to claim partition ownership. The container logs output multiple RequestFailedException errors with an HTTP status of 403 (Authorization Failed) when attempting to perform write operations on the checkpoint blobs. You verify that the User-Assigned Managed Identity has been assigned the Storage Blob Data Contributor role on the storage account scope.
Which of the following describes the cause of this lease coordination failure and the correct resolution?
- AThe EventProcessorClient is restricted by the Azure SDK design to only utilize system-assigned managed identities for lease management. To resolve this, you must enable the system-assigned managed identity on the Container App, assign it the Owner role on the storage account, and disable the user-assigned managed identity.
- BThe EventProcessorClient is attempting to modify active leases that are locked. To resolve this, you must run a background task that uses BlobClient.DeleteAsync() without specifying a lease ID to force-delete the active lease blobs in the checkpoints container before the processor starts.
- The DefaultAzureCredential was instantiated without configuration, causing it to fall back to the system-assigned managed identity (or another default credential) which does not have permissions on the storage container. To resolve this, specify the client ID of the user-assigned managed identity in the DefaultAzureCredentialOptions when initializing the credential.Answer
- DThe checkpoint metadata payload exceeds the 64 KB storage limit allowed for lease blobs in Azure Blob Storage. To resolve this, you must store the telemetry event payloads in Azure Queue Storage instead of Azure Event Hubs to keep the partition state below the size limit.