Content
Contain a script sample that demonstrates on how to use User-defined functions in Azure Resource Manager template.
This is part a Medium article published here.
Call Sample
#Variable
$SubId="Your Azure Subsciption Id"
$DeploymentName="GetVnetObject"
$RgName="The Resource Group Name Containing Your Vnet"
$VnetName="Your Vnet name"
#ARM Deployment
New-AzResourceGroupDeployment -Name $DeploymentName -ResourceGroupName $RgName `
-TemplateFile .\mainTemplate.json `
-existingVirtualNetworkSubscriptionId $SubId `
-existingVirtualNetworkResourceGroupName $RgName `
-existingVirtualNetworkName $VnetName