Open tahsinalamin opened 3 months ago
Can you check to make sure that those two values are blank, in your App Service environment variables?
AZURE_OPENAI_API_KEY
OPENAI_API_KEY
I've seen an issue where developers have those set in their global environment, and we're accidentally picking up the global values when we do a deploy.
@pamelafox AZURE_OPENAI_API_KEY was empty. I copied the actual key and now its working!
Was it supposed to be empty?
I had the same issue, where AZURE_OPENAI_API_KEY was empty. Filling it in the Environment Variables for the App Service resource in the Azure Portal fixed it
BUT every time that I re-deploy the app or deploy a new app, the AZURE_OPENAI_API_KEY gets wiped out blank and the issue returns, requiring this manual step. @pamelafox is there a fix for that?
I experience the same, but in my case AZURE_OPENAI_API_KEY and OPENAI_API_KEY isn't even set. Only AZURE_OPENAI_KEY is there, and I need to create the others after every deployment.
From my talk with Azure support, the env variables from .env
file do not get updated, the existing variables in the Azure portal gets priority. So, it makes sense to set the environment variables each time after redeploying. Hope they make the update.
To resolve this problem, I create in App Service -> Environment Variables: AZURE_OPENAI_API_KEY and put the KEY 1 from OpenAI Resource. This worked for me.
This project uses managed identity by default, which means that no keys are required. The roles are set in the infrastructure (in infra/main.bicep) so that the App Service app can access the OpenAI resource. If you run "azd up", it should take care of all of that for you.
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
OS and Version?
Versions
Mention any other details that might be useful
I deployed the WebApp in October last year. It was working perfectly. I updated the code from the latest git repo and deployed the app from the commands given in the git repo. Now it is showing the error. However, when I do a local deployment, it works as expected.