Skip to content

Instantly share code, notes, and snippets.

@Fleid
Fleid / run.ps1
Last active November 4, 2021 23:52
Auto-pause script for Azure Stream Analytics jobs - PowerShell for Azure Functions
# Input bindings are passed in via param block.
Param($Timer)
# Stop on error
$ErrorActionPreference = 'stop'
# Write an information log with the current time.
$currentUTCtime = (Get-Date).ToUniversalTime()
Write-Host "asaRobotPause - PowerShell timer trigger function is starting at time: $currentUTCtime"
@Fleid
Fleid / release.ps1
Last active January 9, 2020 21:25
PowerShell Core script to deploy an Azure Stream Analytics job in a release pipeline of Azure DevOps Pipelines
# Step 1: map arguments
write-host "101 - Mapping arguments"
$sourceProjectName = "ASATest1"
$targetResourceGroup = ${ENV:VG-RESOURCEGROUP}
$stagingDirectory = "$ENV:SYSTEM_ARTIFACTSDIRECTORY\$ENV:RELEASE_PRIMARYARTIFACTSOURCEALIAS\drop"
$templatePath = "$stagingDirectory\$sourceProjectName.JobTemplate.json"
$validationParametersPath = "$stagingDirectory\$sourceProjectName.JobTemplate.parameters.json"
@Fleid
Fleid / asa-build.yml
Last active January 8, 2020 06:07
YAML file describing a Build pipeline of an Azure Stream Analytics job in Azure DevOps Pipelines
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
- group: StagingVariableGroup
steps:
@Fleid
Fleid / build.ps1
Last active January 9, 2020 21:24
PowerShell Core script to build an Azure Stream Analytics job in Azure DevOps Pipelines
# Step 0: map arguments and variables
$sourceProjectName = "ASATest1"
$targetResourceGroup = ${ENV:VG-RESOURCEGROUP}
$sourceDirectory = $ENV:BUILD_SOURCESDIRECTORY
$stagingDirectory = $ENV:BUILD_ARTIFACTSTAGINGDIRECTORY
$scriptPath = "$sourceDirectory\$sourceProjectName.asaql"
$templatePath = "$stagingDirectory\$sourceProjectName.JobTemplate.json"
@Fleid
Fleid / provision02.ps1
Last active December 25, 2019 17:36
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"
@Fleid
Fleid / provision01.azcli
Last active December 25, 2019 17:37
Azure CLI script to provision a resource group and a storage account - see https://www.eiden.ca/asa-alm-102/
# Using Bash (WSL if Windows)
bash
# Login to Azure
az login
# If necessary (multiple subscriptions available), select the appropriate one
az account list --output table
az account set --subscription "mySubscriptionNameGoesHere"
@Fleid
Fleid / driveBC_events.schema.json
Created June 6, 2017 23:49
driveBC API - events JSON schema v1
{
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {},
"id": "http://example.com/example.json",
"properties": {
"events": {
"items": {
"properties": {
"+ivr_message": {
"type": [