Skip to content

Latest commit

 

History

History
59 lines (44 loc) · 3.61 KB

scenario-deploy.md

File metadata and controls

59 lines (44 loc) · 3.61 KB

Deployment guidelines

Real time data analytics with Azure IoT

Build Status

Deploy core artifacts

In order to deploy the core artifacts, you can use the ARM template file, located here. The only (optional) parameter that has to be passed to the deployment is ´solution_name´ (which defaults to 'traffic'). This variable will be used to make all artifacts unique. (the value should not contain hyphen, but only alphanumeric characters, as it is also used to create a storage account)

Deploying the template through PowerShell can be done, using the following code:

Connect-AzAccount

Select-AzSubscription -SubscriptionName <yourSubscriptionName>

New-AzResourceGroup -Name <yourResourceGroup> -Location "West Europe"
New-AzResourceGroupDeployment -Name TrafficDeployment -ResourceGroupName <yourResourceGroup> -TemplateFile .\deploy\arm\01-core-artifacts\template.json -solution_name trafficdemo

A successful deployment should result in the following components to be deployed. initial architecture schema

Deploy EventGridTrigger function

After running the above script, a function app is created in the resource group. Now it is needed to deploy the EventGridTrigger function manually, so that it can be used and references in the Azure Stream Analytics job, in the next step. For this, follow the following steps:

  1. Open the TrafficDemo.sln solution in Visual Studio
  2. Navigate to the EventGridFunctions project in the Cloud solution folder
  3. Right click the project and select the Publish action in the context menu
  4. In the wizard, select 'Select Existing' in the publish target window.
  5. Select your subscription, your created resource group and the function app with your solution name.
  6. Click OK.
  7. If needed, click OK to update the version of the function app on Azure
  8. If all goes well, the function is now ready to be used in the next step.

Deploy Azure Stream Analytics artifacts

Deploy the Stream Analytics cloud job

In order to deploy the ASA cloud job, you can use the ARM template file, located here. Use the same ´solution_name´ parameter as in the first step to generate the code.

Deploying the template through PowerShell can be done, using the following code:

Connect-AzAccount

Select-AzSubscription -SubscriptionName <yourSubscriptionName>

$pathToJson = "cloud-template.json"
$template = Get-Content $pathToJson -Raw | ConvertFrom-Json
$query = Get-Content "..\..\..\src\cloud\StreamAnalyticsCloud\Script.asaql" -Raw | Out-String
$template.resources[0].properties.transformation.properties.query = $query
$templateContent = $template | ConvertTo-Json -Depth 10 | % { [System.Text.RegularExpressions.Regex]::Unescape($_) }
$templateContent | set-content $pathToJson

New-AzResourceGroupDeployment -Name TrafficDeployment -ResourceGroupName <yourResourceGroup> -TemplateFile .\deploy\arm\02-stream-analytics\cloud-template.json -solution_name trafficdemo

Important remark Currently, there seems to be an issue when the ARM template is getting deployed to Azure. The square brackets at the end of the name of tables or outputs seems to include a carriage return that you have to change manually in the query editor on the Azure portal.

Deploy Azure Databricks artifacts

To do