I have been testing Visual Studio Code - AZURE COSMOS DB extension in combination with Graph API options and encountered Invalid credentials provided (Error 401) error. I had previously created an existing Azure Cosmos DB Graph API project on Azure Portal which had already generated URI, PRIMARY KEY as well as PRIMARY CONNECTION STRING. I had repeated the same process over and over,in many occasions, even managed to use the dtui-data migration tool to seed data and everything always went smoothly. However trying to connect to Graph API database through Visual Studio Code - AZURE COSMOS DB extension Graph Explorer user interface seemed a bit more complicated than I thought. When I wanted to provide an Attached Database Account then Visual Studio Code command prompted to
Select a Data Account API...
I selected Graph
.
A next Visual Studio Code command them prompts to
Enter the connection string for your database account(Press 'Enter' to confirm or 'Escape' to cancel
.
I then provided the PRIMARY CONNECTION STRING of my project using similar format pattern:
AccountEndpoint=https://<my-project-endpoint>.documents.azure.com:443/;AccountKey=<my-project-primary-key==>;
I could then see the proper database
and collection
of the Graph API I had created earlier on Azure Portal,
though when clicking on collection to launch and display the graph explorer, I ended up with following Invalid credentials provided (Error 401) message:
Any hints on how to cope with this issue would be deeply appreciated. Thank you.