This file contains hidden or 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
#!/usr/bin/env zsh | |
function createAppRegistration (){ | |
local appName=$1 | |
appObjectId=`az ad app create --display-name "${appName}" --oauth2-allow-implicit-flow false --query "objectId" --output tsv` | |
# Undocumented: You need to create the service principal to back the app registration | |
# https://github.com/Azure/azure-cli/issues/12797#issuecomment-612138520 | |
sp=`az ad sp create --id ${appObjectId}` | |
appId=`az ad app show --id ${appObjectId} --query "appId" --output tsv` |
This file contains hidden or 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
# Path to your oh-my-zsh installation. | |
export ZSH="/home/garrytrinder/.oh-my-zsh" | |
COMPLETION_WAITING_DOTS="true" | |
ZSH_THEME="spaceship" | |
SPACESHIP_PROMPT_ORDER=( | |
dir # Current directory section | |
git # Git section (git_branch + git_status) |
This file contains hidden or 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
#!/usr/bin/env zsh | |
path='../public/img/managedidentity' | |
files=( | |
"${path}/configure-logic-app" | |
"${path}/create-logic-app" | |
"${path}/enable-managed-identity" | |
"${path}/grant-microsoft-graph-permission" | |
"${path}/run-logic-app" | |
"${path}/view-managed-identity-service-principal" |
This file contains hidden or 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
{ | |
"isFallbackPublicClient": true, | |
"publicClient": { | |
"redirectUris": [ | |
"https://login.microsoftonline.com/common/oauth2/nativeclient" | |
] | |
}, | |
"web": { | |
"implicitGrantSettings": { | |
"enableIdTokenIssuance": false |
This file contains hidden or 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
appId=`az ad app create --display-name acms --password abcde12345 --credential-description master --required-resource-accesses @manifest.json --query "appId" --output tsv` | |
az ad app permission admin-consent --id ${appId} |
This file contains hidden or 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/2019-08-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"eventHubName": { | |
"type": "string", | |
"metadata": { | |
"description": "The name of the Azure Event Hub resource" | |
} | |
}, |
This file contains hidden or 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
az group create --location uksouth --name rg-dotnetfunctionlocalapponlymsi-dev | |
az storage account create --name stlocalapponlymsidev --resource-group rg-dotnetfunctionlocalapponlymsi-dev | |
az extension add --name application-insights | |
az monitor app-insights component create --app dotnetfunctionlocalapponlymsi --location uksouth --resource-group rg-dotnetfunctionlocalapponlymsi-dev --application-type web | |
az functionapp create --name func-dotnetfunctionlocalapponlymsi-dev --resource-group rg-dotnetfunctionlocalapponlymsi-dev --storage-account stlocalapponlymsidev --functions-version 3 --runtime dotnet --os-type Linux --app-insights dotnetfunctionlocalapponlymsi --consumption-plan-location uksouth | |
az functionapp identity assign --name func-dotnetfunctionlocalapponlymsi-dev --resource-group rg-dotnetfunctionlocalapponlymsi-dev |
This file contains hidden or 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
$token = o365 util accesstoken get -r "https://graph.microsoft.com" --new | |
$template = Get-Content -Path ./template.json | |
$options = @{ | |
Method = "Post" | |
Uri = "https://graph.microsoft.com/beta/teams" | |
ContentType = "application/json" | |
Body = $template | |
Headers = @{ | |
"Authorization" = "Bearer $token"; |
This file contains hidden or 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] | |
$appName | |
) | |
$users = o365 aad user list --properties "id,displayName" -o json | ConvertFrom-Json | |
$app = o365 teams app list -o json | ConvertFrom-Json | Where-Object { $_.displayName -eq $AppName } |