A real-time synchronization and chat application built with Azure Static Web Apps, utilizing a microservices architecture with .NET and Python Azure Functions.
- Client: Angular application (hosted via Azure Static Web Apps).
- API: Azure Functions (.NET 10 Isolated) handling SignalR negotiation and message triggers.
- AI Worker: Azure Functions (Python 3.14) processing background tasks via Azure Service Bus.
- Infrastructure:
- Azure Service Bus (Message Broker)
- Azure SignalR Service (Real-time broadcasting)
- Azure Storage (State management)
- .NET 10 SDK (for API)
- Python 3.11+ (for AI Worker)
- Node.js 18+ & Angular CLI (for Client)
- Azure Functions Core Tools v4 (
bun install -g azure-functions-core-tools@4) - Azure Static Web Apps CLI (
bun install -g @azure/static-web-apps-cli) - Azure CLI
- Clone the repository
- Infrastructure Setup:
- Create a Service Bus Namespace & Queue (named
orders). - Create a SignalR Service (Serverless mode).
- Create a Storage Account.
- Create a Service Bus Namespace & Queue (named
- Local Configuration:
- Create
api/local.settings.json:{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "<YOUR_STORAGE_CONNECTION_STRING>", "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", "AzureSignalRConnectionString": "<YOUR_SIGNALR_CONNECTION_STRING>", "ServiceBusConnection": "<YOUR_SERVICE_BUS_CONNECTION_STRING>" } } - Create
ai-worker/local.settings.json:{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "<YOUR_STORAGE_CONNECTION_STRING>", "FUNCTIONS_WORKER_RUNTIME": "python", "AzureSignalRConnectionString": "<YOUR_SIGNALR_CONNECTION_STRING>", "ServiceBusConnection": "<YOUR_SERVICE_BUS_CONNECTION_STRING>" } }
- Create
- CORS:
- Add
http://localhost:4200andhttp://localhost:4280to your Azure SignalR Service CORS settings in the Azure Portal.
- Add
To run the full solution, open three dedicated terminals:
1. AI Worker (Service Bus Consumer)
cd ai-worker
# Create venv if first time: python -m venv .venv
# Activate venv: .venv\Scripts\activate
# Install deps: pip install -r requirements.txt
func start2. API (SignalR & Producer)
cd api
func start3. Client (Frontend)
- Install dependencies:
cd client bun install - Run from Root Directory:
cd .. swa start
(Access app at http://localhost:4200)
You can trigger a test message through the API to verify the full loop:
curl -X POST http://localhost:7071/api/SendMessage -d "Hello SyncFlow!"Expected Result:
- API sends message to Service Bus
ordersqueue. - AI Worker picks up message.
- AI Worker broadcasts message via SignalR.
- Client receives and displays:
New Message received: Hello SyncFlow!