Skip to content

Instantly share code, notes, and snippets.

@takekazuomi
Created January 7, 2021 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save takekazuomi/408c5198d6dbd0cddfe3f1864379d201 to your computer and use it in GitHub Desktop.
Save takekazuomi/408c5198d6dbd0cddfe3f1864379d201 to your computer and use it in GitHub Desktop.
Azure Static WebApps createUserInvitation script
#!/bin/bash
SUBSCRIPTION_ID=xxxxxxx
RESOURCE_GROUP_NAME=xxxxxxx
STATIC_SITE_NAME=xxxxxxx
DOMAIN=xxxxxxx.azurestaticapps.net
USER_DETAILS=xxxxxxx
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