PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 28, 2022

[FIXED] How to publish Grunt-assembled web site to the root of Azure Web App using Kudu?

 September 28, 2022     azure-web-app-service, continuous-deployment, gruntjs, kudu     No comments   

Issue

I have a web site assembled (is it the right term?) by Grunt. It has the following structure:

/
  src/ (input)
    doc/
    images/
    js/
    scss/
    Web.config
  external/
  node_modules/
  dist/ (output)
    css/
    fonts/
    images/
    js/
  gruntfile.js
  package.json

To publish it to an Azure Web App using Continuous Deployment and Kudu I added the following files:

.deployment
deploy.cmd

I can upload the web site to /src and deploy it to /dist like this:

Directory of D:\home\site\wwwroot

06/30/2015  01:50 AM    <DIR>          .
06/30/2015  01:50 AM    <DIR>          ..
06/30/2015  02:21 AM                30 .deployment
06/30/2015  02:21 AM             3,679 deploy.cmd
06/30/2015  12:44 AM    <DIR>          dist
06/30/2015  12:40 AM    <DIR>          external
06/30/2015  02:21 AM             5,697 gruntfile.js
06/30/2015  12:43 AM    <DIR>          node_modules
06/30/2015  02:21 AM             1,173 package.json
06/30/2015  12:40 AM    <DIR>          src

But when I specify the root as the destination I'm getting an error:

Source and destination directories cannot be sub-directories of each other

What is the right approach here?


Solution

Edit: Changing answer based on discussion

Try using Virtual Directories: https://azure.microsoft.com/en-us/documentation/articles/web-sites-configure/

All sites have site\wwwroot point to the / virtual directory by default. If you want \dist to be your root then change the virtual directory entry to have site\wwwroot\dist as the physical path and / as the virtual directory.

enter image description here

You can configure you web.config to specify any script to be your startup script with the following config:

  <system.webServer>
    <handlers>
      <add name="iisnode" path="/src/index.js" verb="*" modules="iisnode" />
    </handlers>
  </system.webServer>



Answered By - Zain Rizvi
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing