A minimal demo showing how a user from one tenant (Fabrikam) can chat in Azure Communication Services (ACS) hosted in another tenant (Contoso) using Microsoft Entra ID.
- Cross-tenant sign-in and ACS token exchange
- Blazor Server UI (.NET 9)
- Clear tenant indicators in the chat UI
- Auto-refresh for messages and newly created threads
- Enter key sends message; button click also supported
Run locally in demo mode to explore the UI and flows.
dotnet restore
dotnet runThen open the app and go to /chat. Create a thread and start messaging.
Notes
- The app no longer auto-creates a default thread; you’ll be prompted to create one.
- New threads include a couple of demo participants by email so each side can see/join when they sign in.
Use real ACS and Entra ID resources. For full steps, see LIVE_DEPLOYMENT_GUIDE.md and Infrastructure/MANUAL_SETUP_GUIDE.md.
Prereqs
- Two tenants (Contoso = ACS host, Fabrikam = user source)
- Azure subscription and permissions to deploy
Quick path
# From repo root
cd Infrastructure
./deploy-azure-resources.ps1
./setup-app-registrations.ps1 -ContosoTenantId "<contoso-tenant-guid>" -FabrikamTenantId "<fabrikam-tenant-guid>"
# Back to app root and run
cd ..
dotnet runConfiguration
- All settings:
appsettings.json(now contains production configuration) - Useful UI options:
Chat:AutoRefreshEnabled(bool),Chat:AutoRefreshIntervalMs(500–10000)
CrossTenantChat/
├─ Components/Pages/Chat.razor # Main chat UI
├─ Services/ # Demo + Live ACS/Auth services
├─ Infrastructure/ # Scripts to deploy and configure Azure
├─ appsettings*.json # Config (includes Live)
└─ LIVE_DEPLOYMENT_GUIDE.md # Detailed live setup
- Press Enter to send; the send button is also available.
- Messages and the thread list auto-refresh at a short interval.
- Build locking on Windows: if
CrossTenantChat.exeis in use, stop the running process and rebuild. - Configuration: all settings are now in
appsettings.json- no environment switching needed.
- Azure Communication Services docs: https://learn.microsoft.com/azure/communication-services/
- Entra ID + ACS quickstart (C#): https://learn.microsoft.com/azure/communication-services/quickstarts/identity/microsoft-entra-id-authentication-integration?pivots=programming-language-csharp