我正在使用VSTS和Azure为我的MVC Web App学习CI / CD。构建成功,部署(到Azure中的特定插槽)成功,但是当我导航到Web应用程序URL时,我仍然显示默认主页。
2017-11-01T17:25:09.6208009Z ==============================================================================
2017-11-01T17:25:09.6218009Z Task : Azure App Service Deploy
2017-11-01T17:25:09.6218009Z Description : Update Azure WebApp Services On Windows, Web App On Linux with built-in images or docker containers, ASP.NET, .NET Core, PHP, Python or Node based Web applications, Function Apps, Mobile Apps, Api applications, Web Jobs using Web Deploy / Kudu REST APIs
2017-11-01T17:25:09.6218009Z Version : 3.3.19
2017-11-01T17:25:09.6218009Z Author : Microsoft Corporation
2017-11-01T17:25:09.6218009Z Help : [More Information](https://aka.ms/azurermwebdeployreadme)
2017-11-01T17:25:09.6218009Z ==============================================================================
2017-11-01T17:25:13.2363661Z Got connection details for Azure App Service:'rsbi'
2017-11-01T17:25:22.3031769Z [command]"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='d:\a\r1\a\myapp-ASP.NET (PREVIEW)-CI\drop\myapp.zip' -dest:auto,ComputerName='https://myapp.scm.azurewebsites.net:443/msdeploy.axd?site=myapp',UserName='********',Password='********',AuthType='Basic' -setParam:name='IIS Web Application Name',value='myapp' -enableRule:AppOffline -enableRule:DoNotDeleteRule -userAgent:VSTS_945126af-40d2-8ab2-c875fd19e0af_release_1_1_1_1
2017-11-01T17:25:23.2157103Z Info: Using ID '8cb6f243-2593-4653-abd3-6666df1d45d4' for connections to the remote server.
2017-11-01T17:25:41.2558582Z Info: Adding ACL's for path (myapp)
2017-11-01T17:25:41.2558582Z Info: Adding ACL's for path (myapp)
2017-11-01T17:25:41.3594685Z Total changes: 2 (0 added, 0 deleted, 2 updated, 0 parameters changed, 0 bytes copied)
2017-11-01T17:25:41.3714688Z Successfully deployed web package to App Service.
2017-11-01T17:25:45.0533462Z Successfully updated deployment History at https://myapp.scm.azurewebsites.net/api/deployments/11509557141986
2017-11-01T17:25:45.0703260Z ##[section]Finishing: Deploy Azure App Service to Slot
2017-11-01T17:25:45.0793254Z ##[section]Finishing: Release
如果我查看Kudu中的Web App调试控制台,我可以看到我的所有内容都已部署:
11/01/2017 05:25 PM <DIR> .
11/01/2017 05:25 PM <DIR> ..
11/01/2017 02:12 PM <DIR> bin
11/01/2017 02:12 PM <DIR> Content
11/01/2017 02:12 PM <DIR> ExternalAssemblies
11/01/2017 02:12 PM <DIR> fonts
11/01/2017 02:12 PM <DIR> Scripts
11/01/2017 02:12 PM <DIR> Views
11/01/2017 10:31 AM <DIR> webapps
11/01/2017 02:11 PM 7,293 ApplicationInsights.config
11/01/2017 02:11 PM 32,038 favicon.ico
11/01/2017 02:11 PM 114 Global.asax
11/01/2017 02:11 PM 6,432 Web.config
6 File(s) 50,508 bytes
9 Dir(s) 53,635,162,112 bytes free
D:\home\site\wwwroot>
答案 0 :(得分:1)
主页与JAVA相关的原因是 wwwroot 文件夹中有 webapps 文件夹,并且您在应用程序设置中指定了 Java版本页面,更多信息,您可以查看There's nothing here yet after deploying Java Web App on Azure主题。
因此,您需要删除此文件夹并关闭Java版本。
关于java web job,你不需要在Application Settings中指定Java Version,你可以创建批处理文件并设置Path环境变量,然后调用java命令,例如(将包文件夹包含到zip文件中,并指定主类的全名):
set PATH=%PATH%;%JAVA_HOME%/bin
java [package].[main class name]