Is it possible to configure a source control repository to deploy code to an Azure Web App slot via Powershell. (or even just the primary site)
Ideally for v2 / ARM but I'm willing to consider anything at the moment!
I have looked through the commands available in AzureRM.Websites module and there doesn't appear to be anything.
P.S. I know this is possible via template, I am currently looking for pure Powershell commands.
You can do it using the 'low level' ARM CmdLets. e.g. for the main site:
$props = @{
RepoUrl = $repoUrl
Branch = "master"
}
New-AzureRmResource -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Web/sites/SourceControls -Name $SiteName/Web -PropertyObject $props -ApiVersion 2015-08-01 -Force
And for a slot (using same $props
):
New-AzureRmResource -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Web/sites/slots/sourcecontrols -Name $SiteName/$SlotName/Web -PropertyObject $props -ApiVersion 2015-08-01 -Force
See also sample helper method here. That one sets IsManualIntegration = true
, which is for repos you don't own, and requires a manual sync. For continuous deployment, leave IsManualIntegration
out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With