Skip to content

Instantly share code, notes, and snippets.

View kenmuse's full-sized avatar

Ken Muse kenmuse

View GitHub Profile
@kenmuse
kenmuse / jwt.sh
Last active August 7, 2023 14:31
Sample of creating a GitHub App JWT and calling the App endpoints
#!/bin/bash
set -euo pipefail
while getopts a:f: flag
do
case "${flag}" in
a) app_id=${OPTARG};;
f) pem_path=${OPTARG};;
esac
done
name: Publish to ADF
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
name: Publish to ADF Alt Flow
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
####
# Secrets from a service principal with permissions for push
# AZURE_APPLICATION_ID - The application (client) ID for the Azure AD application that is providing the service credentials.
# AZURE_APPLICATION_SECRET - The secret associated with the application/service principal. Not required when OIDC is used.
# AZURE_SUBSCRIPTION_ID - the subscription with the Databricks resources.
# AZURE_TENANT_ID - the AAD tenant containing the service principal.
# AZURE_DBR_GITHUB_PAT - the GitHub PAT to associate with the service principal to give it access to the GitHub repo.
####
#Requires –Modules Az.Accounts, Az.Resources
#Requires -Version 7.2
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$PSDefaultParameterValues['*:ErrorAction']='Stop'
New-Variable -Name DirectoryReadAllAppRoleId -Value '7ab1d382-f21e-4acd-a863-ba3e13f7da61' -Option Constant -Scope Script
New-Variable -Name MsGraphResourceId -Value 'e51b873a-e178-4e6a-ab84-b07d68b33bc8' -Option Constant -Scope Script
New-Variable -Name AzRoleUserAccessAdministrator -Value '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9' -Option Constant -Scope Script
New-Variable -Name AzRoleContributor -Value 'b24988ac-6180-42a0-ab88-20f7382dd24c' -Option Constant -Scope Script
@kenmuse
kenmuse / UpdateAzureAppServiceAccess.ps
Created August 28, 2020 23:06
Azure App Service - Restrict Access to Azure Front Door
# Fill in the name of the app service and the resource group containing the service
$appServiceName = ''
$resourceGroupName = ''
###################
# Current API version for calls.
$apiVersion = '2019-08-01'
# Starting priority number