Azure/azure-cosmos-python

Documentation does not include how to create a database with provisioned throughput

Opened this issue · 0 comments

I just spent several hours figuring out how to create a database through the python api with provisioned throughput. This was easy from the azure portal, but documentation does not mention how to do this in the python API. Eventually, I figured out the solution by viewing the source code and finding a reference to "offerThroughput" and trying it as an option in cosmos_client.CreateDatabase. Example:

from azure.cosmos import cosmos_client
client = cosmos_client.CosmosClient(url_connection="REDACTED",auth={'masterKey': "REDACTED"})
CreateDatabase(database={"id": "mydb"},options={"offerThroughput": 400})

Could we add this to the documentation for creating a database so that others don't run into this issue?