Skip to content

Instantly share code, notes, and snippets.

View ljtill's full-sized avatar
🔨

Lyon Till ljtill

🔨
View GitHub Profile
@ljtill
ljtill / template.bicep
Last active September 28, 2021 10:55
Provides the ability to deploy App Service Plan and Function App
var name = ''
var location = ''
resource serverfarm 'Microsoft.Web/serverfarms@2020-12-01' = {
name: name
location: location
kind: 'linux'
tags: {}
properties: {
reserved: true
@ljtill
ljtill / policy.json
Last active September 28, 2021 10:56
Provides the ability to modify Security Rules upon Resource updates
{
"displayName": "",
"policyType": "Custom",
"mode": "All",
"parameters": {},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
@ljtill
ljtill / ManagementGroups.ps1
Last active April 14, 2025 19:43
Provides the ability to recursively retrieve all Management Groups
function Get-AzManagementGroups {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$GroupId
)
process {
Write-Verbose -Message ("Invoking Get-AzManagementGroup -GroupId " + $GroupId)
@ljtill
ljtill / main.bicep
Last active September 28, 2021 10:56
Provides the ability to deploy Azure Functions via Bicep
// ------
// Scopes
// ------
targetScope = 'subscription'
// ---------
// Modules
// ---------
@ljtill
ljtill / Program.cs
Last active September 28, 2021 10:57
Provides the ability to integrate with Configuration Store
using System;
using Microsoft.Extensions.Configuration;
namespace Settings
{
class Program
{
static int Main(string[] args)
{
@ljtill
ljtill / azuredeploy.json
Last active August 16, 2021 18:02
Provides the ability to deploy multiple Management Groups
{
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/tenantDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Management/managementGroups",
"apiVersion": "2020-05-01",
"name": "{guid}",
"scope": "/",
"properties": {
@ljtill
ljtill / Secrets.ps1
Last active August 1, 2022 13:21
Provides the ability to generate Access Tokens for Azure Active Directory
$baseUrl = "https://api.github.com"
$repository = ""
$username = ""
$password = ""
$inputs = @{
"ARM_TENANT_ID" = ""
"ARM_SUBSCRIPTION_ID" = ""
"ARM_CLIENT_ID" = ""
@ljtill
ljtill / azuredeploy.json
Last active February 8, 2021 18:02
Provides the ability to implement delay feature within Azure deployments
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"functions": [],
"variables": {},
"resources": [
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2019-10-01",
@ljtill
ljtill / metadata.json
Last active August 16, 2021 18:03
Provides the ability to manage Azure Policy artifacts
[
{
"displayName": "",
"assignmentName": "",
"name": "(GUID)",
"description": "",
"definitionPath": "./folder/policy.rules.json",
"parameterPath": "./folder/policy.parameters.json"
}
]
@ljtill
ljtill / managementgroups.sh
Last active December 10, 2020 19:24
Provides the ability to recursively remove Management Groups
#!/usr/bin/bash
IFS=$'\n'
MG_NAME=''
az account management-group show -n $MG_NAME -e -r > ./data.json
# Depth 0
for i in $(cat data.json | jq -rc '.children[]?')
do