0

We have Android/Apple pngs in the root as seen in the screenshot. Those icons are required in the root folder as some 404 requests were happening on mobile devices and including the icons in the root solves the issue. They are not committed to source control, which is why we don’t want the release pipeline to delete them when deploying a new build artifact.

The reason why they're not committed to source control is because they’re not actually used by the code, but sometimes there are requests for them from mobile devices, and those would throw 404 errors which would blow up the alerts channel. So they are just copied to the root for now to stop those 404 alerts.

image.png

During Release pipeline App Service Deployment, we need to make sure those files don't get overwritten. Here’s the current App Service Deployment YAML:

steps:

task: AzureRmWebAppDeployment@4
displayName: ‘Azure App Service Deploy: edge-dev’
inputs:
azureSubscription: ‘Azure Dev Service Connection’
WebAppName: ‘edge-dev’
packageForLinux: ‘$(System.DefaultWorkingDirectory)/Build Artifact/Release’
enableCustomDeployment: true
AdditionalArguments: ‘-skip:objectName=filePath,absolutePath=“Web.Dev.config|Web.Test.config|Web.Beta.config|Web.Prod.config|\*.zip” -retryAttempts:6 -retryInterval:10000’
enableXmlTransform: true

Is there some sort of option we can add so that the Android/Apple png files don't get overwritten? Currently every time a new build triggers the release deployment, the icons are removed and the developer has to keep uploading them manually after a deployment to ensure 404 errors don't occur.

halfer
  • 19,824
  • 17
  • 99
  • 186
Cataster
  • 3,081
  • 5
  • 32
  • 79
  • @KevinLu-MSFT would you be able to help me out with this post too? – Cataster Mar 20 '22 at 18:52
  • Using `-skip` in the AdditionalArguments option not work for you? Just like what have you did for the web.config in your previous thread: https://stackoverflow.com/questions/68228310/how-to-exclude-artifact-files-after-web-deployment – Leo Liu Mar 21 '22 at 07:06
  • @LeoLiu-MSFT I thought that's used to skip build artifact files, not files already deployed under wwwroot. – Cataster Mar 21 '22 at 14:54
  • @LeoLiu-MSFT I was looking into web deploy rules (https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-r2-and-2008/dd568992(v=ws.10)) and found the `-enableRule:DoNotDeleteRule` to be quite interesting given the context, i just am not sure how to apply it as an additional argument to skip the android/apple icon files: In a sync operation, blocks deletions of files on the destination computer that do not exist on the source computer. This rule applies to the contentPath, dirPath, and filePath providers. This rule is disabled by default. – Cataster Mar 23 '22 at 04:39
  • @LeoLiu-MSFT `-skip` works, so i posted answer for that, thanks! – Cataster Mar 27 '22 at 03:28

1 Answers1

0

Solution to prevent icon overwriting:

theres actually 2 ways:

  1. we could pass -enableRule:DoNotDeleteRule in Azure App Service Deploy Additional arguments. The DoNotDeleteRule rule blocks deletions of files on the destination computer that do not exist on the source computer. This rule applies to the contentPath, dirPath, and filePath providers.

  2. we could utilize the -skip:objectName=filePath,absolutePath=android-icon-144x144.png|android-icon-72x72.png|etc. in the Azure App Service Deploy Additional Argument. It also blocks deletions of files on the destination computer, and we already are using the argument today actually for some files like the web.config

    -skip:objectName=filePath,absolutePath="Web.Dev.config|Web.Test.config|Web.Beta.config|Web.Prod.config|android-icon-144x144.png|android-icon-192x192.png|android-icon-36x36.png|android-icon-48x48.png|android-icon-72x72.png|android-icon-96x96.png|apple-touch-icon-114x114.png|apple-touch-icon-120x120.png|apple-touch-icon-144x144.png|apple-touch-icon-152x152.png|apple-touch-icon-180x180.png|apple-touch-icon-57x57.png|apple-touch-icon-60x60.png|apple-touch-icon-72x72.png|apple-touch-icon-76x76.png|apple-touch-icon-precomposed.png|apple-touch-icon.png|favicon-16x16.png|favicon-32x32.png|favicon-96x96.png|apple-icon.png|ms-icon-144x144.png|ms-icon-150x150.png|ms-icon-310x310.png|ms-icon-70x70.png|\\*.zip"
    

    -retryAttempts:6 -retryInterval:10000

Cataster
  • 3,081
  • 5
  • 32
  • 79