0

To illustrate the problem, please see the differences in request headers between app running on localhost and on Azure Static Web App service.

On Localhost:

enter image description here

On Azure Static Web Apps Service:

enter image description here

Other Info

The environment variables, locally, are held in a '.env' file. On Azure these were held in GitHub secrets and referenced under the 'env:' section of the Actions workflow. There is another API specified in the same way and that works fine, but the working API is called at build time, while the problematic one is called at runtime.

So, to see if it will resolve this, for the runtime environment variables, I now specify these under Azure Application Settings. This still has not resolved the issue

Nitbuntu
  • 67
  • 1
  • 1
  • 6
  • 405 is related to the http method. Example: You are hitting a GET but the endpoint is exposed as POST. Could you try directly with postman or curl ? Share the results in the question. – JRichardsz Mar 28 '23 at 03:01

1 Answers1

0

This specific issue was resolved by ensuring that browser accessed environment variables start with 'GATSBY_' as mentioned here: https://www.gatsbyjs.com/docs/how-to/local-development/environment-variables/#accessing-environment-variables-in-the-browser

Nitbuntu
  • 67
  • 1
  • 1
  • 6