How to fix "azure.core.exceptions.ClientAuthenticationError: (None) Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired" during RAG creation tutorial?
I am trying to follow the steps of the tutorial: https://learn.microsoft.com/en-us/azure/ai-studio/tutorials/copilot-sdk-build-rag
I keep getting the error:
azure.core.exceptions.ClientAuthenticationError: (None) Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired.
Code: None
Message: Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired
I've triple checked my .env file to make sure everything is correct. The code is a direct copy of what is in the tutorial and I've double checked that everything is in the same region. I've tried re-logging into the CLI to make sure it's not that too. The code doesn't specify an api key, which I'm thinking maybe that's what it needs?