I am deploying a Blazor WASM (with ASP.NET server backing) using AZURE pipelines. I started out with .NET Core 3.1 and moved recently to .NET 5. I needed a Quick fix to get a version up and running why I deployed from visual studio on my desktop instead of through azure pipeline. After that no changes in my blazor pages (razor/razor.cs files) do go through to the published version when I use azure pipelines. Changes in static files (i.e. index.html) do go through. The files are however updated (dll's have correct timestamp). I have tried just adding some simple text as well as larger changes in my razor files but it does not affect the published version. When I change things in index.html I do see the changes in debug panel (F12 -> Network -> https://MyWebbApp.azurewebsites.net/ -> preview). Everything builds and publishes without errors. Here is my build pipeline:
trigger:
- master
pool:
name: 'Default_Win2019'
variables:
solution: '**/MyWebbApp.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.x'
- task: UseDotNet@2
displayName: 'Use .NET Core sdk 5.0.103'
inputs:
packageType: 'sdk'
version: '5.0.103'
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
inputs:
command: 'restore'
projects: '$(solution)'
feedsToUse: 'select'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishSymbols@2
displayName: 'Publish symbols path'
inputs:
SearchPattern: '**\bin\**\*.pdb'
PublishSymbols: false
continueOnError: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
And the release pipeline:
steps:
- task: AzureRmWebAppDeployment@4
displayName: 'Deploy Azure App Service'
inputs:
azureSubscription: '$(Parameters.ConnectedServiceName)'
appType: '$(Parameters.WebAppKind)'
WebAppName: '$(Parameters.WebAppName)'
enableCustomDeployment: true
ExcludeFilesFromAppDataFlag: false
I have tried to remove everything under C:\home\site\wwwroot using kudu, but that only resulted in nonfunctional webapp after redeploy. Using visual studio on the desktop is the only thing that works now. My understanding of the pipeline is limited and any comments on this is gratefully received. (it is after some time stitched together with help of others and pieces picked up here at SO) When I follow the deployed (azure pipeline) artifact back to the commit I can see the changes are in the code. If anyone know how to deal with this...?