Skip to content

Latest commit

 

History

History
68 lines (46 loc) · 2.5 KB

File metadata and controls

68 lines (46 loc) · 2.5 KB

Overview

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.

Prerequisites

  1. Azure Account
  2. Elevated permissions to create Azure Service Principals
  3. An existing Azure Keyvault
  4. Docker (optional)

Instructions:

  1. Create an Azure Keyvault, if one does not exist.

  2. Use the Deploy to Azure button below to quickly deploy the application. Use the image below as a guide.

Deploy to Azure

You will be presented with a screen similar to the image below:

Deploy to Azure

Do the following:

  1. Create or Select a Resource Group
  2. Enter a Site Name
  3. Enter a Hosting Plan Name
  4. Enable Auth
  5. Enter a Keyvault Name
  6. Enter a Azure AD Domain ie {youraccount}.onmicrosoft.com
  7. Hit the Review + Create button to validate & deploy the EventGrid Viewer Blazor application

After the application is deployed:

  1. 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
  2. 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

Teardown

Copy the App Registration AppId from the output of the configure-auth.sh script.

App Registration AppId

    az group delete -n $resource_group_name  && az ad app delete --id <app_id>