Edit

Share via


Configure a container in Cosmos DB in Microsoft Fabric (preview)

Important

This feature is in preview.

While many features are automatically enabled and built-in to Cosmos DB in Microsoft Fabric, there are still a few places where you can customize the behavior of your container through configuration. In this guide, you walk through the steps to configure the most common customizable settings for a container in your Cosmos DB in Fabric database.

Prerequisites

Note

Databases do not support offer replacement for containers, meaning you cannot change a container's throughput after it has been created.

Update settings

First, use the Settings section for a container to customize and observe the most common options including, but not limited to time-to-live (TTL), geospatial configuration, and partitioning.

  1. Open the Fabric portal (https://app.fabric.microsoft.com).

  2. Navigate to your existing Cosmos DB database.

  3. Select and expand your existing container. Then, select Settings.

  4. In the Settings section, select the redundant Settings tab.

  5. Now, observe the value for the Partition key option.

  6. Next, optionally configure the Time to Live and Geospatial Configuration values.

    Screenshot of the 'Settings' section for a container within a database in the Fabric portal.

  7. Select Save to persist your changes.

    Tip

    For more information on time-to-live (TTL) configuration, see time-to-live. For more information on geospatial configuration, see geospatial data.

Rework indexing policy

Now, use the Indexing Policy section to customize how indexing works for your container. Indexing customizes how Cosmos DB converts items into a tree representation internally. Customizing the indexing policy can tune the performance of your container to better align with your profile of your data workload.

  1. Still in the Settings section, select the Indexing Policy tab.

  2. Update the editor with a new JSON indexing policy:

    {
      "indexingMode": "consistent",
      "automatic": true,
      "includedPaths": [
        {
          "path": "/*"
        }
      ],
      "excludedPaths": [
        {
          "path": "/\"_etag\"/?"
        }
      ]
    }
    

    Screenshot of the 'Indexing Policy' section for a container within a database in the Fabric portal.

    Note

    By default, Cosmos DB in Fabric automatically indexes every property for all items in your container. The policy illustrated in this example is the default policy for a new container.

  3. Select Save to persist your changes.

    Tip

    For more information on indexing, see indexing policies.