I am learning Cosmos DB and am walking through the following tutorial on the Microsoft Cosmos DB Documentation site:
https://docs.microsoft.com/en-us/azure/cosmos-db/tutorial-query-table
Unfortunately, I am stuck at the point where I am trying to access the entities I created. Anytime I run the GET request to receive the oData response, I receive the following error message:
{
"code": "BadRequest",
"message": "Request url is invalid.\r\nActivityId: e7df6ff2-eaea-4d10-8823-ff0cee3a62c2"
}
I have an endpoint that looks like this (note that I replace my actual Cosmos account with abc):
https://abc.documents.azure.com
I also tried using to start my oData queries:
https://abc.documents.azure.com:443
According to the tutorial, I should create a database, a table, and add three entities. I did that successfully using C# with the Table API's TableOperation.Insert() method. Since I can successfully create the table and entities using the Table API, I know the endpoint I am using is accurate and made sure I copied/pasted that element from the connection string and I know it matches that of the database in Azure.
Here is what the database looks like in Azure:
Next, the tutorial has you run a query with the table endpoint. Here is where I start getting confused because I cannot find documentation that explains how to get the Table's endpoint.
Here is the example the tutorial shows:
https://<mytableendpoint>/People(PartitionKey='Harp',RowKey='Walter')
So I figure, just try this:
https://abc.documents.azure.com/People(PartitionKey='Harp',RowKey='Walter')
That did not work, so I figure maybe I also need to specify the database (TablesDB as you see in the picture above):
https://abc.documents.azure.com/TablesDB/People(PartitionKey='Harp',RowKey='Walter')
That does not work either. As mentioned earlier in this post, I did try appending :443 to the end of all my test queries but the error response is still the same.
Right now, I am trying all this with Postman GETs.
Also, I did try getting a token like this in Postman:
https://login.microsoftonline.com/{{tenant_id}}/oauth2/token
And then sending the GET request using the Authorization parameter and passing the token but still get the same error as listed above.
Do you know how I can properly construct the table endpoint to successfully send a request and receive the oData response?
Thank you.