The "MessagingGatewayBadRequest" error typically occurs when there are missing permissions required for capturing write events to blob storage from EventHub. In this case, the error message indicated that the user or application with the specified object ID does not have the necessary data plane write permissions.
To resolve this issue, the following permissions must be assigned at the storage account scope: - Microsoft.Storage/storageAccounts/blobServices/containers/write
- Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write
Assigning the "Storage Blob Data Contributor" role to the user or application object ID will grant these permissions. This role includes the necessary permissions to enable captures from EventHub to Azure Storage.
To assign the role, follow these steps: 1. Go to the Azure portal and navigate to your storage account. 2. Select "Access Control (IAM)" from the left-hand menu. 3. Click on "Add" and then "Add role assignment." 4. Choose the "Storage Blob Data Contributor" role. 5. Select the user, group, or service principal that requires the permissions. 6. Click "Save" to apply the changes.
For more detailed information, refer to the following documentation: - Capture streaming events - Azure Event Hubs - Azure built-in roles for Storage - Azure RBAC
Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.
Please do not forget to "Accept the answer" and "up-vote" wherever the information provided helps you, as this can be beneficial to other community members.