Search This Blog

2021-03-02

Configure Git Lab CI/CD for Azure Web App

Step 1. Setup Gitlab project and install runner

a). Download Gitlab Runner (x86)

https://docs.gitlab.com/runner/install/windows.html

b). Copy the runner in new folder and rename the exe as gitlab-runner.exe

C:\Work\Gitlab\gitlab-runner.exe

c).Create new project in gitlab website- MyPoC

Step 2. Collect registration token from git lab project- MyPoC

Step 3: Register Gitlab runner, using token collected in last step



Step 4. Check the runner registration, install runner and start it

The registration command will generate config.toml in the location C:\Work\Gitlab


Step 5. Check there is no warning sign in gitlab



Step 6. Check there is no warning sign in gitlab



Step 7. Clone from repo and create .net core project

  • Clone MyPoC
  • Create new .NET core project “Runner_PoC” with Docker Support under that repo
  • Move docker file to the root directory
  • Add gitignore and yml

Step 8. Check the Docker File Content which will be looked like as below




Step 9. Create gitlab-ci.YML File as below 



Step 10. Set YML Variable Value







Step 11. Write the user name without any special char and all  required permissions




Step 12. Add variable for user id and password


Step 13. All the YML variable are added


Step 14. Push the code in git repo

Push the code in git repo
Check the pipeline and then container registry


Step 15. Azure Web App Configuration


Step 16. Check git lab





Step 17. Copy the webhook URL


Step 18. Click on the webhooks in gitlab



Step 19. Paste the webhook URL in Git


Step 20. Check Azure and browse the website

Push the code
Check the log in App Service -> Container settings and check the logs




No comments: