Sync an Azure Web Site using Continuous Deployment with PowerShell

With the recent release of WordPress 4.5.2 and Project Nami 1.3.3, I was looking to script the sync of this web site as it’s using Azure continuous deployment and connected to the Project Nami source on GitHub. It took longer to find the solution that run it. Here’s the Azure PowerShell.

Import-Module AzureRM.Websites
$MyResourceGroup = 'myresourcegroupname'
$MyResourceName = 'myresourcename'
Invoke-AzureRmResourceAction -ResourceGroupName $MyResourceGroup -ResourceType Microsoft.Web/sites -ResourceName $MyResourceName -Action sync -ApiVersion 2015-08-01 -Force -Verbose