I thought it would be pretty simple, but I seems as if I am missing something
import os
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)
#for testing only
@app.route(route="get_tested", methods=["POST"])
def get_tested(req: func.HttpRequest) -> func.HttpResponse:
logging.info("Processing 'get_tested' request")
VAR = os.environ['VAR_NAME']
print(VAR)
return VAR
at the moment all I am trying to achieve is to print the "VAR" but it just comes back as None
I have verified that secret is set in the "Environmental Variables" on the left-hand panel.
when I do the tests and invoke the https request from the function portal/ postman, I get a 500 error
Edit: added tag environmental-variables, changed env var name from "secret" to "VAR" and python var from "secret" to "VAR" to get rid of confusion. I am already using keyvault for actual secrets, 2, updated script and added more information