OAuth 2.0 - Tutorial 2 - Azure Server Side Python WebApp Auth Code Flow - Entra ID
Introduction
In the previous tutorial Localhost Python WebApp Auth Code Flow with Entra ID , we demonstrated using a localhost web app as a “server-side app” (confidential client) with the Authorization Code Flow. In this tutorial, we will deploy the app to Azure, making it a true “server-side app” where users cannot access secrets.
The following steps are required to deploy the app to Azure:
- Create an Azure Container Registry
- Create a Dockerfile and publish the image to the registry
- Create an Azure Web App using this container
- Add environment variables (tenant, client ID, client secret)
- Add a new redirect URI to the app registration
- Update the redirect URI in the app code
Prerequisites
- Microsoft Azure Tenant with active Subscription
- Docker installed
- Azure CLI installed
- UV installed: UV Installation
Create Azure Container Registry
Create an Azure container registry where you can store your docker images: