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
#!/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 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
// NOTE: This is now rolled up in a package and supports more scenarios: https://github.com/dsherret/using-statement | |
interface IDisposable { | |
dispose(); | |
} | |
function using<T extends IDisposable>(resource: T, func: (resource: T) => void) { | |
try { | |
func(resource); | |
} finally { |