Permalink
Browse files

Updated documentation for V2

  • Loading branch information...
olivierbloch committed Apr 20, 2016
1 parent 6fce176 commit 3594e28112b5dc73ed72192a2d72547d8da3dc9d
@@ -1,4 +1,5 @@
To deploy the ConnectTheDots solution to your Azure Subcsrition you will need to follow the below instructions.
##How to deploy Azure services for ConnectTheDots.io##
To deploy the ConnectTheDots solution to your Azure subscription you will need to follow the below instructions.
We are using Azure Resource Manager to deploy the needed services and connect them to one another.
We are also using the Azure cross platform CLI tool which will allow you to deploy the services from your favorite development machine, running Windows, Linux or OSX.
The below services will be deployed in your Azure subscription:
@@ -10,11 +11,15 @@ The below services will be deployed in your Azure subscription:
You can edit the [ARM template](ConnectTheDots.json) if you want to add more services or edit the parameters.
**If you want to make edits to the WebSite before deploying the solution** with the ARM template, here are the few steps you can go through:
1. Do your changes in the WebSite solution (note that if you want to debug along with actual other services (IotHub, and others), you will need to first deploy the ARM Template.
1. Export a WebDeploy package (you can find instructions on how to do this from the WebSite project [here](https://msdn.microsoft.com/en-us/library/dd465323%28v=vs.110%29.aspx).
1. Edit the [ARM template](ConnectTheDots.json), updating the packageUri defaultvalue to point to your local zip package (see [this article](https://blogs.perficient.com/microsoft/2016/03/deploy-azure-web-app-using-arm-template-from-visual-studio-2015/) for details on how to do this).
##Your connect the dots resource groups##
All the services will be deployed under a single resource group in Azure.
The [Azure resource groups](https://azure.microsoft.com/en-us/updates/resource-groups-in-azure-preview-portal/) are a concept allowing to manage a set of resources all together.
This allows you to easily find the various resources for your ConnectTheDots solution in the Azure portal.
##Editing the deployment ARM template##
The default ARM template doesn't require editing unless you want to change the architecture of your solution to go from the default ConnectTheDots one to your own version of it.
##Deploy using Azure CLI tool and the ARM template##
Now here is how to deploy the whole ConnectTheDots solution in a few command lines:
1. Install the Azure CLI tool following the instructions [here](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-install/).
@@ -24,7 +29,7 @@ Now here is how to deploy the whole ConnectTheDots solution in a few command lin
```
azure config mode arm
```
1. Create a new resource group typing the following command:
1. Create a new resource group typing the following command (you can replace "ConnectTheDotsRG" with the name of your choice for the resource group):
```
azure group create -n "ConnectTheDotsRG" -l "East US"
```
@@ -41,3 +46,21 @@ Now here is how to deploy the whole ConnectTheDots solution in a few command lin
azure group deployment create -f "ConnectTheDots.json" ConnectTheDotsRG ConnectTheDotsDeploy
```
1. If you are seeing errors during the deployment, you can diagnose following instructions on how to debug ARM deployments: [http://aka.ms/arm-debug](http://aka.ms/arm-debug).
##Deleting a ConnectTheDots solution from your Azure subscription##
You can easily delete all the Azure resources at once when you are done with your project and want to clean up your Azure subscirption.
You can do this using a command line in the Azure CLI tool or in the Azure portal.
###Delete the resources using Azure CLI###
If you are already logged in in the Azure CLI tool, go directly to step #4
1. Connect to Azure following the instructions [here](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-connect/).
1. If you have multiple subscriptions, select the one you want to deploy the solution to following the instructions [here](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-connect/#multiple-subscriptions)
1. Set the Resource Azure Manager mode typing the following command:
```
azure config mode arm
```
1. Delete the resource group typing the following command (you need to replace "ConnectTheDotsRG" with the name you used in step 5 of the deployment if you changed it):
```
azure group delete -n "ConnectTheDotsRG"
```
@@ -1,53 +1,44 @@
# Website Publish #
# Website parameters and re-publish #
This document explains how to build and deploy a sample website that is used to show data and alerts in the Connect The Dots project. It assumes you have all necessary software and subscriptions and that you have cloned or download the ConnectTheDots.io project on your machine.
## Prerequisites ##
Since the version 2 of ConnectTheDots, the deployment of the site is primarily done using an ARM template (see [here](../ARMTemplate/Readme.md) for details) and there is no need for manually deploying if you are just using the default dashboard site and solution architecture.
If you want to make changes to the site though or have changed the Azure services architecture (changed Event Hub or IoT Hub) you will need to redeploy the site.
Make sure you have all software installed and necessary subscriptions as indicated in the Introduction.md file for the project. To repeat them here, you need
1. Microsoft Azure subscription ([free trial subscription](http://azure.microsoft.com/en-us/pricing/free-trial/) is sufficient)
1. Access to the [Azure Streaming Analytics Preview](https://account.windowsazure.com/PreviewFeatures)
1. Visual Studio – [Community Edition](http://www.visualstudio.com/downloads/download-visual-studio-vs)
## Configure Web.config
In order for the website publishing to work, you must have run the AzurePrep program discussed in the [getting started](../../GettingStarted.md) project, as it creates the event hubs from which the website pulls data, as well as populates the `web.config` file that is published for the Azure website.
## Web app parameters
In order for the website to connect with the various Azure resources (IoT Hub, Event Hub), it needs to have information about these services such as connection strings and credentials.
The ARM Template used to deploy the Azure services populates these parameters so you don't have to do it manually.
If you are willing to change these parameters (for example if you have decided to use a different IoT Hub), you can find them in the Azure portal:
If you have the `web.config` file from AzurePrep, all you need to do is add it to the Website project.
- Go to [portal.azure.com](http://portal;.azure.com)
- Login using your Azure account credentials
- Find the resource group that was deployed for your ConnectTheDots solution when following the [instructions](../ARMTemplate/Readme.md).
- Once you have selected the resource group:
1. Identify and select the Web App
1. Click on the **settings** button in the Web App blade
1. Select **Application settings**
1. Scroll down to **App settings**
If you already have the event hubs and are simply republishing a website, you can just edit the `web.config` file manually before publishing. To do this, open `ConnectTheDots\Azure\WebSite\ConnectTheDotsWebSite\web.config` and find the lines
![](portalsettings.png)
<add key="Microsoft.ServiceBus.EventHubDevices" value="ehdevices" />
<add key="Microsoft.ServiceBus.EventHubAlerts" value="ehalerts" />
<add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://{namespace-name}.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue={key}" />
<add key="Microsoft.ServiceBus.ConnectionStringDevices" value="Endpoint=sb://{namespace-name}.servicebus.windows.net/;SharedAccessKeyName=WebSite;SharedAccessKey={key}" />
<add key="Microsoft.ServiceBus.ConnectionStringAlerts" value="Endpoint=sb://{namespace-name}.servicebus.windows.net/;SharedAccessKeyName=WebSite;SharedAccessKey={key}" />
<add key="Microsoft.Storage.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName={storageaccount};AccountKey={key}" />
Once you have made your edits in the settings, you can just restart the site, clicking on the **Restart** in the Web App blade
You will need to replace the last four connection strings with the appropriate values for your subscription, found in [https://manage.windowsazure.com](https://manage.windowsazure.com) as follows:
## Modifying the dashboard Website ##
### Prerequisites ###
Make sure you have all software installed and necessary subscriptions as indicated in the Introduction.md file for the project. To repeat them here, you need
1. **ServiceBus.ConnectionString**. Select Service Bus from the left nav menu, highlight the Namespace Name created earlier, click on Connection Information at the bottom of the screen, and copy the RootManagedSharedAccessKey.
2. **ServiceBus.ConnectionStringDevices**. Select Service Bus from the left nav menu, select the Namespace Name created earlier, highlight ehdevices, click on Connection information at the bottom of the screen, and copy the WebSite Connection string.
3. **ServiceBus.ConnectionStringAlerts**. Select Service Bus from the left nav menu, select the Namespace Name created earlier, highlight ehalerts, click on Connection information at the bottom of the screen, and copy the WebSite Connection string.
4. **Storage.ConnectionString**. Select Storage from left nav menu, highlight the storage account created earlier, click on Manage Access Keys at the bottom of the screen, and copy the Primary Access Key.
1. Microsoft Azure subscription ([free trial subscription](http://azure.microsoft.com/en-us/pricing/free-trial/) is sufficient)
1. Visual Studio – [Community Edition](http://www.visualstudio.com/downloads/download-visual-studio-vs)
1. Deploy the default dashboard Website a first time using the [ARM Template](../ARMTemplate/Readme.md).
## Publish the Azure Website ##
* Open the `ConnectTheDots\Azure\WebSite\ConnectTheDotsWebSite.sln` solution in Visual Studio
* Make sure the `web.config` file has been updated
* If you made you're own updates, verify they are present.
* If you are using the `web.config` from AzurePrep, copy it to the project directory, then right click on the project navigate to *Add > Existing item...* and add it to the project.
* In VS, Right-click on the project name and select *Publish*.
* Select Azure Web Sites, create new one.
* Site name: [pick something unique]
* Region: [pick same region as you used for Stream Analytics]
* Database server: no database
* Database password: [leave suggested password]
* Publish (you might need to install WebDeploy extension if you are having an error stating that the Web deployment task failed. You can find WebDeploy [here](http://www.iis.net/downloads/microsoft/web-deploy)).
## Websockets setting ##
* Enable WebSockets for the new Azure Web site
* Browse to https://manage.windowsazure.com and select your Azure Web Site.
* Click on the Configure tab. Then set WebSockets to On and Click "Save"
* In the Profile tab, select the publish target **Microsoft Azure Web Apps**
* Select your subscription
* Select the resource group for your ConnectTheDots deployment
* Select the Web App below then click **OK**
* Click on **Publish**
##Running the site
* Open the site in a browser to verify it has deployed correctly.
@@ -56,5 +47,3 @@ You will need to replace the last four connection strings with the appropriate v
**Note** There is a chance you won't see any data coming into your site when you first stand it up. If that is the case, try rebooting your gateway.
![](WebsiteRunning.jpg)
If you're following the getting started project, the next task is [Stream Analytics integration](../StreamAnalyticsQueries/SA_setup.md).
Binary file not shown.
View
@@ -13,8 +13,6 @@ For this project, follow the instructions for configuring the following:
1. [Arduino UNO with weather shield](GatewayConnectedDevices/Arduino%20UNO/Weather/WeatherShieldJson/Arduino-and-Weather-Shield-setup.md)
2. [Raspberry Pi](Gateways/GatewayService/RaspberryPi-Gateway-setup.md)
If you're following the getting started project, the next task is the [sample website deployment](../Azure/WebSite/WebsitePublish.md).
## Build your own
To build your own end-to-end configuration you need to identify and configure the device(s) that will be producing the data to be pushed to Azure and displayed/analyzed. Devices fall generally into two categories - those that can connect directly to the Internet, and those that need to connect to the Internet through some intermediate device or gateway. Sample code and documentation can be found in the following folders:
@@ -25,4 +23,4 @@ To build your own end-to-end configuration you need to identify and configure th
### Build a sensor infrastructure ###
For additional scenarios, or more advanced configurations, follow the setup instructions in the folders for the devices or gateways listed above. For example, to include a Gadgeteer using the .NET Microframework code, follow [these instructions](DirectlyConnectedDevices/NETMF/ConnectTheDotsGadgeteer/Docs/NETMF%20Gadgeteer%20setup.md).
For additional scenarios, or more advanced configurations, follow the setup instructions in the folders for the devices or gateways listed above.
View
@@ -17,18 +17,16 @@ If you are going to deploy the starter solution, you need to procure an Arduino
In order to reproduce one of the ConnectTheDots.io scenarios, you will need the following:
1. Microsoft Azure subscription ([free trial subscription](http://azure.microsoft.com/en-us/pricing/free-trial/) is sufficient)
1. Visual Studio 2013 or above – [Community Edition](http://www.visualstudio.com/downloads/download-visual-studio-vs) is sufficient
1. [WiX Toolset](http://wixtoolset.org) - if you want to build installer of Gateway for Windows
1. [optional] Visual Studio 2013 or above – [Community Edition](http://www.visualstudio.com/downloads/download-visual-studio-vs) is sufficient. Note that if you are not planning to use the Gateway nor making changes to the dashboard, you will NOT need Visual Studio.
1. [optional] [WiX Toolset](http://wixtoolset.org) - if you want to build installer of Gateway for Windows
## Setup Tasks ##
Setting up your IoT solution involves several distinct steps, each of which is fully described in this project:
1. Clone or copy the project to your machine (NOTE: place the project in a folder as close to the root of your file system as possible. Some paths in the project are very long and you might encounter issues with long path names when restoring NuGet packages)
1. [Azure prep](Azure/AzurePrep/AzurePrep.md) - Creating basic Azure resources
1. [Deploy Azure services](Azure/ARMTemplate/Readme.md) - Creating Azure resources
1. [Device setup](Devices/DeviceSetup.md) - Configuring your device(s)
1. [Sample website deployment](Azure/WebSite/WebsitePublish.md) - Publishing a generic sample website for viewing the data
2. [Stream Analytics integration](Azure/StreamAnalyticsQueries/SA_setup.md) - Configuring Stream Analytics to send alerts and averages to the sample website.
To get started with our simple example, complete the tasks above in order. Navigation is provided on each page to get to the next topic.
Oops, something went wrong.

0 comments on commit 3594e28

Please sign in to comment.