Skip to content

Enterprise-grade Azure Communication Services reference architecture with Voice, Video, Chat, SMS capabilities. Aligned with CAF, WAF, and Azure Landing Zones.

License

Notifications You must be signed in to change notification settings

StormyDevil/azure-communication-services-reference

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Azure Communication Services - Enterprise Reference Architecture

Deploy to Azure License: MIT Azure Well-Architected

Enterprise-grade Azure Communication Services solution - Voice, Video, Chat, SMS, and Email capabilities aligned with Cloud Adoption Framework (CAF), Well-Architected Framework (WAF), and Azure Landing Zones.

🎯 Solution Overview

Azure Communication Services (ACS) is a cloud-based communications platform that enables developers to add voice, video, chat, SMS, and email capabilities to applications. This reference architecture demonstrates an enterprise-ready deployment following Microsoft best practices.

What is Azure Communication Services?

Azure Communication Services provides:

Capability Description Use Cases
Voice & PSTN VoIP calling, PSTN connectivity, call recording Contact centers, telemedicine, customer support
Video 1:1 and group video calls, screen sharing Virtual consultations, remote collaboration
Chat Real-time messaging with threading In-app messaging, customer engagement
SMS Send and receive SMS messages Notifications, 2FA, alerts
Email Transactional email delivery Invoices, notifications, marketing
Advanced Messaging WhatsApp, Teams interop Multi-channel communication

Architecture Highlights

Azure Communication Services - Enterprise Architecture

πŸ“Š View as Mermaid Diagram (text-based)
%%{init: {'theme':'neutral'}}%%
graph TB
    subgraph "Client Applications"
        WEB[Web App<br/>React/Angular]
        MOB[Mobile App<br/>iOS/Android]
        BOT[Bot/Automation]
    end
    
    subgraph "Azure Landing Zone"
        subgraph "Application Tier"
            APPSVC[Azure App Service<br/>Flask API]
            FUNC[Azure Functions<br/>Event Processing]
        end
        
        subgraph "Communication Services"
            ACS[Azure Communication Services<br/>Voice/Video/Chat/SMS]
            EVENTGRID[Event Grid<br/>System Topic]
        end
        
        subgraph "Security & Identity"
            KV[Key Vault<br/>Secrets & Keys]
            MI[Managed Identity]
        end
        
        subgraph "Data & Monitoring"
            COSMOS[Cosmos DB<br/>Chat History]
            BLOB[Storage Account<br/>Recordings]
            LA[Log Analytics<br/>Workspace]
            AI[Application Insights]
        end
    end
    
    WEB --> APPSVC
    MOB --> APPSVC
    BOT --> FUNC
    APPSVC --> ACS
    FUNC --> ACS
    ACS --> EVENTGRID
    EVENTGRID --> FUNC
    APPSVC --> KV
    FUNC --> KV
    APPSVC --> MI
    FUNC --> MI
    FUNC --> COSMOS
    ACS --> BLOB
    ACS --> LA
    APPSVC --> AI
    FUNC --> AI
Loading

πŸ’‘ Additional diagrams: See Landing Zone Integration and Data Flow. Regenerate with python docs/diagrams/generate_diagram.py (requires Graphviz).

πŸ“‹ Prerequisites

  • Azure subscription with Contributor access
  • Azure CLI 2.50+ with Bicep CLI
  • PowerShell 7+ (cross-platform)
  • Python 3.9+ (for sample applications)
  • Git 2.30+

Required Azure Permissions

Scope Role Purpose
Subscription Contributor Deploy resources
Entra ID Application Administrator Register applications
Communication Services Owner Manage ACS configuration

πŸš€ Quick Start

Option 1: Dev Container (Recommended) 🐳

The fastest way to get started is using the included Dev Container, which provides a fully configured development environment with all required tools pre-installed.

Prerequisites:

Steps:

# Clone the repository
git clone https://github.com/StormyDevil/azure-communication-services-reference.git
cd azure-communication-services-reference

# Open in VS Code
code .

When VS Code opens, click "Reopen in Container" when prompted (or use Ctrl+Shift+P β†’ "Dev Containers: Reopen in Container").

