Deployment to Azure Linux App services from Azure DevOps has no effect

邮差的信 提交于 2020-04-16 05:55:30

问题


I have an Angular 8 + asp.net core 3.1 application generated by Visual Studio 2019.

I tried to deploy the application as is without modification on the Azure Linux App Service by using a VS 2019 Publish and the application gets deployed with no issue and I can access the application from web browsers on the <app-name>.azurewebsites.net url

When deploying the application from an Azure release pipeline with the Azure App Service deploy Task, the deployment occurs with no errors but when requesting <app-name>.azurewebsites.net I get the default site as in the following screenshot

It seems that the deployment has no effect from Azure DevOps. What am I doing wrong?

Details

Build pipeline

trigger:
- master

pool:
  vmImage: 'windows-2019'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: Npm@1
  displayName: 'npm install'
  inputs:
    command: 'install'
    workingDir: 'MyApp/ClientApp'
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  displayName: 'nuget restore'
  inputs:
    restoreSolution: '$(solution)'
- task: Npm@1
  displayName: 'ng build'
  inputs:
    command: 'custom'
    workingDir: 'MyApp/ClientApp'
    customCommand: 'run build'

- task: DotNetCoreCLI@2
  displayName: 'dotnet build release'
  inputs:
    command: 'build'
    arguments: '-c $(buildConfiguration)'

- task: DotNetCoreCLI@2
  displayName: 'dotnet publish'
  inputs:
    command: 'publish'
    publishWebProjects: true
    arguments: '-r linux-x64 -c release --output $(build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact Website'
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'MyAppDropDir'
    publishLocation: 'Container'

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact ARM Template'
  inputs:
    PathtoPublish: '$(Build.SourcesDirectory)/MyApp.AppService'
    ArtifactName: 'ARMTemplate'
    publishLocation: 'Container'

Release Pipeline


回答1:


One thing you could do is goto the Kudu console of the deployed web application and see if the actual code has been deployed.

For eg: https://.scm.azurewebsites.net/ where name is the name for your web app.

Also as I see you need to set up a startup command on the release pipeline as dotnet aspnet-core-dotnet-core.dll

Another thing you could try is by setting a new Devops Project and then replace the source code with your repository. You can navigate to Azure portal -> Devops Project, you can pick .Net and then Core3 as the template just to see what went wrong




回答2:


make sure you run a startup command either in portal.azure.com in configuration settings or from within the devops.

dotnet your-project-name.dll

I hope it helps



来源:https://stackoverflow.com/questions/59489489/deployment-to-azure-linux-app-services-from-azure-devops-has-no-effect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!