View getBillingData.ps1
# Licensed under the MIT license. | |
# Copyright (C) 2017 Kristofer Liljeblad | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, | |
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, | |
# subject to the following conditions: | |
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
View azureRegionCountry.ps1
# Get all Azure regions accessible with my subscription | |
$regions = az account list-locations | ConvertFrom-Json | |
$locations = $regions | Select-Object displayName,latitude,longitude | Sort-Object displayName | |
# Get my location based on IP address | |
$request = (Invoke-WebRequest -Uri http://ip-api.com/json).Content | ConvertFrom-Json | |
$latitude = $request.lat | |
$longitude = $request.lon | |
$countryCode = $request.countryCode |
View nearestAzureRegion.ps1
# Get all Azure regions accessible with my subscription | |
$regions = az account list-locations | ConvertFrom-Json | |
$locations = $regions | Select-Object displayName,latitude,longitude | Sort-Object displayName | |
# Get my location based on IP address | |
$request = (Invoke-WebRequest -Uri http://ip-api.com/json).Content | ConvertFrom-Json | |
$latitude = $request.lat | |
$longitude = $request.lon | |
$hash = [ordered]@{ |
View azuredeploy.parameters.json
"chefValidationKey": { | |
"reference": { | |
"keyVault": { | |
"id": "/subscriptions/<SUBSCRIPTIONID>/resourceGroups/<RESOURCEGROUPNAME>/providers/Microsoft.KeyVault/vaults/<VAULTNAME>" | |
}, | |
"secretName": "chef-org-validator" | |
} | |
} |
View New-KeyVaultChefCertSecret.ps1
## Log in to Azure Resource Manager | |
Add-AzureRmAccount | |
## Create Resource Group | |
$resourceGroupName = 'keyvault' | |
$location = 'Australia Southeast' | |
$resourceGroup = New-AzureRmResourceGroup ` | |
-Name $resourceGroupName ` |