This guide will help you run server-side commands on your Azure Website hosting environment, it is very simple and useful and since it’s implemented in node.js, it’ll work on any (node) supporting OS (Windows / MAC / Linux).
First, you should install node.js if you don’t already have it (#whynot?).
npm install kuduexec -g
Note: There’s also a .NET version of kuduexec called KuduExec.NET
Find your “kuduexec” Azure Website endpoint:
Add “scm” after your site’s name (if you have a custom domain you still need to add this to the original URL you received from Azure), for example:
http://somesitename.azurewebsites.net/ —> http://somesitename.
If you have “git deployment” enabled on your site you can get the endpoint (including user name and password) from the Azure portal go to you site, under the CONFIGURE tab, on the git section in the DEPLOYMENT TRIGGER URL:
Now that you have your endpoint, open a shell window and run the command:
kuduexec <Your endpoint URL / git deployment url>
Note: You can also add your user name and password to the url (otherwise it simply asks you for them):
At this point you’ll see a command prompt with the root directory of your site (not “wwwroot”), some info on the directory structure.
Now you can run your commands, including shell commands such as “cd”, “dir” and “copy”, you’ll also be able to run executables such as “git” and “npm”.
To quit simply type