The container includes:

  • βœ… Python 3.11 with all dependencies
  • βœ… Azure CLI with Bicep
  • βœ… Azure Functions Core Tools v4
  • βœ… PowerShell 7
  • βœ… Azure Developer CLI (azd)
  • βœ… Pre-configured VS Code extensions

Once the container is running:

# Login to Azure
az login

# Deploy to Azure
pwsh ./scripts/deploy.ps1 -Environment dev -Location swedencentral

Option 2: Local Development

# Clone the repository
git clone https://github.com/StormyDevil/azure-communication-services-reference.git
cd azure-communication-services-reference

# Deploy to Azure
pwsh ./scripts/deploy.ps1 -Environment dev -Location swedencentral

Prerequisites:

Option 3: Step-by-Step Deployment

# 1. Login to Azure
az login

# 2. Set subscription
az account set --subscription "YOUR_SUBSCRIPTION_ID"

# 3. Set your preferred location
LOCATION="swedencentral"  # Options: swedencentral, westeurope, eastus, westus2, etc.

# 4. Create resource group
az group create --name rg-acs-dev --location $LOCATION

# 5. Deploy infrastructure
az deployment group create \
    --name acs-deployment \
    --resource-group rg-acs-dev \
    --template-file infra/bicep/main.bicep \
    --parameters infra/bicep/parameters/dev.bicepparam

πŸ“ Repository Structure

azure-communication-services-reference/
β”œβ”€β”€ .devcontainer/           # Dev Container configuration
β”‚   β”œβ”€β”€ devcontainer.json    # Container settings & extensions
β”‚   └── post-create.sh       # Setup script
β”œβ”€β”€ .env.example             # Environment variables template
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ chatmodes/           # GitHub Copilot chat modes
β”‚   └── workflows/           # CI/CD pipelines
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ cost-estimate.md     # Cost estimation guide
β”‚   β”œβ”€β”€ diagrams/            # Architecture diagrams (Python)
β”‚   └── waf-assessment/      # Well-Architected assessment
β”œβ”€β”€ infra/
β”‚   └── bicep/
β”‚       β”œβ”€β”€ main.bicep       # Main deployment template
β”‚       β”œβ”€β”€ main.json        # Compiled ARM template
β”‚       β”œβ”€β”€ modules/         # Reusable Bicep modules
β”‚       β”‚   β”œβ”€β”€ acs-secrets.bicep
β”‚       β”‚   β”œβ”€β”€ app-service.bicep
β”‚       β”‚   β”œβ”€β”€ communication-services.bicep
β”‚       β”‚   β”œβ”€β”€ cosmos-db.bicep
β”‚       β”‚   β”œβ”€β”€ event-grid.bicep
β”‚       β”‚   β”œβ”€β”€ function-app.bicep
β”‚       β”‚   β”œβ”€β”€ key-vault.bicep
β”‚       β”‚   β”œβ”€β”€ monitoring.bicep
β”‚       β”‚   └── storage.bicep
β”‚       └── parameters/      # Environment parameters
β”‚           β”œβ”€β”€ dev.bicepparam
β”‚           └── prod.bicepparam
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ deploy.ps1           # Deployment script
β”‚   β”œβ”€β”€ cleanup.ps1          # Cleanup script
β”‚   β”œβ”€β”€ configure-acs.ps1    # Post-deployment configuration
β”‚   β”œβ”€β”€ acs-config.json      # ACS configuration file
β”‚   └── acs-config.schema.json
β”œβ”€β”€ src/
β”‚   └── python/
β”‚       β”œβ”€β”€ app.py           # Flask REST API
β”‚       β”œβ”€β”€ acs_sdk_sample.py # ACS SDK examples
β”‚       β”œβ”€β”€ requirements.txt
β”‚       └── functions/       # Azure Functions (event processing)
β”‚           β”œβ”€β”€ function_app.py
β”‚           β”œβ”€β”€ function.json
β”‚           └── host.json
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ CONTRIBUTING.md
└── SECURITY.md

πŸ—οΈ Architecture Principles

Cloud Adoption Framework (CAF) Alignment

