从Azure DevOps部署到Azure Linux App服务无效

编程入门 行业动态 更新时间:2024-10-27 23:25:26
本文介绍了从Azure DevOps部署到Azure Linux App服务无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有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服务无效

本文发布于:2023-11-14 18:56:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1588265.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:DevOps   Azure   App   Linux

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!