I am using the azure-keyvault-secrets package to manage my resources secrets in Python 3.8, developping in PyCharm.
But when I am running the following:
import os
from azure.keyvault.secrets import SecretClient
from azure.identity import DefaultAzureCredential
VAULT_URL = os.environ["VAULT_URL"]
credential = DefaultAzureCredential()
client = SecretClient(
vault_url=VAULT_URL,
credential=credential
)
client.set_secret('my-secret-name', 'my-secret-value')
I get the following error:
HttpResponseError: azure keyvault secrets (Unauthorized) AKV10032: Invalid issuer. error
I have set the environment variables correct, according to the Microsoft Docs. I also restarted the runtime environment in PyCharm multiple times.
What to do?