So I have my new ASP.Net core web application running and I followed the steps outlined in this quick start. The gulp.js file in the project deploys all the needed scripts to the wwwroot/lib folder and all the typescript transpiled scripts to the wwwroot/appScripts.
Since these files are generated I ignore them in git.
The problem is that when the solution deploys to Azure (using git) the gulp.js file doesn't execute so those files are never created.
What is the correct way to execute the gulp.js file when deploying to Azure?
I was able to get this working yesterday and here is how I did it.
1) Log into your kudu site (not sure what else to call this) for your Azure website. The url will be https://[your website].scm.azurewebsites.net/
On that site go to tools -> download deployment script
Extract the two files from the zip (.deployment and deploy.cmd) and put them in the root of your git repository.
2) Next we need to download all the npm resources. You could try to do this via the deployment script, but I ran into all kinds of issues on this step so I recommend using the kudu console.
On the kudu site go to Debug Console -> CMD (or Bash if that is your thing).
Change the directory to D:\home\site\repository which is the root of your git repository and then to the folder that contains the package.json file. In my case it is the web project so that would be D:\home\site\repository\MyWebProject
At the command prompt run "npm install".
Here is where I ran into an issue installing gulp which prevented all my packages from downloading. So I had to upgrade npm to version 3 which fixed the problem. To that run "npm install npm@3 -g". Once that was installed I could run "npm install" successfully.
At this point you can also test your gulp tasks if you want to in the console to make sure they work. To do that just run "node_modules.bin\gulp [task name]" in the folder you should already be in which should also have your gulp.js file in it.
3) Once all that is working then you can modify your deploy.cmd script to have these steps run each time. The npm install won't take as long since it should only be dealing with changes.
I put the following section after step 1 - restoring nuget packages.
:: 2. Install npm packages and run gulp
pushd "%DEPLOYMENT_SOURCE%\[Your website folder]"
call :ExecuteCmd npm install
IF !ERRORLEVEL! NEQ 0 goto error
call :ExecuteCmd node_modules\.bin\gulp [your guld task name]
IF !ERRORLEVEL! NEQ 0 goto error
popd
That is it, now when a git check in is done the npm modules are updated and the gulp task is run. Hopefully this helps anyone else trying to set this up.