2

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 1

2

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

Sign up to request clarification or add additional context in comments.

5 Comments

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
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.
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 ???
i can enable github also as local git just by replacing localgit with github for scmtype ?
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.