AxiosError: Request failed with status code 403

samuel chazy 15 Reputation points
2023-07-04T17:56:55.1+00:00

I am using a python and streamlit code to upload files to Azure Web App so that I can interact with the files. Each time I upload any file to the website, I hit an error: AxiosError: Request failed with status code 403.

I have added all the necessary permissions from Microsoft Graph portal including APIConnectors...., ExternalConnection...., IndustryConnector-DataConnector, but I am still getting the same error.

Anyone had this issue and found a solution to it?

Thanks,

Samuel

Microsoft Security | Microsoft Graph
{count} vote

2 answers

Sort by: Most helpful
  1. samuel chazy 15 Reputation points
    2023-07-06T05:33:44.8366667+00:00

    I found a solution on the internet for this issue and it worked for me.Screenshot 2023-07-05 at 18.38.41

    2 people found this answer helpful.

  2. seadude 111 Reputation points
    2024-08-18T22:34:13.8233333+00:00

    It feels insecure to me turning offthe enable cross-site-scripting protection. There has to be a better way.

    The issue is due to (in my case) EntraID Authentication set on the Web App.

    • When I run the Streamlit code locally, the upload to Azure Storage works fine
    • Its only when I try to upload from the Web App-hosted URL that if fails.

    I tried:

    • Enabling CORS
    • Checking the Enable Access-Control-Allow-Credentials box
    • Adding the Web App as an Allowed Origin
    • Even restarting the Web App after this... nothing has worked so far.

    @Microsoft, could you assist us to fix this in a secure manner?

    Thank you

    • User's image
    1 person found this answer 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.