azure - Kudu Deployment Script for ASP.NET Core 1.0 -


i'm developing asp.net core 1.0 application using visual studio code , can't/won't use built-in publishing tools in visual studio ide. have working asp.net 5 rc1 (dnx-clr-win-x86.1.0.0-rc1-update1) don't know how update asp.net core 1.0 , tools not seem updated yet.

for asp.net 5 rc1 used azure-cli package generate deploy.cmd file following command:

azure site deploymentscript --aspnet5 .\server\project.json -p .\server --aspnet5version "1.0.0-rc1-update1" --aspnet5runtime clr --aspnet5architecture x86 

i got following deploy.cmd file:

@if "%scm_trace_level%" neq "4" @echo off  :: ---------------------- :: kudu deployment script :: version: 1.0.6 :: ----------------------  :: prerequisites :: -------------  :: verify node.js installed node 2>nul >nul if %errorlevel% neq 0 (   echo missing node.js executable, please install node.js, if installed make sure can reached current environment.   goto error )  :: setup :: -----  setlocal enabledelayedexpansion  set artifacts=%~dp0%..\artifacts  if not defined deployment_source (   set deployment_source=%~dp0%. )  if not defined deployment_target (   set deployment_target=%artifacts%\wwwroot )  if not defined next_manifest_path (   set next_manifest_path=%artifacts%\manifest    if not defined previous_manifest_path (     set previous_manifest_path=%artifacts%\manifest   ) )  if not defined kudu_sync_cmd (   :: install kudu sync   echo installing kudu sync   call npm install kudusync -g --silent   if !errorlevel! neq 0 goto error    :: locally running "kudusync" work   set kudu_sync_cmd=%appdata%\npm\kudusync.cmd ) if not defined deployment_temp (   set deployment_temp=%temp%\___deploytemp%random%   set clean_local_deployment_temp=true )  if defined clean_local_deployment_temp (   if exist "%deployment_temp%" rd /s /q "%deployment_temp%"   mkdir "%deployment_temp%" )  if defined msbuild_path goto msbuildpathdefined set msbuild_path=%programfiles(x86)%\msbuild\14.0\bin\msbuild.exe :msbuildpathdefined :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: deployment :: ----------  echo handling asp.net 5 web application deployment.  :: remove wwwroot if deploying default location if "%deployment_target%" == "%webroot_path%" (     /f %%i in ("%deployment_target%") if "%%~nxi"=="wwwroot" (     set deployment_target=%%~dpi     ) )  :: remove trailing slash if present if "%deployment_target:~-1%"=="\" (     set deployment_target=%deployment_target:~0,-1% )   :: 1. set dnx path set dnvm_cmd_path_file="%userprofile%\.dnx\temp-set-envvars.cmd" set dnx_runtime="%userprofile%\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1"  :: 2. install dnx call :executecmd powershell -noprofile -nologo -executionpolicy unrestricted -command "[system.threading.thread]::currentthread.currentculture = ''; [system.threading.thread]::currentthread.currentuiculture = '';$cmdpathfile='%dnvm_cmd_path_file%';& '%scm_dnvm_ps_path%' " install 1.0.0-rc1-update1 -arch x86 -r clr %scm_dnvm_install_options% if !errorlevel! neq 0 goto error   :: 3. run dnu restore call %dnx_runtime%\bin\dnu restore "%deployment_source%" %scm_dnu_restore_options% if !errorlevel! neq 0 goto error  :: 4. run dnu bundle call %dnx_runtime%\bin\dnu publish ".\server\project.json" --runtime %dnx_runtime% --out "%deployment_temp%" %scm_dnu_publish_options% if !errorlevel! neq 0 goto error  :: 5. kudusync call %kudu_sync_cmd% -v 50 -f "%deployment_temp%" -t "%deployment_target%" -n "%next_manifest_path%" -p "%previous_manifest_path%" -i ".git;.hg;.deployment;deploy.cmd" if !errorlevel! neq 0 goto error )  ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::  :: post deployment stub if defined post_deployment_action call "%post_deployment_action%" if !errorlevel! neq 0 goto error  goto end  :: execute command routine echo out when error :executecmd setlocal set _cmd_=%* call %_cmd_% if "%errorlevel%" neq "0" echo failed exitcode=%errorlevel%, command=%_cmd_% exit /b %errorlevel%  :error endlocal echo error has occurred during web site deployment. call :exitseterrorlevel call :exitfromfunction 2>nul  :exitseterrorlevel exit /b 1  :exitfromfunction ()  :end endlocal echo finished successfully. 

this works asp.net 5 rc1 (dnx-clr-win-x86.1.0.0-rc1-update1) how update asp.net core 1.0? can point me working example of deploy.cmd asp.net core 1.0?

the azure cli updated soon, can use latest directly using kuduscript npm package. install using:

npm install -g kuduscript 

you can generate asp.net core script using (replace names appropriate):

kuduscript -y --aspnetcore src\aspnetcorevs\project.json -s aspnetcorevs.sln 

or if don't have solution file, can skip generates different script.

note in common cases, kudu should figure things out without scripts. custom scripts needed in more complex cases.


Comments