The UI of the azure portal and the GitLab have changed, but the steps are still similar.
The link in the comment is helpful, I test it and works fine.
In order to prevent the link from failing in the future, I made some summary as below.
1.In the web app in the portal -> Deployment Center
-> External
-> App Service build service
-> write the information as below -> next to finish.
The Repository
you can get via the Clone
button in your GitLab project, the Username
and Password
is the ones of your GitLab account.
2.In your GitLab -> Settings
-> Repository
-> Deploy Keys
-> Expand
-> Add the key of the one in the https://<webapp-name>.scm.azurewebsites.net/api/sshkey?ensurePublicKey=1
(ssh-rsa xxxxxx
). Then you could test the Sync
in the Deployment Center
in the portal, it should work.
3.Then we config the continuous deployment, in your GitLab -> Settings
-> Integrations
-> write the URL
( you can get it in the web app -> Properties
-> Deployment Trigger URL
) -> Add webhook
.
4.Then I create a new file in the GitLab project, it deploys to the web app automatically.