I'm using this step in an Azure pipeline, to deploy a Blazor WebAssemby application.
I need to set some configuration values in the application, so I used this technique to inject some custom value (variable substitution using 'JSONFiles', I added the arrow, of course):
- task: AzureRmWebAppDeployment@4
displayName: 'Deploy BlazorAssemblyClient'
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '...'
appType: 'webApp'
WebAppName: $(blazorAppName)
packageForLinux: '$(System.ArtifactsDirectory)/tempBlazorAssemblyClient/**/*.zip'
-> JSONFiles: '**/appsettings.json'
I created variables matching what's inside the appsettings.json, so everything is fine, and I can check that the file has been correctly updated.
But, I see two problems, now: first, I get an error when browsing the application because the integrity of the file is not satisfied anymore.
Failed to find a valid digest in the 'integrity' attribute for resource 'https://.../appsettings.json' with computed SHA-256 integrity 'JqjyXWM4+hDsLD0kOHuOpJoNBrAMz5mlgQ7EuAbQb2M='. The resource has been blocked.
Second, there are two compressed (generated) corresponding files (extensions .br and .gz) that I can see not having been updated (of course, I can think, because they have been generated before updating the original appsettings.json.
It looks like this is not the correct way to inject custom values inside a configuration file (at least for a Blazor WebAssembly application): probably I should update the appsettings.json file before the application is generated. Any idea about how to solve this problem, or some other viable approach to it?
Thank you in advance.