> ## Content Index
> Fetch the complete content index at: https://felixrieseberg.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Deploying Ember Cli to Azure Websites
- URL: https://felixrieseberg.com/deploying-ember-cli-to-azure-websites/
- Published: 2015-02-22T05:13:38.000Z
- Updated: 2016-08-01T19:49:01.000Z
- Author: Felix Rieseberg
- Tags: azure, Node.js, Ember.js, Ember-Cli

![](https://storage.ghost.io/c/89/e0/89e08557-681a-40be-8264-278bf46d6b25/content/images/2016/08/ember-1.jpg)

The Ember Cli is a great command line tool for managing the development of sophisticated web applications using the popular framework Ember.js. One of the many features is a fully automated build and asset compilation with a whole bunch of subtasks. We at Microsoft love both automation and Ember.js, so [I wrote a npm module enabling Azure Websites to automatically compile and deploy your app](https://github.com/felixrieseberg/ember-cli-azure-deploy?ref=felixrieseberg.com).

### 'Ember build' on Azure Websites

If you just came here to figure out how to have Azure Websites run `ember build` as soon as you push a new commit to GitHub, BitBucket or Visual Studio Online, simply run the following command in your app's root folder:

```
$ npm install ember-cli-azure-deploy --save-dev -g
$ azure-deploy init

```

### How Does This Magic Work?

The engine running on Azure Websites, [Kudu](https://github.com/projectkudu/kudu?ref=felixrieseberg.com), allows for customized deployments, enabling us to run a custom Bash script. Running `azure-deploy init` creates just such a script. In detail, here's what happens next: As soon as a new commit is made to your repo, Azure is notified and clones the whole repo to a temporary folder. There, it executes `deploy.sh`, which checks for the existence of KuduSync and Node.

If the environment is setup okay, we check whether Ember-Cli, Bower and Ember-Cli-Azure-Deploy are installed. If not, we go ahead and install it - and since we're already installing things anyway, we're also pulling down all required Node modules and Bower packages.

Normally, we could just run `ember build` at this point. Sadly, the build fails on Azure Websites due to errors with `stdin`. In order subvert that issue, I use Node's `child_process` module to execute a command with stdin disabled, which now executes successfully. Once we're done, the deploy script simply copies the the built `dist` folder over to your website's final deployment destination. Your app is now live - and you didn't even lift a finger!