Skip to content

Instantly share code, notes, and snippets.

View zloeber's full-sized avatar

Zachary Loeber zloeber

View GitHub Profile
@zloeber
zloeber / gist:a24ddd928e11f444815c11a5f9b25d63
Last active January 16, 2020 03:18
ado-linked-var-group-2
AZ_SUBSCRIPTION=<subscription name>
AZ_SUBSCRIPTION_ID=<subscription id>
ADO_ORG=<ADO Org Name>
ADO_PROJECT=<ADO Project Name>
KEYVAULTNAME=<Key Vault to link ADO Group with>
SC_NAME=<service connection name>
@zloeber
zloeber / gist:e90da169dec0ec0c96fffd457ef5b33a
Created January 16, 2020 03:19
ado-linked-var-group-5
#!/bin/bash
SC_NAME=${SC_NAME:-"Service Connection Name"}
KEYVAULTNAME=${KEYVAULTNAME:-"keyvault"}
AZ_SUBSCRIPTION=${AZ_SUBSCRIPTION:-"Azure Subscription"}
AZ_SUBSCRIPTION_ID=${AZ_SUBSCRIPTION_ID:-"Azure Subscription ID"}
ADO_ORG=${ADO_ORG:-"https://dev.azure.com/myorgname"}
ADO_PROJECT=${ADO_PROJECT:-"MyProject"}
SECRET_TEMPLATE=${SECRET_TEMPLATE:-"./secret-var-group.tpl"}
echo "STAGE: ${STAGE}"
@zloeber
zloeber / GetDuplicateAzureADDynamicGroups.ps1
Created February 4, 2018 17:12
List Duplicate AzureAD Dynamic Groups Based On Filter
<#
Finds a good portion of possible dupliate dynamic groups in Azure AD. Will not find super complicated member filter duplicates but should find most common filters (like all PCs and the zillions of 'Subsidiary*' groups that InTune upgrades have created on the back end)
Requires the AzureADPreview module to work correctly!
More on dynamic membership in Azure AD:
https://docs.microsoft.com/en-us/azure/active-directory/active-directory-groups-dynamic-membership-azure-portal
#>
Remove-Module AzureAD -Force -ErrorAction:SilentlyContinue
@zloeber
zloeber / kured-helmfile.yml
Created March 14, 2020 18:27
kured-helmfile
helmDefaults:
tillerless: true
tillerNamespace: platform
atomic: true
verify: false
wait: false
timeout: 600
recreatePods: false
force: true
count(kured_reboot_required) BY (instance) * ON (instance) GROUP_LEFT (node) kured_reboot_required > 0
# Login
az login --service-principal \
--username "${SPNAPPID}" \
--password "${SPNSECRET}" \
--tenant "${TENANTID}"
# Add the cli extension
az extension add --name azure-devops
# Profit!
MYVAR=somevalue1
MYVAR2=somevalue2
## ado-variable-group.yml
# Use az cli to update or create an ADO variable group like a crazy person
# sourceFile is a generic .env file with entries in VAR=VALUE format.
parameters:
sourceFile: ''
groupName: ''
overwrite: 'true'
adoProject: ''
adoOrg: ''
set -a
. "${SOURCEFILE}"
set +a
name: ado-var-group-sync
trigger:
batch: true
branches:
include:
- master
paths:
include:
- config/*