CAF Pillar Implementation
Strategy Communication-as-a-Service for digital transformation
Plan Phased rollout: Chat β†’ Voice β†’ Video β†’ Advanced
Ready Landing zone with security baseline
Adopt ACS SDK integration patterns
Govern Cost management, compliance policies
Manage Monitoring, incident response

Well-Architected Framework Assessment

See docs/waf-assessment/README.md for the complete assessment.

Pillar Score Key Recommendations
Reliability 85/100 Multi-region, circuit breakers, retry policies
Security 90/100 Managed Identity, Key Vault, TLS 1.3
Cost Optimization 80/100 Reserved capacity, auto-scaling
Operational Excellence 85/100 IaC, GitOps, monitoring
Performance Efficiency 82/100 CDN, connection pooling, caching

Azure Landing Zone Integration

This solution deploys into an Azure Landing Zone with:

  • Connectivity Subscription: Hub network with ExpressRoute/VPN
  • Identity Subscription: Entra ID integration
  • Management Subscription: Monitoring, backup
  • Landing Zone Subscription: ACS and application resources

πŸ”§ Configuration

Environment Variables

Variable Description Required
ACS_CONNECTION_STRING ACS connection string Yes
ACS_ENDPOINT ACS endpoint URL Yes
AZURE_TENANT_ID Entra ID tenant ID Yes
AZURE_CLIENT_ID Application client ID For SDK auth
COSMOS_CONNECTION_STRING Cosmos DB connection For chat history

Parameters

Edit the parameter files in infra/bicep/parameters/:

// parameters/dev.bicepparam
using '../main.bicep'

param environment = 'dev'
param projectName = 'acsref'
param enableSms = true
param enableVoice = true
param enableVideo = true
param enableChat = true
param enableEmail = false  // Disabled by default
param enableAdvancedMessaging = false
param deployApplication = true  // Set to false for infrastructure-only

πŸ“Š Monitoring & Observability

Built-in Dashboards

The deployment includes Azure Monitor workbooks for:

  • Call quality metrics (MOS scores, packet loss)
  • Message delivery rates
  • API latency and error rates
  • Cost tracking by capability

Alerts

Pre-configured alerts for:

Metric Threshold Severity
Call failure rate > 5% High
Message delivery failure > 2% Medium
API response time > 2s Medium
Daily spend > $100 Low

πŸ’° Cost Estimation

See docs/cost-estimate.md for detailed pricing.

Capability Unit Price (approx)
Voice (PSTN) per minute $0.004 - $0.02
Video per participant/min $0.004
Chat per message $0.0008
SMS (outbound) per message $0.0075
Email per 1000 emails $0.25

Estimated monthly cost for medium enterprise: $500 - $2,000

πŸ”’ Security Considerations

Authentication

  • Users: Entra ID with MFA
  • Applications: Managed Identity (preferred) or Service Principal
  • SDK Access: ACS tokens with configurable expiry

Network Security

  • Private endpoints for ACS (preview)
  • Network security groups
  • Azure Firewall integration
  • DDoS protection

Data Protection

  • Encryption at rest (AES-256)
  • Encryption in transit (TLS 1.3)
  • Call recording encryption
  • GDPR compliance controls

πŸ§ͺ Testing

Run Integration Tests

# Install dependencies
pip install -r tests/requirements.txt

# Run tests
pytest tests/integration/ -v

Run End-to-End Tests

pytest tests/e2e/ -v --acs-endpoint $ACS_ENDPOINT

🀝 Contributing

See CONTRIBUTING.md for guidelines.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

πŸ“š Resources

πŸ“„ License

This project is licensed under the MIT License - see LICENSE for details.

πŸ™ Acknowledgments

  • Azure Agentic InfraOps by Jonathan Vella - This project was created using the Azure Agentic InfraOps methodology
  • GitHub Copilot - AI pair programmer that assisted in developing this reference architecture
  • Azure Communication Services team
  • Azure Well-Architected team
  • Community contributors

About

Enterprise-grade Azure Communication Services reference architecture with Voice, Video, Chat, SMS capabilities. Aligned with CAF, WAF, and Azure Landing Zones.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published