An Azure Webapp incorporating Python and Streamlit which has a file upload element is working well in a personal Azure account however once uploaded and operational within an account that is corporate and includes such things as A.D. and B2C any file upload attempt results in:
AxiosError: Request failed with status code 403
Resolutions around:
"--server.enableXsrfProtection=false"
being added do not seem appropriate as the application works without it in "Test" and this appears to be a server side error, i.e.:
"Forbidden response status indicates the server understands a request but refuses to authorize it."
It "seems" possibly this around roles or permission issues, possibly even firewall issues but I’m looking for something to focus on, a more definite direction.
Can you help?
2
Answers
The server can’t authenticate you. Possibly you need to add withCredentials to the Axios Request and send the credentials to the API.
See https://axios-http.com/docs/req_config for more information.
Maybe that will help.
Corporate environments tend to have PIM(Microsoft Entra Privileged Identity Management) https://learn.microsoft.com/en-us/entra/id-governance/privileged-identity-management/pim-configure enabled. In these kind of environments you must request access for your account before you are allowed to do any write and sometimes read operations.
It is possible that that is causing the permission issues if of course you have successfully added ”withCredentials” in the request.