VSTS 发布到 Azure 成功,但 url 不起作用

VSTS release to azure succeeded but url doesn't work

我有一个简单的 MVC 应用程序。在 VSTS 中,构建成功,发布到 Azure WebApp 也成功。但是 azure url 不起作用。应用程序在本地运行和工作。 Azure WebApp 看起来也不错。不确定它是否与 Azure 或 VSTS 发布管道有关。 Azure WebApp 是否支持 运行 MVC 应用程序?

我的 VSTS 发布管道:

首先,MVC应用程序(Visual Studio中的MVC模板项目)可以运行在Azure Web App上。

其次,Azure App Service Deploy 任务的 App Service URL 选项为 AzureRM Web App 的变量提供一个名称,如 FabrikamWebAppURL主持 URL。该变量可以作为$(variableName),像$(FabrikamWebAppURL)一样在后续任务中引用AzureRM Web App的Hosted URL,例如PowerShell .

第三,您可以参考以下步骤来构建和部署应用程序:

  1. NuGet 工具安装程序(要安装的 NuGet.exe 版本:4.3.0)
  2. NuGet 恢复
  3. Visual Studio 构建(MSBuild 参数:/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)"
  4. 发布构建工件(发布路径:$(build.artifactstagingdirectory)
  5. 创建新的发布定义
  6. Azure 应用服务部署(包或文件夹:$(System.DefaultWorkingDirectory)/**/*.zip