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:
app_offline
file at the root of inetpub
appOfflineTemplate
in the task input AdditionalArguments
, but to not avail. It does not generate the same command as in the link and msdeploy
simply fails with the code 4294967295 and that -appOfflineTemplate
is not recognized. Example: "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='REDACTED' -dest:contentPath='REDACTED' -enableRule:AppOffline -appOfflineTemplate=app_offline-template.htm
. Attempted values:
AdditionalArguments: -appOfflineTemplate=C:\inetpub\app_offline-template.htm
AdditionalArguments: -app_offline-template.htm
Any ideas? Thank you in advance.
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.