This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Chart memory if its under nnMB over the past nn days/hours | |
let setMBValue = 1024; | |
// enter a MB value to check | |
let startDate = ago(5h); | |
// enter how many days/hours to look back on | |
Perf | |
| where TimeGenerated > startDate | |
| where ObjectName == "Memory" and CounterName == "Available Mbytes" and Computer in ((Heartbeat | |
| where OSType == "Windows" | |
| distinct Computer)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"name": { | |
"type": "string", | |
"metadata": { | |
"description": "AKS cluster name" | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sp = New-AzADServicePrincipal -DisplayName RabbitMQScale | |
$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($sp.Secret) | |
$UnsecureSecret = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR) | |
$AppID = (Get-AzADServicePrincipal -DisplayName RabbitMQScale).ApplicationID | |
New-AzRoleAssignment -ApplicationId $AppID -RoleDefinitionName "Contributor" | |
Write-host "Client ID =" $AppID | |
Write-host "Client Secret =" $UnsecureSecret | |
Write-host " Tenant =" (Get-AzContext).Tenant.Id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"properties": { | |
"arguments": { | |
"properties": { | |
"x-dead-letter-exchange": { | |
"type": [ | |
"string", | |
"object", | |
"number", | |
"integer", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Table of Servers with disk space is under nnGB | |
let setGBValue = 20; | |
// enter a GB value to check | |
let startDate = ago(30m); | |
// enter how many minutes to look back on | |
Perf | |
| where InstanceName != "D:" and InstanceName contains ":" | |
| where TimeGenerated > startDate | |
| where ObjectName == "LogicalDisk" and CounterName == "Free Megabytes" | |
| extend FreeSpaceGB = CounterValue/1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Chart disk if its under nnGB over the past nn days | |
let setGBValue = 20; | |
// enter a GB value to check | |
let startDate = ago(2d); | |
// enter how many days to look back on | |
Perf | |
| where InstanceName != "D:" and InstanceName contains ":" | |
| where TimeGenerated > startDate | |
| where ObjectName == "LogicalDisk" and CounterName == "Free Megabytes" | |
| extend FreeSpaceGB = CounterValue/1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"acrylicOpacity" : 0.6, | |
"closeOnExit" : false, | |
"colorScheme" : "Vintage", | |
"commandline" : "Azure", | |
"connectionType" : "{d9fcfdfa-a479-412c-83b7-c5640e61cd62}", | |
"cursorColor" : "#FFFFFF", | |
"cursorShape" : "bar", | |
"fontFace" : "Consolas", | |
"fontSize" : 10, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$KVRGname = 'PixelRobots-KV-UKS'; | |
$VMSSRGname = 'PixelRobots-VMSS-UKS'; | |
$VmssName = 'pixelrobotsvmss'; | |
$KeyVaultName = 'PixelRobots-VMSS-KV-UKS'; | |
## Do not edit below this line. | |
$KeyVault = Get-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KVRGname; | |
$DiskEncryptionKeyVaultUrl = $KeyVault.VaultUri; | |
$KeyVaultResourceId = $KeyVault.ResourceId; | |
Set-AzVmssDiskEncryptionExtension -ResourceGroupName $VMSSRGname -VMScaleSetName $VmssName -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -Version 3.0 -Modules Az.Resources | |
param( | |
[switch] | |
) | |
$ErrorActionPreference = 'Stop' | |
## Email Style |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Login { | |
$needLogin = $true | |
Try { | |
$content = Get-AzContext | |
if ($content) { | |
$needLogin = ([string]::IsNullOrEmpty($content.Account)) | |
} | |
} | |
Catch { | |
if ($_ -like "*Login-AzAccount to login*") { |