#Static Web App sending HTTP request to Function App without exposing key

1 messages · Page 1 of 1 (latest)

half thistle
#

Hello,

I have an Azure Static Web App which sends an HTTP POST request to an HTTP function app. I am using fetch to send the request to the url using the function url that is provided by Azure. However, I do not want to expose my function key, so I am looking for a secure way to do this.

I tried storing the function key as an environment variable in the SWA's configuration and accessing it in the JavaScript file using process.env.AZURE_FUNCTION_KEY;, but it did not work. I would really appreciate if someone could let me know if I am approaching this incorrectly or if there is another solution. Thank you c:

#

How can I have my Static Web App send an HTTP request to my Function App without exposing the functi

#

Static Web App sending HTTP request to Function App without exposing key

bright dirge
sly stream
bright dirge
#

This or you can create the env variables on you're github repo as secrets and declare them in you're pipeline yml file in the env section

#

Because i think that env variables used for frontend build are not exposed to the web ( for security measure) and can't be used directly ( I'm not sure to comfirm this info )

half thistle
#

Thank you

half thistle
#

I will try this soon and reach back out

#

I am sure that I am not the first person to have this issue, though, so I am wondering if I am approaching this the wrong way.

#

Because the HTTP function has access to a privileged certificate and thus I can't risk to expose the key.