The purpose of this document is to demonstrate how to configure the EventGrid Viewer Blazor application with Azure AD authentication using bash, once the application has been deployed. You could use the bash script as part of an automated process.
- Azure Account
- Elevated permissions to create Azure Service Principals
- An existing Azure Keyvault
- Docker (optional)
Instructions:
-
Create an Azure Keyvault, if one does not exist.
-
Use the Deploy to Azure button below to quickly deploy the application. Use the image below as a guide.
You will be presented with a screen similar to the image below:
Do the following:
- Create or Select a Resource Group
- Enter a Site Name
- Enter a Hosting Plan Name
- Enable Auth
- Enter a Keyvault Name
- Enter a Azure AD Domain ie {youraccount}.onmicrosoft.com
- Hit the Review + Create button to validate & deploy the EventGrid Viewer Blazor application
After the application is deployed:
- You will need to set the Terraform environment variables when you run the docker container. You will need to provide:
- A azure subscription
- A resource group name
- A web app name
- A keyvault name
- Run the following bash commands in order:
# build image
docker build -t egvb-samples .
# Replace the environment variables
docker run -it -e AZURE_SUBSCRIPTION_ID=<azure_subscription_id> -e resource_group_name=<resoure_group> -e web_app_name=<app_name> -e key_vault_name=<key_vault_name> egvb-samples
# switch to bash-auth directory
cd bash-auth
# for script usage example
# ./configure-auth.sh -h
# execute script with parameters used with deploy to azure button to configure deployed app with az ad authentication
./configure-auth.sh -s $AZURE_SUBSCRIPTION_ID -g $resource_group_name -a $web_app_name -k $key_vault_name
Copy the App Registration AppId from the output of the configure-auth.sh
script.
az group delete -n $resource_group_name && az ad app delete --id <app_id>