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
# queries each Azure Storage account in the tenant, | |
# and returns a list of storage accounts and the most | |
# recent date/time that the storage account key was rotated. | |
# Connect to your Azure account | |
Connect-AzAccount | |
# Get Now | |
$now = Get-Date |
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
# For an Azure Storage account with Hierarchical Namespace enabled, | |
# this script totals up all the blobs in a container and outputs the total size in GB | |
# Set these variables to the storage account and container you want to get the size of | |
$ENV:AZURE_STORAGE_ACCOUNT = "[STORAGE ACCOUNT NAME]" | |
$containerName = "[CONTAINER NAME]" | |
# housekeeping | |
$ENV:AZURE_STORAGE_AUTH_MODE = "login" | |
$nextMarker = $null |
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
[CmdletBinding()] | |
param ( | |
[Parameter()] | |
[string] | |
$SubscriptionName, | |
[Parameter()] | |
[string] | |
$StorageAcctName, |
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
quality_levels_ordered = ['Ex', 'Gd', 'TA', 'Fa', 'Po'] | |
train_df.LotShape.cat.set_categories(['Reg', 'IR1', 'IR2', 'IR3'], ordered=True, inplace=True) | |
train_df.LandContour.cat.set_categories(['Lvl', 'Bnk', 'HLS', 'Low'], ordered=True, inplace=True) | |
train_df.Utilities.cat.set_categories(['AllPub', 'NoSewr', 'NoSeWa', 'ELO'], ordered=True, inplace=True) | |
train_df.LandSlope.cat.set_categories(['Gtl', 'Mod', 'Sev'], ordered=True, inplace=True) | |
train_df.Condition1.cat.set_categories(['PosA', 'PosN', 'Norm', 'Feedr', 'Artery', 'RRNn', 'RRNe', 'RRAn', 'RRAe'], ordered=True, inplace=True) | |
train_df.Condition2.cat.set_categories(['PosA', 'PosN', 'Norm', 'Feedr', 'Artery', 'RRNn', 'RRNe', 'RRAn', 'RRAe'], ordered=True, inplace=True) | |
train_df.BldgType.cat.set_categories(['1Fam', 'Duplx', 'TwnhsE', 'TwnhsI', '2FmCon'], ordered=True, inplace=True) | |
train_df.HouseStyle.cat.set_categories(['1Story', '1.5Unf', '1.5Fin', 'SFoyer', 'SLvl', '2Story', '2.5Unf', '2.5Fin'], ordered=True, inplace=True) |
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
<# | |
.Synopsis | |
Searches for resource groups that don't have the 'creator' tag, | |
searches their Activity Log history for a 'Created' event substatus, | |
and tags the resource group with a creator tag using the event's Caller as the tag value. | |
.Description | |
For resources created more than 90 days ago, no user information will be available. | |
*The Automation Connection's Service Principal needs to have read/write permissions on Resource Group resources.* | |
*The Automation Connection's Service Principal needs to be a 'Directory reader' in Azure AD.* |
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": { | |
"displayName": "Web App default IP restrictions", | |
"mode": "indexed", | |
"description": "Configures Web App IP restriction to allow access from specified public IP addresses", | |
"metadata": { | |
"category": "Security v5" | |
}, | |
"parameters": {}, | |
"policyRule": { |
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" | |
} | |
}, | |
"resources": [ | |
{ |
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
<# | |
.Synopsis | |
Scans for Azure SQL servers missing our IP addresses in their firewalls and sends a report by e-mail. | |
.Description | |
Intended for use from an Azure Automation account. | |
.NOTES | |
AUTHOR: rcabr | |
LASTEDIT: 2019-06-04 |
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
<# | |
.SYNOPSIS | |
Create a Mermaid diagram (https://mermaidjs.github.io/) | |
that reflects the Azure management group and subscription hierarchy. | |
.DESCRIPTION | |
This script assumes prerequisites: | |
1) The Az module is installed (https://docs.microsoft.com/en-us/powershell/azure/new-azureps-module-az) | |
2) Azure sign-in is completed (Connect-AzAccount) | |
3) The signed-in user has the required permissions to enumerate the management groups and subscriptions |
NewerOlder