How to create a DocumentDB NoSQL account using the Azure portal

To build a database with Microsoft Azure DocumentDB, you must:

  • Have an Azure account. You can get a free Azure account if you don't have one already.
  • Create a DocumentDB account.

You can create a DocumentDB account using either the Azure portal, Azure Resource Manager templates, or Azure command-line interface (CLI). This article shows how to create a DocumentDB account using the Azure portal. To create an account using Azure Resource Manager or Azure CLI, see Automate DocumentDB database account creation.

Are you new to DocumentDB? Watch this four-minute video by Scott Hanselman to see how to complete the most common tasks in the online portal.

  1. Sign in to the Azure portal.
  2. On the left navigation, click New, click Databases, and then click NoSQL (DocumentDB).

    Screen shot of the Azure portal, highlighting More Services, and NoSQL (DocumentDB))

  3. In the New account blade, specify the desired configuration for the DocumentDB account.

    Screen shot of the New DocumentDB blade

    • In the ID box, enter a name to identify the DocumentDB account. When the ID is validated, a green check mark appears in the ID box. The ID value becomes the host name within the URI. The ID may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. Note that documents.azure.com is appended to the endpoint name you choose, the result of which becomes your DocumentDB account endpoint.
    • In the NoSQL API box, select the programming model to use:

      • DocumentDB: The DocumentDB API is available via .NET, Java, Node.js, Python and JavaScript SDKs, as well as HTTP REST, and offers programmatic access to all the DocumentDB functionality.
      • MongoDB: DocumentDB also offers protocol-level support for MongoDB APIs. When you choose the MongoDB API option, you can use existing MongoDB SDKs and tools to talk to DocumentDB. You can move your existing MongoDB apps to use DocumentDB, with no code changes needed, and take advantage of a fully managed database as a service, with limitless scale, global replication, and other capabilities.
    • For Subscription, select the Azure subscription that you want to use for the DocumentDB account. If your account has only one subscription, that account is selected by default.
    • In Resource Group, select or create a resource group for your DocumentDB account. By default, a new resource group is created. For more information, see Using the Azure portal to manage your Azure resources.
    • Use Location to specify the geographic location in which to host your DocumentDB account.
  4. Once the new DocumentDB account options are configured, click Create. To check the status of the deployment, check the Notifications hub.

    Create databases quickly - Screen shot of the Notifications hub, showing that the DocumentDB account is being created

    Screen shot of the Notifications hub, showing that the DocumentDB account was created successfully and deployed to a resource group - Online database creator notification

  5. After the DocumentDB account is created, it is ready for use with the default settings. The default consistency of the DocumentDB account is set to Session. You can adjust the default consistency by clicking Default Consistency in the resource menu. To learn more about the consistency levels offered by DocumentDB, see Consistency levels in DocumentDB.

    Screen shot of the Resource Group blade - begin application development

    Screen shot of the Consistency Level blade - Session Consistency

Next steps

Now that you have a DocumentDB account, the next step is to create a DocumentDB collection and database.

You can create a new collection and database by using one of the following:

After creating your database and collection, you need to add documents to the collections.

After you have documents in a collection, you can use DocumentDB SQL to execute queries against your documents. You can execute queries by using the Query Explorer in the portal, the REST API, or one of the SDKs.

Learn more

To learn more about DocumentDB, explore these resources: