Practice Test

True or False: Azure Resource Manager (ARM) templates can be used to automate deployment and configuration of indexing policies in production.

  • True
  • False

Answer: True

Explanation: ARM templates support indexing policies, which can be used for automating deployment and configuring indexing policies in a production environment.

Multiple select: Which of the following can be configured using indexing policies in Azure Cosmos DB?

  • a) Precision
  • b) Included Paths
  • c) Excluded Paths
  • d) Storage Account

Answer: a), b), c)

Explanation: An indexing policy defines precision, included paths, and excluded paths. A storage account is not configured using indexing policies.

True or False: ARM templates cannot be used to manage multiple resources and resource groups in Azure.

  • True
  • False

Answer: False

Explanation: ARM templates are the deployment service for Azure, allowing you to create and manage resources more effectively.

Single select: ARM templates are written in which language?

  • a) JSON
  • b) Python
  • c) JavaScript
  • d) Java

Answer: a) JSON

Explanation: ARM templates are written in JSON (JavaScript Object Notation), a language-independent open standard format.

Multiple select: What do indexing policies in Azure Cosmos DB control?

  • a) What parts of an item’s content to index
  • b) The precision of the index
  • c) The Azure region
  • d) The cost of index storage

Answer: a), b), d)

Explanation: Indexing policies determine what parts of an item’s content to index, the precision of the index and indirectly influence the cost of index storage. The Azure region is not controlled by indexing policies.

True or False: It is possible to modify the indexing policy of an existing Azure Cosmos container by using ARM templates.

  • True
  • False

Answer: True

Explanation: We can indeed modify the indexing policy of an existing Azure Cosmos container by using the ARM templates.

Multiple select: Which of the following operations can be performed with ARM templates?

  • a) Deployment of resources
  • b) You can run complex queries
  • c) Management of access policies
  • d) Organizing resources

Answer: a), c), d)

Explanation: ARM templates can be used to automate deployment, manage access policies, and organize resources effectively. Running complex queries is not a feature of ARM templates.

Single select: What is the main purpose of ARM templates?

  • a) To automate deployment
  • b) To manage storage
  • c) To create virtual machines
  • d) All of the above

Answer: a) To automate deployment

Explanation: The main purpose of ARM templates is to automate deployment and configuration of resources in Azure.

True or False: Indexing policies in Azure Cosmos DB do not affect query performance.

  • True
  • False

Answer: False

Explanation: Indexing policies in Azure Cosmos DB do actually affect query performance as well as the cost of read and write operations.

Single select: Which of the following concepts is NOT associated with Azure Cosmos DB’s indexing policy?

  • a) Indexing mode
  • b) Indexing path
  • c) Consistency level
  • d) Indexing precision

Answer: c) Consistency level

Explanation: Consistency level is not a part of Azure Cosmos DB’s indexing policy, it is a separate concept related to read operations in Azure Cosmos DB.

Interview Questions

What is an ARM template in Azure?

An ARM (Azure Resource Manager) template is a JSON file used in Azure to automate deployments. It defines the resources needed for an application so that Azure can understand how to provision and configure these resources efficiently.

How is Cosmos DB indexing policy maintained in production with ARM templates?

Cosmos DB indexing policy is maintained in production using ARM templates by defining the indexing policy in the template. This has all the indexes that should be included or excluded, indexing mode and automatic indexing. This template can be used to automate the deployment and updates of the Cosmos DB instances in production.

Can you modify the indexing policy of an Azure Cosmos DB container using ARM templates without recreating the container?

No, you cannot modify the indexing policy of an Azure Cosmos DB container using ARM templates without recreating the container. Any change in an indexing policy necessitates the recreation of a container in Azure Cosmos DB.

What is an indexing policy in the context of Cosmos DB?

An indexing policy in Cosmos DB defines how items in the database are indexed. It includes settings for automatic indexing, index types, index path, and indexing mode.

How does Cosmos DB handle indexing by default?

By default, Cosmos DB automatically indexes all properties in all items in a container without having to be explicitly specified by an indexing policy.

What is an index transformation in Cosmos DB?

Index transformation is a process in Cosmos DB that rebuilds the indexes based upon changes in the indexing policy. This process is required when making changes to the indexing policy, ensuring that the current data complies with the new policy.

What indexing modes are available in Cosmos DB?

Cosmos DB has two indexing modes: Consistent and Lazy. Consistent indexing is updated synchronously as data is written to the database while Lazy indexing is updated asynchronously.

What is the role of the “excludedPaths” property in Azure Cosmos DB ARM templates?

The “excludedPaths” property in Azure Cosmos DB ARM templates allows specific areas in the document path hierarchy to be excluded from indexing, improving the performance of write operations and reducing storage of the indexing data.

Is using ARM templates to maintain indexing policies in a Cosmos DB environment mandatory?

No, it’s not mandatory but it is recommended for deploying repeatable and consistent Cosmos DB environments. Especially in production environments, it ensures indexing settings remain consistent across deployments.

Where can I find examples of Cosmos DB ARM templates?

Examples of Cosmos DB ARM templates can be found in the official Azure Quickstart Templates repository on GitHub.

How does the “includedPaths” property in an ARM template function?

The “includedPaths” property specifies the paths within the document that should be included in the index.

What is the standard way to update a Cosmos DB index using ARM Templates?

The standard way to update a Cosmos DB index using ARM Templates is to modify the index policy in the ARM template and redeploy it, causing the entire Azure Cosmos DB container to be dropped and recreated.

What is the cost of indexing in Cosmos DB?

The cost of indexing in Cosmos DB is based on the storage size of the index and the provisioned throughput required to maintain the index. Higher indexing can lead to increased cost.

Using ARM Templates, how can you set the indexing mode in Cosmos DB?

In ARM Templates, you can set the indexing mode in Cosmos DB by including an ‘indexingPolicy’ object in your template, along with an ‘indexingMode’ property set to either ‘Consistent’ or ‘Lazy’.

Can I use indexing policies in Azure Cosmos DB to optimize query performance?

Yes, adjusting the indexing policies in Azure Cosmos DB provides the flexibility to optimize read-heavy or write-heavy scenarios, which can improve overall query performance.

Leave a Reply

Your email address will not be published. Required fields are marked *