Rainer Stropek | @rstropek
// this file can only be deployed at a subscription scope
targetScope = 'subscription'
@description('Name of the Resource Group to create')
param rgName string = 'DemoResourceGroup'
@description('Location for the Resource Group')
param rgLocation string = 'westeurope'
var dept = 'IT'
resource demoRG 'Microsoft.Resources/resourceGroups@2021-01-01' = {
name: rgName
location: rgLocation
tags: {
Dept: dept
Environment: 'Test'
}
}
output resourceID string = demoRG.id
var list = 'a,b,c,d'
var arrayFromString = split(list, ',')
var find = 'findThisInString'
var found = contains(find, 'This')
var index = indexOf(find, 'This')
var indexNotFound = indexOf(find, 'NotFound')
var len = length(find)
var substr = substring(find, index, (len - index))
output arrayFromString array = [for i in arrayFromString: {
element: i
}]
output found string = found == true ? 'Found "this"' : 'Did not find "This"'
output index int = index
output indexNotFound int = indexNotFound
output substr string = substr
Functions π
Loops
Inline if
Rainer Stropek | @rstropek