简体   繁体   中英

Publish MVC Web App to Azure using VSTS

I am learning CI/CD using VSTS and Azure for my MVC Web App. The build is successful, the deployment (to a specific slot in Azure) is successful, but when I navigate to the web app URL I'm still presented with the default home page.

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

If I look at the Web App debug console in Kudu, I can see all of my content has been deployed:

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> 

The reason the home page related to JAVA is that there is webapps folder in wwwroot folder and you specify the Java Version in Application Settings page, more information, you can check There's nothing here yet after deploying Java Web App on Azure thread.

So, you need to remove this folder and turn off Java version.

Regarding java web job, you don't need to specify Java Version in Application Settings, you can create batch file and set Path environment variable, then call java command, for example (include package folders into zip file, and specify the full name of main class):

set PATH=%PATH%;%JAVA_HOME%/bin
java [package].[main class name]

A related blog: Executing Java Web Jobs on Azure

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM