iisazure-pipelines

How to specify an app_offline template when using IISWebAppDeploymentOnMachineGroup?


I'm deploying a .NET 8 app (API in this case) through Azure DevOps Server 2022 to a Win Server 2022 with IIS.

Here is the yaml code:

- task: IISWebAppDeploymentOnMachineGroup@0
  inputs:
    WebSiteName: ${{ parameters.webSiteName }}
    Package: '$(System.ArtifactsDirectory)/${{ parameters.artefactName }}/*.zip'
    RemoveAdditionalFilesFlag: true
    TakeAppOfflineFlag: true

This works as expected, even the TakeAppOfflineFlag. However, I can't seem to figure out how to specify an app_offline file to use for this task. I always end up with an empty page, which is fine for the API, but I need to deploy a web app later.

The response is an html page with a body tag containing "Adding additional hidden content so that IE Friendly Errors don't prevent this message from displaying (note: it will show a ' friendly' 404 error if the content isn't of a certain size)."

I have tried the following:

Any ideas? Thank you in advance.


Solution

  • You are not the first to ask about this,

    https://github.com/microsoft/azure-pipelines-tasks/issues/13231

    There are workarounds mentioned such as adding your own steps to fully control the app offline page.