This guide will walk you through building and deploying your Streamlit-based GPT text summarizer app using Docker and Azure services.
-
Create
requirements.txtpip freeze > requirements.txt -
Create a Dockerfile
-
Build the Docker image
docker build -t testimage . -
Verify the image
docker images
-
Run Docker
docker run -p 8501:8501 testimage
-
Access the app
Navigate to → http://localhost:8501
- Create new ACR (Private Network recommended)
- If access error when pushing:
- Go to
ACR > Networkingand allow specific IP ranges - Go to
ACR > Access Keys→ enable Admin user
- Go to
az login
az acr list --resource-group <resource-group-name> --output table
az account set --subscription "<subscription-id>"
az acr login --name <acr-name>
# Tag and Push Docker Image
docker tag <your_image_name> <acr-name>.azurecr.io/<your_image_name>:latest
docker push <acr-name>.azurecr.io/<your_image_name>:latest
# If error, re-authenticate or adjust IP access range
az acr repository list --name <acr-name> --output table
az acr credential show --name <acr-name>- Go to
ACR > Repositories→ select image → Tags →Deploy to WebApp - Fill in:
- Web App name
- Service Plan
- Go to Azure → App Registrations
- Locate your app → Note down
Application (client) ID - Add Platform → Web →
- Add Redirect URI:
https://<your-app-name>.azurewebsites.net/.auth/login/aad/callback
- Add Redirect URI:
- Enable:
- ✅ ID tokens
- ✅ Accounts in this organizational directory only
- Azure Portal → Enterprise Applications → Find your app
- Assign access:
- Users and Groups → Add user or group → Use
Application (client) ID
- Users and Groups → Add user or group → Use
- Authentication
- Enable App Service authentication
- Require login for access
- Identity Provider → Microsoft → use your
Application (client) ID
-
Monitor Logs from Azure →
WebApp Logs -
Add secrets to Key Vault:
Key: gptappkey Value: <your-secret> -
Docs: Azure Manage Secrets