This repo shows how you can develop and deploy an Azure Communication Services app with the help of Azure Static Web Apps.
To work with chat and calling in Azure Communication Services you need to
obtain user access tokens.
This repo comes with a pre-configured /api/token
endpoint that you can call
from your web app and get access to calling and chat functionality right away.
To set up local development follow the steps from the Static Web Apps how-to guide:
-
Install the CLI.
npm install -g @azure/static-web-apps-cli azure-functions-core-tools
-
Get your Azure Communication Services connection string and add enter it under
COMMUNICATION_SERVICES_CONNECTION_STRING
key in yourlocal.settings.json
file:{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "", "FUNCTIONS_WORKER_RUNTIME": "dotnet", "COMMUNICATION_SERVICES_CONNECTION_STRING": "<YOUR CONNECTION STRING HERE>" } }
-
From the root of your repo start the Azure Static Web Apps CLI.
swa start src --api-location api
-
Follow the Static Web Apps quickstart to configure and deploy your web app via Azure Portal.
-
Once the app is deployed, use the Azure Portal to configure app settings: add a new app setting with name =
COMMUNICATION_SERVICES_CONNECTION_STRING
and value = your Azure Communication Services connection string.