Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy GitLab web app to Azure app service

Hello guys am new with Gitlab and Azure , currently am having a repo on Gitlba and am trying to deploy it to Azure, but I can't manage to achieve this, tried to follow this link , but the information is old, Is there anyone with a latest link or resource to achieve this?

Thanks

like image 706
Idris Stack Avatar asked Dec 12 '25 14:12

Idris Stack


1 Answers

Joy's answer above is helpful. I've rewritten it to clarify the steps on obtaining a SSH 'deploy key'.

  1. Head over to your Gitlab repository and click the Clone button. Copy the Clone with SSH address.

    Gitlab Repository Clone Button

    Also, have your Gitlab account username and password available.

  2. In the Azure portal go to your web app resource and go to the Deployment Center. Choose the External option. We're going to use the 'App Service build service'. Next enter in the data from step 1. Click Continue to finish.

    Enter the data from step 1

  3. Next we're going to get the SSH 'deploy key'.

    1. First go to the Properties page and copy the Deployment Trigger Url field.
    2. Go back to the Deployment Center and click the Credentials button.
    3. Insert these credentials into your copied url, like so: https://$mysite:[email protected]/deploy
    4. Take the full deploy URL above, and replace /deploy with /api/sshkey?ensurePublicKey=1. So it'll look like: https://$mysite:[email protected]/api/sshkey?ensurePublicKey=1
    5. Run curl on this URL, which returns an SSH public key. It's returned as a JSON string, so you'll need to remove the quotes. It should look like:
      ssh-rsa AAAAB3NzaC1etc...
      Copy the key.

    (These steps are from the Kudu docs)

  4. In GitLab go to Settings -> Repository -> Deploy Keys and click Expand. Add a title and the SSH 'deploy key' here. Then save. Test it by going back to the Deployment Center in the Azure portal and clicking the Sync button. It should work.

    Adding deploy key to Gitlab

  5. Then we'll configure the continuous deployment. In your GitLab go to Settings -> Integrations -> write the URL (This is the same Deployment Trigger URL in Properties we used earlier) To save click the Add webhook button.

    Add Gitlab Integration

  6. Create a new file (or commit a change) in the GitLab project and it deploys to the web app automatically.

like image 50
Ryan Avatar answered Dec 15 '25 03:12

Ryan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!