Azure Function app works fine in local but don't read the request body when deployed in Azure

Achraf DRIDI 71 Reputation points

Hi, I am working with Azure function app that helps upload file to blob storage from file url , I test the function locally using vs code and it works fine and does the job but when deploying in azure and after enabling the identity system assign i tried to trigger it , i can see it gets the credential token because I am using DefaultAzureCredential(). but in the post request I see in logs "No body was attached to request" can someone helps me with this error. thank you ![193818-capture.png][1] [1]: /api/attachments/193818-capture.png?platform=QnA

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
3,018 questions
{count} votes

3 answers

Sort by: Most helpful
  1. MayankBargali-MSFT 54,456 Reputation points

    anonymous user Thanks for reaching out. As per your screenshot shared, I can see there was error executing your function app but I don't see the exception message/details why the function execution was failed. The exception details should have more details on the failure. But in case if you don't see the stack trace then I will suggest you to review the application insights logs to find the root cause of the failure. You can also refer to Diagnose and solve problem blade to find more details and the action plan to resolve the issue.

    As you are using the DefaultAzureCredential() so you should assignee the role correctly for the user assigned/system assigned identity.

    0 comments No comments

  2. Achraf DRIDI 71 Reputation points

    Hi, thank you for your answer, after publishing this question I added some "try exception" and I find out that the exception was in this line :

    keys = storage_client.storage_accounts.list_keys(RESOURCE_GROUP_NAME,AzureStorageAccount)

    I thnik I have a problem with system assigned identity, because I am using the subscription of another user " kinda shared his subscription to my microsoft account" and I don't have permissions to to assign the role correctly.

  3. Shubham Tomar 1 Reputation point

    Possibly, your connection strings are missing from the Azure Function App Portal --> Settings --> Configuration.
    So, you need to create a New Application setting.

    It worked in my case.

    0 comments No comments