简体   繁体   中英

enable Local git repo for azure webapp using powershell

Hi trying to publish code using FTP which is timecomsuming. Wanted to use local git repo. how can i enable local git repo using ARM cmdkets like new-azurermresource.

You can use the following PowerShell Commands to enable local git repo for your Web app. (I am using Azure PowerShell 1.6.0)

$a = Get-AzureRmResource -ResourceId /subscriptions/<subscription id>/resourcegroups/<resource group name>/providers/Microsoft.Web/sites/<web app name>/Config/web -ApiVersion 2015-08-01

$a.Properties.scmType = "LocalGit"

Set-AzureRmResource -PropertyObject $a.Properties -ResourceId /subscriptions/<subscription id>/resourcegroups/<resource group name>/providers/Microsoft.Web/sites/<web app name>/Config/web -ApiVersion 2015-08-01

The credential for the git repo is the same as the FTP's. And, the git repo URL is https://<FTP user name>@<web app name>.scm.azurewebsites.net:443/<web app name>.git

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM