Azure Cosmos DB Account with SQL API: Notification Solution for IoT Data | Exam AZ-301

Azure Cosmos DB Account with SQL API: Notification Solution for IoT Data

Question

You plan to create an Azure Cosmos DB account that uses the SQL API. The account will contain data added by a web application. The web application will send data daily.

You need to recommend a notification solution that meets the following requirements:

-> Sends email notification when data is received from IoT devices.

-> Minimizes compute cost.

What should you include in the recommendation?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B

To meet the requirement of sending email notifications when data is received from IoT devices while minimizing compute cost, the recommended solution should leverage serverless technologies. Both Azure Functions and Logic Apps can be used to process data from Azure Cosmos DB and send email notifications. However, Functions are best suited for simple, short-lived tasks, while Logic Apps are more suitable for orchestrating complex workflows.

Option A: Deploy an Azure Logic App that has the Azure Cosmos DB connector configured to use a SendGrid action. This option leverages Logic Apps to process data from Cosmos DB and send email notifications using SendGrid. Logic Apps provide a visual workflow designer that enables you to create complex workflows easily. By using a Logic App with the Cosmos DB connector, you can configure the app to trigger on data changes in Cosmos DB, and then use the SendGrid connector to send email notifications. This option is suitable for scenarios where you need to perform more complex processing of the data before sending notifications. It is also cost-effective because you only pay for the execution of the Logic App.

Option B: Deploy a Function App that is configured to use the Consumption plan and a SendGrid binding. This option leverages Azure Functions to process data from Cosmos DB and send email notifications using SendGrid. Functions provide a simple way to write small pieces of code that respond to events. By using a Function App with the Cosmos DB trigger and SendGrid binding, you can trigger the function when new data is added to Cosmos DB, and then use the SendGrid binding to send email notifications. This option is suitable for scenarios where you need to perform simple processing of the data before sending notifications. It is also cost-effective because you only pay for the execution of the function.

Option C: Deploy an Azure Logic App that has a SendGrid connector configured to use an Azure Cosmos DB action. This option leverages Logic Apps to send email notifications when data is received from Cosmos DB using a Cosmos DB action. This option is not suitable for the scenario because the notification should be sent when data is received from IoT devices, not when data is written to Cosmos DB. This option does not meet the requirement of the scenario.

Option D: Deploy a Function App that is configured to use the Consumption plan and an Azure Event Hubs binding. This option leverages Azure Functions to process data from Cosmos DB and send email notifications using Azure Event Hubs. Functions provide a simple way to write small pieces of code that respond to events. By using a Function App with the Cosmos DB trigger and Event Hubs binding, you can trigger the function when new data is added to Cosmos DB, and then use Event Hubs to send email notifications. This option is not suitable for the scenario because it uses Event Hubs to send notifications, which adds additional complexity and cost. Additionally, Event Hubs is typically used for high-scale, real-time data streaming scenarios, which is not needed in this scenario.

In conclusion, the recommended solution is Option A: Deploy an Azure Logic App that has the Azure Cosmos DB connector configured to use a SendGrid action. This option uses Logic Apps to process data from Cosmos DB and send email notifications using SendGrid. It is suitable for scenarios where you need to perform more complex processing of the data before sending notifications, and it is also cost-effective because you only pay for the execution of the Logic App.