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

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

Related

Git Actions successful deployment does not update the revision of an Azure Container App

I have a simple Node.js app that I intend to deploy via Github Actions continuous deployment to an Azure Container App. The image is placed in an Azure Container Registry and is tagged as "latest".
My git Actions Pipeline successfully finishes (Screenshot 1). I can check the logs and see no errors. When I load the Container App in the browser, new changes are not provisioned and the old version is displayed. I can also see the new version of the image is uploaded to the Azure Container Registry (Screenshot 2). But when I open Revisions management I can see that the revision still has a date from an older deployment (Screenshot 3).
I am adding my deployment.yml as Screenshot 4 and Screenshot 5 because I couldn't figure out how to embed yaml code into the question without breaking the format

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,

How to automate Azure web app deployment to pick latest image from azure container

An Azure container registry is setup with a repository.
The Azure WebApp is published with Source specified as the container and the docker image tag is selected in the dropdown.
Using Jenkins the new build is made and the docker image is pushed to container repository in Azure.
But how to ensure the webapp automatically picks the latest image to be deployed.
Currently from the web app's deployment center we need to select the image and the latest pushed tag manually.
Locate your App Service, click Deployment Center, in the Settings tab, enable Continuous Deployment.
Documentation

Deploying a Docker Image from Azure Container Registry

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.

Best workflow to restart app service after a git push

Short version: How can I deploy a new version without first manually stopping the app-service?
Long version:
I'm using the following workflow to publish a new version of my ASP.NET Core app to an Azure App-Service.
The App-Service is running on a basic instance. I understand this is not intended for real use but I hope there is a good way to get this workflow running before we go into production(standard instance).
This works but how can I avoid step 4 to 7?
Publish the solution into a local folder.
Move the published content into a local git repo.
Commit all files and push to the app-service.
Stop the app-service from the portal
Enter the console and delete all files in the wwwroot folder
Redeploy the commit from the portal
Start the app-service
I was hoping that the push in step 3 would automatically trigger the remaining steps.
After step 3 I can see that the files have been updated, the new static files are served to the browser but the old binary is still running.
Similarly I can switch between deployment slots on the portal. I get the new static files served but the previous deployed binary is still answering all calls.
This doesn't work, the static files are changed but the old binary is still responding to calls.
Redeploy from portal
Restart app-service
The old binary is still served.
This works.
Stop app-service
Deploy from portal
Start app-service
It appears the running binary is blocking the deployment.
How can I automate deployment using git push or from the portal without manually having to stop the service?
Application settings:
You need to enable msdeploy flag MSDEPLOY_RENAME_LOCKED_FILES=1 in Azure App Service application settings. The option if set enables msdeploy to rename locked files that are locked during app deployment
Click application settings and scroll down until you see app settings.
set this key: MSDEPLOY_RENAME_LOCKED_FILES and for its value put 1
How can I deploy a new version without first manually stopping the app-service?
When I develop my .Net Core Web application via VS, I would leverage the publish wizard, check the option Remove additional files at destination and use the App offline support by setting EnableMSDeployAppOffline to true under the publish profile for publishing my application to Azure Web App.
Based on your current deployment workflow, I assume that you are using the Continuous Deployment to your Azure App Service with your local Git Repository. After I changed the source code, then commit the changes to the local repository, then push the source code to my web app remote repository, the source code would be built and copied to D:\home\site\wwwroot on Azure side. Details you could follow Local Git Deployment to Azure App Service.
For your step 1 to 3, I just push the code changes from the local repository to my app service remote repository. Azure would generate the deployment script for you to build your source code project and move the built content to D:\home\site\wwwroot. Moreover, you could Custom Deployment Script for your additional requirement.

Resources