Deploying a Docker Image from Azure Container Registry - azure

I have pushed a working docker image to Azure Container Registry. I followed this tutorial to deploy it as a web application.
I followed the steps and it created a new web application, but it does not contain any files other than default Azure html that says Your App Service app is up and running. I am trying to figure out what went wrong. I checked the Activity logs and it says nothing. I checked the debug console <my-site>.scm.azurewebsites.net, and it does not contain any of the Docker Image files. How can I check what went wrong during the deployment?
Here is what I did.
I created a docker image, let's just call it my-image.
I checked it is working fine on my local machine.
I created a new tag to push the image to acr, docker tag <my-image_id> my-acr-username.azurecr.io/my-image.
Then I pushed it to acr, docker push my-acr-username.azurecr.io/my-image
I checked the acr repository to verify if it is pushed successfully.
Then I followed the above mentioned tutorial to deploy the image.
P.S. I am using Windows Containers.

I was using Windows Containers, and it turns out that Azure does not have a support for it yet. Unfortunately, it does not give you any errors or warnings if you try to deploy Windows Container. It simply doesn't work, and the user wonders what went wrong...
Here is my issue on their deployment engine Kudu.

Related

Azure Web App (Linux) running old files compare to ACR artefact

WebApp is configured to fetch artefact from ACR as part of CI/CD.
The WebApp seems to be running old file compare to what the ACR artefact has (verified by pulling it down from ACR to localhost).
Have performed following actions:
Restarted WebApp
Re-constructed artefacts (by deleting them first).
Changed deployment centre settings and reverted back to original ones.
Opened the link in Private mode.
No caching options are set either.
Despite all the actions Web App is running an old file and when I SSH into the Web App file contents are old not what ACR artefact has.
There seems to be a compatibility issue with Azure WebApp supporting Docker Image FROM node:18.14-alpine3.17. Please use FROM node:18.13-alpine3.17

Azure app service not pulling latest image from docker registry

I have a pipeline that publishes to my private Azure container registry but if I push a new image tagged with latest, my Azure app service does not pull the newly tagged latest image. I have Continuous deployment turned on via the DOCKER_ENABLE_CI app setting.
Additionally, I'm using a managed identity to authenticate with the ACR. I feel like the CD portion was working when I was using credentials to pull the image but after switching to managed identity it appears to have stopped. In order to get the new image I have to restart the app service which is not idea and makes this CD option useless...
When you enable Continuous deployment, App Service adds a webhook to your ACR to notify the web apps. The webhook causes your App Service app to restart and run the docker pull to get the updated image.
So, please go to your ACR, and under webhook, please check if there are running webhooks or not, if not you can create a webhook manually and see if the WebApp get the latest image in the following deployment.
source

How to get Docker Images from Azure container registry and run onpremise servers using docker-compose?

I am using azure devops for CI/CD pipelines and one thing I couldn't find out, getting images from Azure container registry and run those images inside of my onpremise debian server. (I build and pushed the images to ACR already).
On release pipeline section:
I set Azure Container repository as source type and selected the latest artifact from there
then created a dev stage
Added a Command line tool to execute some scripts on server
-->This is the step where I lost<-- I need somehow to get these image from repository and fire compose up command in the server.
Extra info: you cannot use your docker-compose.yml(which mine is inside of the azure repo in same project) because you are using ACR as source type, not the build itself or source code.
*in my humble opinion this is a good case to enrich a content. Because there is lack of docs and videos on internet.
thanks,

I can't choose image in Azure Container Registry

I created Container Registry, Web App for Containers and published image from Visual Studio but I don't see any image on the list? Why?
For your issue, I see that there is a refreshed symbol in the screenshot you provided. When you select the Registry server, there will be a process to read the registry and the process will cost a little time. So you need to wait a while.
And on my site, the Azure Container Registry works fine for the Web App for Container, you can see it here:
If any more question, you can give me the message.

Azure app service docker container 'Service Unavailable'

I have followed the tutorials for building a .net core web application into a docker image, publishing to an azure container registry, and then I have setup my VSTS Release template to deploy the container to the app service.
This all appears to work, I can view my image in the container registry, and the deployment appears to succeed - but when navigating to the app service site, all I get is an HTTP 503 - Service unavailable.
The app service is started, I can see deployments in my file system via bash - so I wondered if I am missing something?
I do not have a 'startup' command in any of my templates, I wondered if it could be this?
The site works perfectly from VS2017, including debugging via docker, so it really is just a case of... how do I get the App Service to actually load and execute the image?
Thank you!
EDIT
Further to this, I have got access to the docker diagnostics logs which claim "image operating system "windows" cannot be used on this platform".
My base image is the microsoft/aspnetcore:2.0 image, which runs perfectly fine on my linux container in my development environment... but appears to not work in the Linux App Service?
Is the aspnetcore:2.0 base image not suitable for a linux app service?
I ended up resolving this week, hopefully the answer will help others.
When using VSTS Hosted build agents to produce images running off the docker base microsoft/aspnetcore:latest - unless you use the (Linux Preview) hosted build agent, you will get produced a windows container, which will not run on the linux app services.
Once I switched to using the hosted linux build agent, the container successfully loads, and my issue is resolved.
Another solution for the same error message:
Try microsoft/aspnetcore (without the tag/version :2.0) as image. If that doesn't work, check the docker logs as mentioned above and look for a solution based on the exact error (usually a missing dependency).

Resources