Share via

Bad request error while workflow load the data to azure cosmos DB by using  create or update item in logic app

Ragunath Gunasekaran 40 Reputation points Microsoft Employee
2026-04-16T04:55:47.2266667+00:00

Bad request error while workflow load the data to azure cosmos DB by using  create or update item in logic app. The Logic App's MI has permission to Azure cosmos db with RBAC permission.

Azure Logic Apps
Azure Logic Apps

An Azure service that automates the access and use of data across clouds without writing code.

0 comments No comments

Answer accepted by question author

  1. Pravallika KV 14,640 Reputation points Microsoft External Staff Moderator
    2026-04-16T05:15:50.4366667+00:00

    Hi @Ragunath Gunasekaran ,

    Thanks for reaching out to Microsoft Q&A.

    We connected over MS Teams and the issue is now resolved. Please find the summary of our discussion and resolution below.

    Issue:

    • Bad Request error typically indicates that Azure Cosmos DB rejected the request due to invalid JSON payload or incorrect connector configuration.

    Cause:

    • Missing partition key LoadId from SharePoint trigger.

    Resolution:

    • Provided Logic app Managed Identity Cosmos DB Built-in Data Contributor role in Cosmos DB. Used below command to add Role assignment.
        az cosmosdb sql role assignment create --account-name comos-db-no-sql --resource-group comsos-db-rg --scope "/" --principal-id logic-app-managed-identity-object-id --role-definition-id /subscriptions/sub-id/resourceGroups/comsos-db-rg/providers/Microsoft.DocumentDB/databaseAccounts/comos-db-no-sql/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002
      
    • Looked into Application Insights to find the exact error. And the error indicated that no Partition key was supplied from SharePoint source.
    • We made sure it’s well-formed JSON. Ensured to include an “id” property (type string) and the partition key property that container is configured to use.
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.