Building a One■Click Azure Logic App Deployer
using Python & FastAPI
This document explains, step■by■step, how to build a Python web application that authenticates to
Microsoft Azure, supports multi■tenant login, and deploys Azure Logic Apps with live progress
updates. The guide is written to help you learn while developing.
1. Architecture Overview
The application uses FastAPI as the backend framework, Microsoft Entra ID (Azure AD) for
authentication, MSAL for OAuth token handling, WebSockets for real■time deployment progress,
and Azure SDKs for resource deployment.
Core Components:
1 FastAPI – backend API and routing
2 Jinja2 – HTML templating for UI
3 MSAL – Azure authentication
4 WebSockets – live progress updates
5 Azure Resource Manager / SDK – Logic App deployment
2. Project Structure
A clean project structure is essential for FastAPI applications. Python requires __init__.py files so
folders are treated as packages.
Recommended structure:
azure-deployer/ app/ __init__.py [Link] [Link] routes/ __init__.py [Link] templates/ [Link]
[Link] static/ venv/
3. FastAPI Initialization
FastAPI is initialized in [Link]. Routers are included, static files are mounted, and session
middleware is enabled for login persistence.
4. Azure Authentication (Multi■Tenant)
Authentication is implemented using the OAuth 2.0 Authorization Code flow. The application is
registered as a multi■tenant app in Microsoft Entra ID, allowing users from any tenant to sign in.
Key concepts:
1 Redirect URI must match exactly in Azure and code
2 Authority set to [Link]
3 Access token stored securely in session
5. WebSocket Live Deployment Progress
WebSockets keep a persistent connection open between browser and server. This allows
streaming of deployment steps and progress percentages in real time.
This is critical for Azure deployments, which may take several minutes.
6. UI & User Experience
The UI uses HTML templates with Tailwind■style classes to provide a clean interface. A single
button triggers deployment, and a progress bar updates live using WebSocket messages.
7. Next Enhancements
1 Replace mock deployment with real Azure SDK calls
2 Add role■based access control
3 Move secrets to environment variables or Key Vault
4 Integrate AI to generate Logic App templates dynamically
You now have a strong foundation for a production■grade Azure automation platform. Each
component you built is used in real enterprise systems.