Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set the root folder for an Azure Websites site?

My folder structure is like so:

-build
 -unimportant stuff
-src
 -scripts
  -thirdParty
   -knockout
    -knockout.js
   -jquery
    -jquery.js
  -business
   -application.js
 -index.html

So, basically I have my entire site source inside a "src" folder, when I deploy that to Azure I have to change the default pages configuration to "src/index.html" which seems to work. My problem is that my scripts are not being loaded.

I have my scripts referenced like so:

In my local environment this works great, but it Azure it is not able to access the scripts. It seems that even though I am trying to use relative path, Azure is trying to access the scripts from it's root directory which is one level below where the scripts are.

Does anyone know how to change the Azure Website root directory to be set as my "src" directory

like image 771
ClaytonHunt Avatar asked Sep 20 '13 20:09

ClaytonHunt


People also ask

What is a root folder path?

In a computer file system, and primarily used in the Unix and Unix-like operating systems, the root directory is the first or top-most directory in a hierarchy. It can be likened to the trunk of a tree, as the starting point where all branches originate from.

How do you deploy a web app to a sub folder on Azure App Service?

Using Azure App Service Deploy When creating an Azure DevOps pipeline, you can add the Azure App Service deploy task to deploy to such a web app. The default yaml configuration of this deployment task looks more or less as follows. There is no option on the yaml task to designate a specific subfolder to deploy to.


1 Answers

the solution is to go to "Configure" in the management of your Azure Website. In the "app settings" section add a key of "Project" and a value in my case of "./src" then trigger a deployment. now only the directory you specified will be deployed and it will be deployed as the root.

Full instructions can be found here: https://github.com/projectkudu/kudu/wiki/Customizing-deployments

like image 133
ClaytonHunt Avatar answered Mar 05 '23 14:03

ClaytonHunt