Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save gregjhogan/8a8fdee6f34f8cbc8959bfdd6595f98e to your computer and use it in GitHub Desktop.

Select an option

Save gregjhogan/8a8fdee6f34f8cbc8959bfdd6595f98e to your computer and use it in GitHub Desktop.
Azure ARM template that dumps output variable value
$template = @{
'$schema' = "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#"
contentVersion = "1.0.0.0"
parameters = @{}
variables = @{}
resources = @(
)
outputs = @{
example = @{
value = "[resourceGroup()]"
type = "object"
}
}
}
ConvertTo-Json -InputObject $template -Depth 1024 | Out-File -File template.json -Force
$result = (New-AzureRmResourceGroupDeployment -ResourceGroupName $ResourceGroup -TemplateFile template.json)
$result.Outputs.example.Value.ToString()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment