Pradeep
Pradeep

Reputation: 5530

How to send email whenever Infrastructure (ARM templates) provisioning completed in azure through the VSTS release?

I am working on ARM templates, currently I developed ARM templates for Web App and Azure SQL database. And deployed those are in Azure through the VSTS release definition.

VSTS release Definition: enter image description here

I want to send mail to project manager, whenever Infrastructure provisioning completed in azure. For that I used Send Grid Email task but I have few questions like:

  1. How to give the output of Web App and Azure SQL Server ARM templates to Email Body section in Send Grid Email task?
  2. Is it recommended to use the Send Grid Email task?
  3. How to send email with PowerShell task execution summary like the below image. enter image description here

Upvotes: 0

Views: 682

Answers (1)

starian chen-MSFT
starian chen-MSFT

Reputation: 33708

You can’t get the output of Web App and ARM template deployment tasks, you can get the related information by calling Azure PowerShell or other way, for example: Get-AzureRmResourceGroup.

Regarding send email during build/release, you can use Send Grid Email or other task, just per to your requirement or which you prefer.

Update:

Simple sample to get the output:

$r=New-AzureRmResourceGroupDeployment -Name ExampleDeployment -ResourceGroupName xxx -TemplateFile t.json

Write-Host "##vso[task.setvariable variable=pState;]$($r.ProvisioningState)"

Upvotes: 1

Related Questions