我有Visual Studio 2019生成的Angular 8 + asp core 3.1应用程序.
I have an Angular 8 + asp core 3.1 application generated by Visual Studio 2019.
我尝试通过使用VS 2019 Publish在Azure Linux App Service上按原样部署应用程序 ,并且应用程序部署没有问题,并且我可以从Web访问该应用程序浏览器上的<app-name>.azurewebsites网址
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 url
当使用Azure App Service deploy任务从Azure发布管道部署应用程序时,部署会顺利进行,但是当请求<app-name>.azurewebsites时,我将获得默认站点,如以下屏幕截图所示
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 I get the default site as in the following screenshot
该部署似乎不受Azure DevOps的影响.我在做什么错了?
It seems that the deployment has no effect from Azure DevOps. What am I doing wrong?
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'发布管道
推荐答案
您可以做的一件事是转到已部署的Web应用程序的Kudu控制台,查看是否已部署实际代码.
One thing you could do is goto the Kudu console of the deployed web application and see if the actual code has been deployed.
例如:.scm.azurewebsites/,其中name是您的Web应用程序的名称.
For eg: .scm.azurewebsites/ where name is the name for your web app.
我也看到您需要在发布管道上将启动命令设置为 dotnet aspnet-core-dotnet-core.dll
Also as I see you need to set up a startup command on the release pipeline as dotnet aspnet-core-dotnet-core.dll
您可以尝试的另一种方法是设置一个新的Devops项目,然后将源代码替换为您的存储库.您可以导航到 Azure portal -> Devops Project ,可以选择.Net,然后选择Core3作为模板,以查看发生了什么问题
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
更多推荐
从Azure DevOps部署到Azure Linux App服务无效
发布评论