E-mail notifications of canceled SQL Server Agent job should include the name of the Azure MI
Dear Community,
In our Azure Managed Instances we use the SQL Server Agent for maintenance tasks and for checks. If these jobs are canceled for any reason, they inform you about this cancellation by email.
Notifications have been configured in the job properties for this purpose.
However, the mail that is sent in such a case does not show in the subject which Azure MI it was sent from:
Example: If a job in the Azure MI “my-azure-mi-1.e4f0d600e52e.database.windows.net” aborts, we receive an email with the subject “[The job failed.] SQL Server Job System: ‘klesstest’ completed on \DB8C1B7BCF28BD9A3.”
In the future, we will operate a larger number (>30) of Azure Mis, we are dependent on knowing which Azure MI is affected when jobs are canceled.
We would like to see the email notifications about a canceled SQL Server Agent job include the name of the Azure Managed Instance in the subject of the email and not the hostname where the SQL Server Agent service is running.
The problem can be alleviated somewhat by including an explicit “mail-in-case-of-job-step-failed” in the job and adapting the “on-failure-action” in the individual steps so that it forwards to the “mail-in-case-of-job-step-failed” step.
In step ““mail-in-case-of-job-step-failed” you can control the subject of the mail when using
[msdb].[dbo].[sp_send_dbmail] and include @@servername in the subject of your mail.
Nevertheless, you cannot completely do without the standard notification ob the SQL Server Agent Jobs and the problem is exacerbated with a growing number of custom Azure MIs
Please vote for this request.
Kind regards,
Michael
Dear Community, In our Azure Managed Instances we use the SQL Server Agent for maintenance tasks and for checks. If these jobs are canceled for any reason, they inform you about this cancellation by email. Notifications have been configured in the job properties for this purpose. However, the mail that is sent in such a case does not show in the subject which Azure MI it was sent from: Example: If a job in the Azure MI “my-azure-mi-1.e4f0d600e52e.database.windows.net” aborts, we receive an email with the subject “[The job failed.] SQL Server Job System: ‘klesstest’ completed on \DB8C1B7BCF28BD9A3.” In the future, we will operate a larger number (>30) of Azure Mis, we are dependent on knowing which Azure MI is affected when jobs are canceled. We would like to see the email notifications about a canceled SQL Server Agent job include the name of the Azure Managed Instance in the subject of the email and not the hostname where the SQL Server Agent service is running. The problem can be alleviated somewhat by including an explicit “mail-in-case-of-job-step-failed” in the job and adapting the “on-failure-action” in the individual steps so that it forwards to the “mail-in-case-of-job-step-failed” step. In step ““mail-in-case-of-job-step-failed” you can control the subject of the mail when using [msdb].[dbo].[sp_send_dbmail] and include @@servername in the subject of your mail. Nevertheless, you cannot completely do without the standard notification ob the SQL Server Agent Jobs and the problem is exacerbated with a growing number of custom Azure MIs Please vote for this request. Kind regards,Michael Read More