Last active
June 12, 2020 05:40
-
-
Save takekazuomi/fb1b1ab6fed3b051564f5045e1a07d1d to your computer and use it in GitHub Desktop.
create user invitation for Azure Static Web Apps
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
#!/bin/bash | |
SUBSCRIPTION_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | |
RESOURCE_GROUP_NAME=foobar-rg | |
STATIC_SITE_NAME=foobar-swa | |
DOMAIN=purple-apple-0611x5701.azurestaticapps.net | |
USER_DETAILS=foobar@costoco.com | |
cat << EOJ > properties.json | |
{ | |
"properties": { | |
"provider": "aad", | |
"domain": "${DOMAIN}", | |
"roles": "reader", | |
"userDetails": "${USER_DETAILS}", | |
"numHoursToExpiration": 1 | |
} | |
} | |
EOJ | |
az rest --method post --headers "Content-Type=application/json" \ | |
--uri "/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RESOURCE_GROUP_NAME}/providers/Microsoft.Web/staticSites/${STATIC_SITE_NAME}/createUserInvitation?api-version=2019-12-01-preview" \ | |
--body @properties.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment