Skip to content

Instantly share code, notes, and snippets.

@krist00fer
krist00fer / Get-AzureUsageCost.ps1
Last active May 8, 2024 16:39
PowerShell Script to retrieve Azure Usage and Cost/Pricing
# 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.
@bmoore-msft
bmoore-msft / remove-deployments.ps1
Created February 6, 2019 18:42
Delete Deployments from a ResourceGroup Based on a Max Number
#
#this script will delete deployments from a resourceGroup if the number of deployments exceeds the number specified by the Max parameter
#
Param(
[string] [Parameter(Mandatory=$true)] $ResourceGroupName,
[int] [Parameter(Mandatory=$true)] $Max
)
$deployments = Get-AzureRmResourceGroupDeployment -ResourceGroupName $ResourceGroupName
@bmoore-msft
bmoore-msft / Get-DeploymentCount.ps1
Created May 3, 2019 18:00
Get the count of deployments in each resource group in each subscription
# use this script to get all the deployments in all subscriptions the current user context has access to - it can
# be useful to find groups that are close to the 800 limit
param(
[int]$deploymentCountWarningLevel = 700 # number of deployments where a warning should be written
)
Disable-AzContextAutosave -Verbose
$subs = Get-AzSubscription
@cmendible
cmendible / kubectl_ubuntu_wsl.sh
Created November 16, 2019 22:02
Install kubectl on ubuntu (WSL) and use kubectl config from Windows
#!/bin/bash
# Receives your Windows username as only parameter.
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
windowsUser=$1
@AAkindele
AAkindele / aks-agw-ingress-tls-notes.md
Created August 26, 2021 17:58
AKS, App Gateway Ingress, and Key Vault TLS secrets

Rough notes for AKS App Gateway ingress tls

Rough notes on setting up Application Gateway Ingress Controller for AKS. This also takes advantage of key vault and Azure Key Vault Provider for Secrets Store CSI Driver. The Ingress resource will be configured to use a tls Kubernetes secret that is create via the csi driver. In this setup, TLS is terminated at the App Gateway. App Gateway does support end-to-end TLS if that is required.

Setup preview extensions

# add az cli preview extensions
az extension add --name aks-preview