Skip to content

Instantly share code, notes, and snippets.

View weeyin83's full-sized avatar

Sarah Lean weeyin83

View GitHub Profile
resources
| where type =~ 'microsoft.hybridcompute/machines' or type =~ 'Microsoft.Compute/virtualMachines'
| extend TagsObject = parse_json(tags) // Parse the JSON string into a dynamic object
| project name, City = tostring(TagsObject.City), Environment = tostring(TagsObject.Environment) // Extract the City tag as a string
| summarize CityCount = count() by City // Group by City and count occurrences
resources
| where type =~ 'microsoft.hybridcompute/machines' or type =~ 'Microsoft.Compute/virtualMachines'
| extend TagsObject = parse_json(tags) // Parse the JSON string into a dynamic object
| project name, City = tostring(TagsObject.City), Environment = tostring(TagsObject.Environment) // Extract the City & Environment tags separately
resources
| where type =~ 'microsoft.hybridcompute/machines' or type =~'Microsoft.Compute/virtualMachines'
| project name, ['tags']
# This ensures we have unique CAF compliant names for our resources.
module "naming" {
source = "Azure/naming/azurerm"
version = "0.3.0"
}
locals {
azure_regions = [
"ukwest",
"westeurope",
##
# Variables
##
##
# Common Variables
##
variable "tag_environment" {
type = string
default = "Testing"
##
# Terraform Configuration
##
terraform {
required_version = ">= 1.10.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.71, < 5.0.0"
resource "azurerm_netapp_account" "example" {
name = "example-netapp-account"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
}
resource "azurerm_netapp_pool" "example" {
name = "example-netapp-pool"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
resource "azurerm_resource_group" "example" {
name = "rg-example"
location = "UK South"
}
resource "azurerm_virtual_network" "example" {
name = "networking"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
address_space = ["10.0.0.0/16"]

let part1 = "Just another"; let part2 = " Kusto hacker"; print result = strcat(part1, part2)

trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: AzureCLI@2
name: RunTerraform
inputs:
azureSubscription: INSERT NAME OF YOUR SERVICE CONNECTION # The name of your service connection goes here
scriptType: bash