I'm attempting to upgrade my API from .NET Core 2.2 to 3.0, but I cannot get the Azure Web App to actually run the application using 3.0.
My build pipeline configuration:
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core 3'
inputs:
version: 3.x
- script: dotnet tool install --global dotnet-ef
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- task: efcore-migration-script-generator-task@0
inputs:
projectpath: 'Models/Models.csproj'
databasecontexts: 'DataContext'
startupprojectpath: 'Api/Api.csproj'
targetfolder: '$(build.artifactstagingdirectory)/migrations'
- script: dotnet publish --output $(Build.ArtifactStagingDirectory)
displayName: 'dotnet publish $(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
I then have a multi-stage release pipeline that publishes the artifact to Azure using the Azure App Service Deploy
Task. Everything runs without issue
I've installed the preview extension, as directed here, and running the powershell command Test-Path D:\home\SiteExtensions\AspNetCoreRuntime.3.0.x86\
returns true
. I'm still seeing the following error though.
ANCM Failed to Find Native Dependencies
Back in Powershell, running dotnet --version
and dotnet --list-runtimes
shows that it only recognizes .NET Core 2 runtimes, despite the 3.0 runtime being present. As best I can tell, installing the site extension doesn't update the path to use the new dotnet
version, and the Azure Devops deploy task doesn't seem to have any options to override the default. Has anyone managed to get a .NET Core 3 app deployed through Azure Devops Release Pipelines?