Skip to content

Instantly share code, notes, and snippets.

View rupeshtech's full-sized avatar

Rupesh Kumar rupeshtech

View GitHub Profile
@rupeshtech
rupeshtech / SetConsumptionBudget.ps1
Created February 20, 2021 14:43
Create a Consumption Budget for ResourceGroups in Azure
param (
[string]$ResourceGroupsToExclude
)
function Login-AzureAutomation([bool] $AzModuleOnly) {
try {
$RunAsConnection = Get-AutomationConnection -Name "AzureRunAsConnection"
Write-Output "Logging in to Azure ($AzureEnvironment)..."
if (!$RunAsConnection.ApplicationId) {
$ErrorMessage = "Connection 'AzureRunAsConnection' is incompatible type."