Developing Solutions for Microsoft Azure (AZ-204) Practice Exam

Disable ads (and more) with a membership for a one time $2.99 payment

Developing Solutions for Microsoft Azure Exam. Prepare with flashcards and multiple choice questions, get hints and explanations for each question. Ace your test prep!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which option would be used to validate properties of an item being created in Azure Cosmos DB?

  1. Pre-trigger

  2. Post-trigger

  3. User-defined function

  4. Validation script

The correct answer is: Pre-trigger

To validate properties of an item being created in Azure Cosmos DB, a pre-trigger is the appropriate option. Pre-triggers are executed before the main operation (such as creating or updating an item) occurs in the database. This allows you to enforce validation rules and ensure that the item meets specific criteria before it is stored. For instance, you could check that the properties of the item conform to required formats or constraints, thereby maintaining data integrity at the time of insertion or update. While options like post-triggers can execute after an operation, they do not serve the purpose of validating an item prior to its creation. User-defined functions are typically used to perform computations or return values but are not designed specifically for validation during the item creation process. Validation scripts usually refer to separate processes or tools outside the triggers framework in Azure, hence not directly applicable for this specific context within Cosmos DB.