Skip to content

Latest commit

 

History

History
156 lines (91 loc) · 8.99 KB

azure.md

File metadata and controls

156 lines (91 loc) · 8.99 KB

Azure Demo Infrastructure

This document will walk through each step of the create.sh script and show the infrastructure that is being created and configured.

. init-variables.sh sets all of the environment variables used throughout the script to refer to the names of the infrastructure being generated. See init-variables.sh.

Resource Group

Back to Top

az group create establishes a resource group to aggregate all of the related Azure services that will be generated by the rest of the script. Isolating capabilities by resource group allows you to easily contain and manage related resources without affecting other cloud infrastructure.

image

Key Vault

Back to Top

az keyvault create establishes an Azure Key Vault for managing secrets (API keys, connection strings, etc.).

image

Azure AD Auth

Back to Top

Lines 23 - 168 configure and persist all of the OAuth and OpenIDConnect app registrations and configuration necessary for facilitating Azure AD authorization for the API and SPA App.

Lines 104 - 121 automatically update the API and CLI appsettings with the generated values needed to facilitate AD auth.

App Registration

image

API Authentication Configuration

image

API Optional Claims

image

API Exposure

image

API App Roles

image

SPA App Authentication

image

SPA App API Permissions

image

For isolated examples of Azure AD integration, see the following:

Azure Container Registry

Back to Top

az acr create creates an Azure Container Registry for hosting generated Docker images.

image

Build Images

Back to Top

az acr build generates an image for each of the app projects and pushes them out to the previously generated Azure Container Registry.

image

Azure App Service

Back to Top

az appservice plan create creates an App Service plan for generated Azure App Service instances.

az webapp create generates an Azure App Service for each app project and uses the linked docker image from the container registry.

image

Deployed Sync Server

image

Deployed Processor Service

image

Deployed App API

image

Deployed SPA App

image

Logging

Back to Top

az webapp log config configures logging for each Azure App Service instance.

image

Continuous Deployment

Back to Top

az webapp deployment container config enables continous deployment for each Azure App Service instance. Whenever a new image is pushed to Azure Container Registry, the corresponding Azure App Service instance will automatically update itself to the new image instance.

image

Azure Container Registry Webhoooks

Back to Top

az acr webhook create generates the web hooks needed for Azure Container Registry to push newly received images to their corresponding App Service instance.

image

CORS Configuration

Back to Top

az webapp cors add configures CORS on the sync server to allow the SPA to send and receive web socket broadcasts. az resource update directly below enables the Access-Control-Allow-Credentials header.

image

Grant Key Vault Access

Back to Top

Line 370 - 395 configures the App API to access the Key Vault.

The Key Vault name is added to the app settings with a VaultName key (az webapp config appsettings set):

image

The App API creates a Managed Identity (the Azure Services equivalent to a service account) that is used to grant access to the Key Vault (az webapp identity assign):

image

az keyvault set-policy grants the get list secret permissions to the App API managed identity:

image