How to configure github etc. For Azure via Powershell

Is it possible to configure the source management repository to deploy code to the Azure Web App slot through Powershell. (or even just the main site)

Ideally for v2 / ARM, but I'm ready to consider something at the moment!

I looked at the commands available in the AzureRM.Websites module and there seems to be nothing.

PS I know that this is possible through a template, I'm currently looking for pure Powershell commands.

+6
source share
2 answers

You can do this using the "low level" ARM CmdLets. for example 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 the slot (using the 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 an example helper method here . This parameter sets IsManualIntegration = true , which is intended for inactive repositories and requires manual synchronization. For continuous deployment, leave IsManualIntegration out.

+4
source

You need to use the New-AzureRmResource command .

 $webappname = "name of your webapp" $RepoUrl = "https://github.com/davidebbo-test/Mvc52Application.git" $branch = "master" $location = "location of your webapp " $resourceGroupName = "name of resource group with your webapp" New-AzureRmResource -Location $location -Properties @{"RepoUrl"="$RepoUrl";"branch"="$branch";"IsManualIntegration"="true"} -ResourceName $webappname -ResourceType Microsoft.Web/sites/sourcecontrols/web -ResourceGroupName $resourceGroupName -ApiVersion 2015-08-01-preview 
+2
source

All Articles