Hello sayam sanghvi,
Thank you for posting your query here!
Adding on to the previous response, a 502 Bad Gateway error indicates that the server acting as a gateway or proxy received an invalid response from an upstream server it accessed to fulfill the request.
The issue you’re experiencing could be due to a few different factors.
Please make sure that you have allowed your App Service to access your Blob Storage account. You can do this by adding your App Service's outbound IP addresses to the allowed list on Blob Storage.
Also, check the CORS settings on Blob Storage. Make sure that you have enabled CORS for your App Service's domain or URL. You can also specify the allowed methods, headers, and max age for CORS requests.
Other possible reasons for 502 errors can be application-level issues such as the application using high memory/CPU, or the application crashing due to an exception. https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-http-502-http-503
You might also consider using a managed identity to access Azure Blob Storage from your Azure App Service that can simplify authentication and access management.
Similar post: https://learn.microsoft.com/en-us/answers/questions/895845/app-service-cannot-write-to-blob-storage
Do let us know if you have any further queries. I’m happy to assist you further.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.