DP-300 practice question 30 of 35

You have an Azure SQL Database managed instance named SQLMI1. A Microsoft SQL Server Agent job runs on SQLMI1. You need to ensure that an automatic email notification is sent once the job completes. What should you include in the solution?

Full set: 407 questions

Domain Configure and manage automation

Answer options
A: From SQL Server Configuration Manager (SSMS), enable SQL Server Agent
B: From SQL Server Management Studio (SSMS), run sp_set_sqlagent_properties
C: From SQL Server Management Studio (SSMS), create a Database Mail profile Correct answer
D: From the Azure portal, create an Azure Monitor action group that has an Email/SMS/Push/Voice action
Correct Answer:
C. From SQL Server Management Studio (SSMS), create a Database Mail profile
Explanation

To enable SQL Server Agent jobs on an Azure SQL Managed Instance to send email notifications, you must first configure the Database Mail feature. SQL Server Agent relies exclusively on Database Mail to send emails. This involves creating a Database Mail account, which holds the SMTP server information, and a Database Mail profile, which is a collection of accounts. Once the profile is created and configured as the default mail profile for the SQL Server Agent, you can then configure individual jobs and operators to send notifications upon completion, failure, or success.

Why Incorrect

A. From SQL Server Configuration Manager (SSMS), enable SQL Server Agent SQL Server Configuration Manager is a tool for managing services on-premises or in IaaS VMs, not for PaaS offerings like Azure SQL Managed Instance. The agent is already enabled in SQL MI.
B. From SQL Server Management Studio (SSMS), run spsetsqlagentproperties This stored procedure configures existing SQL Server Agent properties, such as setting the default mail profile. It cannot be used until a Database Mail profile has already been created.
D. From the Azure portal, create an Azure Monitor action group that has an Email/SMS/Push/Voice action Azure Monitor action groups are for platform-level alerts based on metrics or logs, not for notifications triggered directly by the completion of a specific SQL Server Agent job.

References

1. Microsoft Docs, "SQL Server Agent jobs in Azure SQL Managed Instance": Under the "Notifications" section, it states: "SQL Server Agent can notify you that a job has finished or failed. You can configure notifications in Azure SQL Managed Instance: ... 2. Set up an email operator. You'll first need to set up Database Mail on the SQL Managed Instance." This directly confirms the necessity of setting up Database Mail first.

2. Microsoft Docs, "Configure Database Mail - Azure SQL Managed Instance": This tutorial outlines the required steps: "These procedures show how to configure Database Mail on Azure SQL Managed Instance using Transact-SQL... It uses a Database Mail profile...". The first major step is "Create a Database Mail profile".

3. Microsoft Docs, "Automate management tasks using SQL Agent jobs in Azure SQL Managed Instance": In the "Notifications" section, it reiterates, "To enable notifications, you need to configure Database Mail on the instance."

Scroll to Top