How to create documentdb account using python in azure?
<p>Is any one know how to create document db account programatically for azure? I am aware about creating a database into present document db account.</p>

<p>@Amol Shinde, Trying to use Azure SDK for Python to create documentdb account.</p>

<p>As reference, here is my sample code.</p>

<pre><code>from azure.common.credentials import ServicePrincipalCredentials
from azure.mgmt.resource import ResourceManagementClient

subscription_id = 'xxxx-xxxx-xxx-xxx-xxx'
client_id = 'xxxx-xxxx-xxx-xxx-xxx'
client_secret = 'XXXXXXXXXXXXXXXXXXXXx'
tenant_id = 'xxxx-xxxx-xxx-xxx-xxx'

credentials = ServicePrincipalCredentials(client_id = client_id, secret = client_secret, tenant = tenant_id)

client = ResourceManagementClient(credentials, subscription_id)

documentdb_params = {
    'location': 'westus',
    'properties':  {
        'name': 'myDocumentDb',
        'databaseAccountOfferType': 'Standard'
    }
}

client.resources.create_or_update('&lt;your-resource-group&gt;',
                                  'Microsoft.DocumentDB',
                                  '',
                                  'databaseAccounts',
                                  'myDocumentDb',
                                  '2015-06-01',
                                  documentdb_params)
</code></pre>

<p>And you can refer to the Azure SDK <a href="http://azure-sdk-for-python.readthedocs.io/en/latest/resourcemanagement.html" rel="nofollow">document</a>.</p>

<p>Hope it helps.</p>

python azure