So I'm trying to setup continues deployment for my web app. The web app is configured to use a docker image from Azure container registry:
Which creates a webhook in the Azure container registry, that I updated to be triggered for any image tag:
The webhook is triggered sucessfully whenever I push a new image to the registry. However, the web app ignores the tag name sent by the webhook and always deploys the image with latest
because it is defined in the web app configuration and there is no way to change it.
Request payload of the webhook:
{
"id": "6be524c6-xxxx-xxxx-xxxx-afb4fa79144b",
"timestamp": "2019-10-11T05:00:56.2452112Z",
"action": "push",
"target": {
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1153,
"digest": "sha256:8076c2616d4a629062aede0b7d2aa0f04d293126e55c7778149b9b8db3111382",
"length": 1153,
"repository": "platform-api",
"tag": "cf2ff96"
},
"request": {
"id": "bf18fce3-xxxx-xxxx-xxxx-aceebbffcfd0",
"host": "xxxx.azurecr.io",
"method": "PUT",
"useragent": "docker/18.09.3 go/go1.10.8 git-commit/774a1f4 kernel/4.15.0-1027-gcp os/linux arch/amd64 UpstreamClient(Docker-Client/18.09.3 \\(linux\\))"
}
}
Response:
{"OperationId":"690c7748-xxxx-xxxx-xxxx-31f5533e4067","TrackingUrl":"https://xxxx-platform-api.scm.azurewebsites.net/api/logstream?filter=op:690c7748-xxxx-xxxx-xxxx-31f5533e4067,volatile:false"}
Log stream of the container:
2019-10-10 22:35:08.451 INFO - a5fd76166a97 Extracting 2KB / 2KB
2019-10-10 22:35:08.939 INFO - a5fd76166a97 Pull complete
2019-10-10 22:35:08.983 INFO - Digest: sha256:595cb52395b914b82133d67f5e5424075f6325dc4c8be5673db59e09b279c78d
2019-10-10 22:35:09.027 INFO - Status: Downloaded newer image for xxxx.azurecr.io/platform-api:latest
2019-10-10 22:35:09.082 INFO - Pull Image successful, Time taken: 0 Minutes and 6 Seconds
2019-10-10 22:35:09.172 INFO - Starting container for site
2019-10-10 22:35:09.173 INFO - docker run -d -p 9758:8080 --name xxxx-platform-api_0_7d8217a9 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITE_SITE_NAME=xxxx-platform-api -e WEBSITE_AUTH_ENABLED=False -e PORT=8080 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=xxxx-platform-api.azurewebsites.net -e WEBSITE_INSTANCE_ID=a76a50ba664d5f979a92b87fa96814a39a02ad08ea740b7ba12f9ace3807d7f7 -e HTTP_LOGGING_ENABLED=1 xxxx.azurecr.io/platform-api:latest
2019-10-10 22:35:14.039 INFO - Initiating warmup request to container xxxx-platform-api_0_7d8217a9 for site xxxx-platform-api
2019-10-10 22:35:16.167 INFO - Container xxxx-platform-api_0_7d8217a9 for site xxxx-platform-api initialized successfully and is ready to serve requests.
It seems there is no way to force the web app to deploy the tag name sent by the web hook
Actually, you understand it correctly. The continues deployment in the Web App for Container only works for the image which you deployed.
You can create the Webhook for the actions which update the image and it will work as you want. But the web app just updates when the used image had changed. This is what the continues deployment works.