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.
1 Answer
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
5 Comments
user6936970
thanks jack .. am facing prob now while pushing code ... fatal: Authentication failed for '[email protected] websites.net:443/copycode12.git/' can you let me know what cred to pass and how ... shareeditundeleteflag
Jack Zeng
The credential is the same as the FTP's, if you have ever set it through the portal. If no, you can set it through Azure Portal. App Service -> <your app> -> Deployment Credential under "App Deployment" -> Enter your username, password, and then click Save.
user6936970
Yeah i have set it from portal and able to deploy for one app .. now i have more than one webapps.. i need to push code to all of these using same username without recreating[assuming one username created can be used for all webapps under the same subscription]. username and pwd.. am saved using cred manager username and pwd while pushing to first but while pushing to second webapp it is again prompting for cred.. how can i suppress?? in short i would like to save single username and pwd and deploy to all webapps ???
user6936970
i can enable github also as local git just by replacing localgit with github for scmtype ?
Jack Zeng
That's quite a different question. You can create a new question and describe it in detail. GitHub Repo for Azure web apps is involved with entering credential in Azure portal, and setting Repo URL. It's difficult to answer in a comment.