1

I have a web app service inside a registry up and running with a two docker image/container.

I pushed docker image with the latest changes and it shows that my docker image has been pushed.

One strange thing that I suspect is that docker image has been appended (because my registry size has been increased with every push --> double the size of the container on each push)

I wanna run web app service with the latest changes but it is pointing to the first deploy. I verified checking webhooks they have latest code push but they have status code 400 with red exclamation. I think this is the issue.

Not really sure what went wrong here.

Help Please !!!!!!

Ajay GC
  • 33
  • 1
  • 6

1 Answers1

0

I've run into a similar problem where the deploy shows that it successfully pushed the new image but the old code was still in use. I added an explicit step at the end to restart the app as a workaround since this seems to force the app to reach out for the latest image.

- task: AzureRmWebAppDeployment@4
  displayName: "Deploy: ${{ parameters.APP_NAME }}"
  inputs:
    appType: "${{ parameters.DEPLOYMENT_APP_TYPE }}"
    azureSubscription: "${{ parameters.AZURE_SUBSCRIPTION }}"
    ConnectionType: "AzureRM"
    DockerImageTag: "${{ parameters.DOCKER_IMAGE_TAG }}"
    DockerNamespace: "${{ parameters.DOCKER_NAMESPACE }}"
    DockerRepository: "${{ parameters.DOCKER_IMAGE_REPOSITORY }}"
    WebAppName: "${{ parameters.APP_NAME }}"

  - task: AzureCLI@2
    displayName: "Azure CLI: Restart App [${{ parameters.APP_NAME }}]"
    inputs:
      azureSubscription: "${{ parameters.AZURE_SUBSCRIPTION }}"
      scriptType: bash
      scriptLocation: inlineScript
      inlineScript: |
        #!/bin/bash

        APP_TYPE="${{ parameters.APP_TYPE }}"
        NAME="${{ parameters.APP_NAME }}"
        RESOURCE_GROUP="${{ parameters.RESOURCE_GROUP }}"

        echo "Restarting the app [${NAME}] in [${RESOURCE_GROUP}]..."

        case ${APP_TYPE} in
        Web)
            az webapp restart \
                --name "${NAME}" \
                --resource-group "${RESOURCE_GROUP}"
            ;;
        Function)
            az functionapp restart \
                --name "${NAME}" \
                --resource-group "${RESOURCE_GROUP}"
            ;;
        *)
            echo "Unknown App Type [${APP_TYPE}]. Unable to restart the app."
            exit 1
            ;;
        esac