A telemetry processing application runs as a C# worker service on Azure Container Apps. The application uses the EventProcessorClient from the Azure.Messaging.EventHubs.Processor library to consume messages from an Azure Event Hub and uses an Azure Blob Storage container for checkpointing. The Container App is configured to use a user-assigned managed identity. During testing, you observe that partition ownership cannot be established, and checkpointing fails with access and lease errors. Which two actions must you perform to configure the storage client and resolve these issues? (Select two.)
- Assign the Storage Blob Data Contributor role to the user-assigned managed identity on the storage container.Answer
- Initialize the BlobContainerClient using DefaultAzureCredential configured with the client ID of the user-assigned managed identity.Answer
- CImplement custom lease-handling logic using BlobLeaseClient to manually release leases on partition blobs after each event batch is processed.
- DConfigure the EventProcessorClient using a system-assigned managed identity while passing the client ID of the user-assigned managed identity to the token credential options.
Answer
To resolve the checkpointing issues, you must assign the Storage Blob Data Contributor role to the user-assigned managed identity on the storage container and initialize the BlobContainerClient using DefaultAzureCredential configured with the client ID of the user-assigned managed identity.
To enable EventProcessorClient checkpointing, the user-assigned managed identity requires data-plane write access (Storage Blob Data Contributor) on the container to write lease and checkpoint metadata. Additionally, because the application utilizes a user-assigned managed identity, the developer must explicitly specify the client ID in DefaultAzureCredentialOptions to ensure the correct identity is resolved.
Step-by-Step Solution
Key Concept
Configuring EventProcessorClient storage checkpointing with user-assigned managed identities and Azure RBAC roles.