Skip to content

Instantly share code, notes, and snippets.

@Fleid
Last active December 25, 2019 17:36
Show Gist options
  • Save Fleid/3aa865bae23dc73e21e039e8ef861382 to your computer and use it in GitHub Desktop.
Save Fleid/3aa865bae23dc73e21e039e8ef861382 to your computer and use it in GitHub Desktop.
PowerShell Core Az script to provision an Azure Stream Analytics job - see https://www.eiden.ca/asa-alm-102/
# Login to Azure
Connect-AzAccount
# If necessary (multiple subscriptions available), select the appropriate one
Get-AzSubscription
Get-AzSubscription -SubscriptionName "mySubscriptionNameGoesHere" | Select-AzSubscription
# Create a Stream Analytics job
$suffix = "staging"
$rg_name = "rg-asatest$suffix"
$jobName = "MyStreamingJob$suffix"
$currentLocation = Get-Location
$jobDefinitionFile = "$currentLocation\Provision\JobTemplate.provision.json"
New-AzStreamAnalyticsJob `
-ResourceGroupName $rg_name `
-File $jobDefinitionFile `
-Name $jobName `
-Force
@Fleid
Copy link
Author

Fleid commented Dec 25, 2019

Minimal Stream Analytics job config file (JobTemplate.provision.json) to be used in this context:

{
    "location":"CanadaCentral",
    "properties":{
      "sku":{
        "name":"standard"
      },
      "eventsOutOfOrderPolicy":"adjust",
      "eventsOutOfOrderMaxDelayInSeconds":10,
      "compatibilityLevel": 1.1
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment