Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continuous deployment to Azure of ASP.NET Core app

I'm trying to set up continuous deployment (.NET Core 1.1 Web Application) with the build mechanism of VSTS.
To do so I'm following the steps displayed on the official doc of Microsoft : Use VSTS to Build and Publish to an Azure Web App with Continuous Deployment.

The first 3 steps (restore/publish/zip) work without any issue. But the fourth step is failing. I'm not able to publish the app to my Azure App Service.
Here is the error (from the log) :

2016-12-22T14:12:13.1175907Z Got connection details for azureRM WebApp:'devoteamlogin-staging'
2016-12-22T14:12:13.5419583Z Running command: "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:getParameters -source:package="C:\a\1\a\DevoteamLogin.zip" > "C:\a\1\s\parameter.xml"
2016-12-22T14:12:14.8449274Z Error Code: ERROR_EXCEPTION_WHILE_CREATING_OBJECT
2016-12-22T14:12:14.8449274Z More Information: Object of type 'package' and path 'C:\a\1\a\DevoteamLogin.zip' cannot be created.  Learn more at: 
2016-12-22T14:12:14.8449274Z Error: The Zip package 'C:\a\1\a\DevoteamLogin.zip' could not be loaded.
2016-12-22T14:12:14.8449274Z Error: Package file 'C:\a\1\a\DevoteamLogin.zip' is not in a supported .zip format and therefore cannot be read.
2016-12-22T14:12:14.8449274Z Error count: 1.
2016-12-22T14:12:14.8509276Z ##[error]TypeError: Cannot read property 'output' of null
2016-12-22T14:12:14.8589281Z ##[section]Finishing: Deploy AzureRM App Service: devoteamlogin-staging

Step details

Am I missing something somewhere ? I did exactly what the documentation says (same variables, same steps, same configuration).

Update: After making some new tests, I see that the 'dotnet restore' command does not restore anything because it does not find the project.json. But there is no project.json file anymore in the new ASP.NET Core 1.1 Web application (everything is in the .csproj file).

warn : The folder 'C:\a\1\s' does not contain a project to restore.

like image 960
Thibault Avatar asked Oct 29 '22 15:10

Thibault


2 Answers

Here is a solution https://twitter.com/DonovanBrown/status/816380372028002304. This shows the requirements to build csproj projects with Team Services. It is a full working solution.

like image 85
Donovan Avatar answered Nov 09 '22 05:11

Donovan


I think the format of your zip archive is wrong, I used the native archive file task instead and unchecked "Prefix root folder name to archive paths".
Also I followed the documentation from the Visual Studio Team instead of the one from the dotnetcore team. It works better I found.

like image 40
baywet Avatar answered Nov 09 '22 06:11

baywet