Question

Difficulty: EasyCreate and Configure Azure Functions

You need to create an Azure Function that runs automatically on a schedule every hour to check for inactive user accounts and update their status in an Azure Cosmos DB database. Which two configurations should you use for this function? (Select two.)

  1. A Timer trigger to execute the function on the hourly scheduleAnswer
  2. An Azure Cosmos DB output binding to update the user account documentsAnswer
  3. C
    An Azure Cosmos DB trigger to run the function when accounts become inactive
  4. D
    An HTTP trigger to initiate the function execution from an external scheduler

Answer

A Timer trigger to execute the function on the hourly schedule, and an Azure Cosmos DB output binding to update the user account documents.
To execute the function on an hourly schedule, a Timer trigger is required. To write the status changes back to Azure Cosmos DB, an output binding is the correct configuration as it enables writing data without manually instantiating database client connections.

Step-by-Step Solution

1
Identify the execution model required for the schedule.
The function must run automatically every hour.
The Timer trigger uses CRON expressions to run functions periodically, making it the correct choice.
2
Identify the database operation required.
The function must modify or save updated status back to Azure Cosmos DB.
An output binding provides a simple, declarative way to write data from the function to the target database.

Key Concept

Azure Functions use triggers to define how a function is invoked, and bindings to connect to data sources. A Timer trigger executes code on a schedule, while an output binding writes data to a service like Azure Cosmos DB.
Estimated Time:45s
Rate this question