Is there a way we can deploy the stream analytics jobs in disabled mode through ARM template?
Asked
Active
Viewed 347 times
1 Answers
1
Yes there is a way to do it. There is no attribute to create it in stopped state for ARM but deployment scripts are used to extend ARM templates.
You should add a section like below to your ARM template. Also, don't forget to add dependOn condition to Azure Analytics Jobs otherwise, it might try to stop a non-existing job..
{
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2020-10-01",
"name": "runBashWithOutputs",
"location": "[resourceGroup().location]",
"kind": "AzureCLI",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"[parameters('identity')]": {
}
}
},
"properties": {
"forceUpdateTag": "[parameters('utcValue')]",
"AzCliVersion": "2.15.0",
"timeout": "PT30M",
"arguments": "'foo' 'bar'",
"scriptContent": "result=$(az stream-analytics job stop --resource-group $1);echo $result | jq -c '{Result: map({id: .id})}' > $AZ_SCRIPTS_OUTPUT_PATH",
"cleanupPreference": "OnSuccess",
"retentionInterval": "P1D"
}
}
You can check more in their documentation, Use deployment scripts in ARM templates

efdestegul
- 617
- 3
- 6