简体   繁体   中英

Azure webapp add deploymentLocalGitUrl after create

I'm trying out https://docs.microsoft.com/nl-nl/azure/app-service/app-service-web-get-started-html and of course, I'm not following stuff to the letter.

I already have a webapp (and the resource plan and stuff). I just want to want to add the local git stuff. There's this property deploymentLocalGitUrl that should be there when I list the properties of the app in the CLI, but it's not there. How can I add this, either through the CLI or the dashboard?

Thanks in advance.

Cheers, Eric!

gitdirectory=<Replace with path to local Git repo>
username=<Replace with desired deployment username>
password=<Replace with desired deployment password>

After creating webapp on azure, configure the website for deployment via git. Set the account-level deployment credentials.

$ az webapp deployment user set --user-name $username --password $password

This command will return the Git endpoint to push to which includes the UserName.

$ az webapp deployment source config-local-git --name mywebapp --resource-group myResourceGroup

It returns as below:

{
  "url": "https://username@mywebapp.scm.azurewebsites.net/mywebapp.git"
}

With the endpoint in hand, cd to the git repo and set up a new remote in Git named azure.

$ cd $gitdirectory    //remember to git init before you cd

$ git remote add azure https://username@mywebapp.scm.azurewebsites.net/mywebapp.git

Finally, you could deploy the application to azure.

git push azure master

The properties you could see in portal as below: 在此输入图像描述

For more details, you could refer to this article and this one .

It is a normal situation.

Per my test, you could refer to the screenshots.

I created a web app with --deployment-local-git , we could find the deploymentLocalGitUrl in the operation result.

在此输入图像描述

Then I use az webapp show -n <webappname> -g <resourcegroupname> to get the properties of the web app. We will not see the deploymentLocalGitUrl .

在此输入图像描述

But we could find it in the azure portal.

在此输入图像描述

So, if you want to add the property, you could set it in the azure portal.

在此输入图像描述

After setting it, you will be able to find the property mentioned in the screenshot above.

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