In this article we're going to discuss how to setup continuous integration with GitLab and Azure App Services. We're going to specifically focus in on synchronizing deployment from your Master branch to your Azure Apps. To learn how to setup CI/CD pipelines, check out this link!

Lets begin!

  1. Head over to the Microsoft Azure Portal and open up your Azure App Services
  2. Open the correct App Service
  3. Properly configure the Deployment Options under Deployment
  4. Next, we'll be gathering your Azure Apps "Deployment Trigger URL" and generating an SSH Key
  5. Navigate to the Properties panel and obtain the "Deployment Trigger URL". You will be using this URL as a Deployment URL and SSH-Key URL.
    • It should be a long URL that includes an access token and ends with: /deploy
    • Copy that URL twice to Notepad or somewhere else
    • In the second copy, swap out /deploy with /api/sshkey?ensurePublicKey=1 to obtain your SSH-Key URL
    • You will be using both of these URLs in the following steps
  6. Now that you have your Deployment URL and your SSH-Key URL, lets continue...
  7. Navigate to your Azure Apps Kudo Console
    • This is typically:
    • Once there, open up the Debug Console
    • In site/wwwroot run the following command: curl {{SSH-KEY URL HERE}}
    • Copy the RSA Key to your clipboard!
  8. Now, navigate to the repository in GitLab
  9. In the specific project repository, navigate to: Settings → Repository → Deploy Keys
  10. Create a new deploy key
    • Title = Deploy Key
    • Key = RSA Key you copied to your clipboard
    • Write Access = Allowed
  11. Next, in the specific project repository, navigate to: Settings → Integrations
  12. Setup a new integration
    • Push Events = Checked
    • SSL Verification = Checked
  13. Congratulations, you have successfully setup continuous integration between GitLab and Azure Apps!

Once your applications code updates run through all of the CI/CD pipelines, it will instantly be deployed into production!