Continuous deployment with Web App for Containers
In this article we will see how can create a Azure Web app for container (on Linux) and setup an docker / custom image on it.
Once that it done we shall automate the deployment which will be triggered and deployed to our web app as soon as we push the container image to our Azure Container Registry
Setting up Docker :
- Download docker CLI or docker for windows.
- Signup for a docker account.
- Login to docker / CLI on your PC.
- Download any container image from Docker hub to local using CLI.
- Tag the image.
- Verify image is up and running on local.
Setting up Azure Container Registry:
- Create an Azure Container Registry.
- Login to Azure Container Registry from docker.
- Map the Tagged container image with Azure Container Registry account with a repository name and tags.
- Push the local docker image to Azure Container
Setting up Azure Web app for container for that Image:
- Create Web app for container.
- In Docker Container option, select the Azure Container registry.
- Select the values for Registry, Image, Tag & hit Save.
- Restart the Web App. (optional)
- Browser the web app to see if the image is up and running on Web app.
Setting up Continuous Deployment for Azure Web app for container for that Image:
- Enable the auto deployment mode on Web app.
- Get the service URL from publishing profile.
- Go to Azure Container Registry & create Web hook.
- Fill up the values and save and do a test ping.
Verifying Continuous Deployment:
- Go to Docker CLI.
- Modify the image or give the same tag mapping to any other image.
- Push the image to Azure Container
- Restart the Web app.
- Browse the web app to see that new image is up and running.
- After some time, the auto deployment logs are visible in the Azure Container Registryà Web hook à Logs/events
So, if you haven’t sleep so far, let’s see it in action my next Post here :
continuous deployment with web app for containers using azure container registry -part-2