SAP Finance Dashboard - Azure Container Apps Deployment Guide
Prerequisites
- Azure CLI - Install from: https://aka.ms/installazurecliwindows
- Azure Subscription - Active Azure account
- Git (optional) - For code updates
Quick Deploy Steps
Option 1: Automated Deployment Script
Open PowerShell as Administrator and run:
cd "c:\Users\amlal\Downloads\VSCode-SAP-AI-Copilot-Projects2025\SAP-RPT-1-OSS-App"
.\deploy-azure.ps1
The script will:
- โ Create Azure Resource Group
- โ Create Azure Container Registry
- โ Build Docker image in Azure (no local Docker needed)
- โ Create Container Apps Environment
- โ Deploy your application
- โ Provide public URL
Deployment Time: ~10-15 minutes
Option 2: Manual Deployment (Step-by-Step)
If the automated script doesn't work, follow these manual commands:
1. Login to Azure
az login
2. Set Variables
set RESOURCE_GROUP=rg-sap-finance-dashboard
set LOCATION=eastus
set ACR_NAME=acrsapfinance%RANDOM%
set ENVIRONMENT_NAME=env-sap-finance
set APP_NAME=sap-finance-dashboard
3. Create Resource Group
az group create --name %RESOURCE_GROUP% --location %LOCATION%
4. Create Container Registry
az acr create --resource-group %RESOURCE_GROUP% --name %ACR_NAME% --sku Basic --admin-enabled true
5. Build Docker Image (Using Azure - No local Docker needed)
az acr build --registry %ACR_NAME% --image sap-finance-dashboard:latest .
6. Create Container Apps Environment
az containerapp env create --name %ENVIRONMENT_NAME% --resource-group %RESOURCE_GROUP% --location %LOCATION%
7. Deploy Container App
az containerapp create ^
--name %APP_NAME% ^
--resource-group %RESOURCE_GROUP% ^
--environment %ENVIRONMENT_NAME% ^
--image %ACR_NAME%.azurecr.io/sap-finance-dashboard:latest ^
--registry-server %ACR_NAME%.azurecr.io ^
--target-port 7862 ^
--ingress external ^
--cpu 2 ^
--memory 4Gi ^
--min-replicas 1 ^
--max-replicas 3
8. Get Application URL
az containerapp show --name %APP_NAME% --resource-group %RESOURCE_GROUP% --query properties.configuration.ingress.fqdn -o tsv
Post-Deployment Configuration
Add Hugging Face Token (Required for AI Features)
- Go to Azure Portal: https://portal.azure.com
- Navigate to your Container App
- Go to Settings > Secrets
- Add secret:
- Name:
huggingface-token - Value: Your Hugging Face token (get from https://huggingface.co/settings/tokens)
- Name:
- Go to Settings > Containers > Environment variables
- Add environment variable:
- Name:
HUGGINGFACE_TOKEN - Source: Reference a secret
- Value: Select
huggingface-token
- Name:
- Click Save and wait for app to restart
Optional: Add SAP OData Credentials
If connecting to SAP systems:
SAP_ODATA_BASE_URL: Your SAP OData endpointSAP_USERNAME: SAP username (as secret)SAP_PASSWORD: SAP password (as secret)
Application Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Azure Container Apps โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ SAP Finance Dashboard โ โ
โ โ - Gradio Web Interface โ โ
โ โ - RPT-1-OSS AI Model โ โ
โ โ - Port 7862 โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Azure Container Registry โ โ
โ โ - Docker Image Storage โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Application Features
Once deployed, you'll have access to:
- ๐ Dashboard - Financial metrics and visualizations
- ๐ Data Explorer - Browse datasets
- ๐ค Upload - Upload custom CSV files
- ๐ค AI Predictions - SAP-RPT-1-OSS powered predictions
- ๐ OData - Connect to SAP systems
- ๐ฎ Playground - Custom model training
Scaling Configuration
The default configuration:
- Min Replicas: 1 (always running)
- Max Replicas: 3 (auto-scale under load)
- CPU: 2 cores
- Memory: 4 GB
To adjust scaling:
az containerapp update ^
--name %APP_NAME% ^
--resource-group %RESOURCE_GROUP% ^
--min-replicas 1 ^
--max-replicas 5 ^
--cpu 4 ^
--memory 8Gi
Cost Optimization
Estimated Monthly Cost (East US):
- Container Apps (1 replica, 2 vCPU, 4GB): ~$60/month
- Container Registry (Basic): ~$5/month
- Total: ~$65/month
To reduce costs:
- Set min-replicas to 0 (app sleeps when not in use)
- Use smaller CPU/memory allocation
- Delete when not needed:
az group delete --name %RESOURCE_GROUP% --yes
Monitoring & Logs
View Live Logs
az containerapp logs show --name %APP_NAME% --resource-group %RESOURCE_GROUP% --follow
View Metrics (Azure Portal)
- Go to your Container App
- Click Monitoring > Metrics
- View:
- CPU usage
- Memory usage
- Request count
- Response time
Updating Your Application
When you make code changes:
# Build new image
az acr build --registry %ACR_NAME% --image sap-finance-dashboard:latest .
# Update container app
az containerapp update ^
--name %APP_NAME% ^
--resource-group %RESOURCE_GROUP% ^
--image %ACR_NAME%.azurecr.io/sap-finance-dashboard:latest
Troubleshooting
App not starting?
Check logs:
az containerapp logs show --name %APP_NAME% --resource-group %RESOURCE_GROUP% --tail 100
Out of memory?
Increase memory allocation:
az containerapp update --name %APP_NAME% --resource-group %RESOURCE_GROUP% --memory 8Gi
Port issues?
Verify port is set to 7862:
az containerapp show --name %APP_NAME% --resource-group %RESOURCE_GROUP% --query properties.configuration.ingress
Can't access URL?
Check ingress is enabled:
az containerapp ingress show --name %APP_NAME% --resource-group %RESOURCE_GROUP%
Security Best Practices
- Use Managed Identity for Azure service connections
- Store secrets in Azure Key Vault
- Enable HTTPS only (default enabled)
- Restrict ingress to specific IPs if needed
- Rotate tokens regularly
Support
- Azure Container Apps Docs: https://learn.microsoft.com/azure/container-apps/
- SAP-RPT-1-OSS: https://github.com/SAP-samples/sap-rpt-1-oss
- Gradio Docs: https://gradio.app/docs
Clean Up
To delete all resources and stop charges:
az group delete --name %RESOURCE_GROUP% --yes --no-wait
Ready to deploy? Run the automated script or follow the manual steps above! ๐