Skip to content

Python SDK Recipes

This section contains focused code recipes for specific Azure Communication Services (ACS) tasks.

Recipe Catalog

Recipe When to Use
Managed Identity Authenticating with ACS using Azure Managed Identities instead of connection strings.
Key Vault Reference Storing and retrieving ACS connection strings securely from Azure Key Vault.
Event Grid Webhooks Handling ACS events (SMS received, Email delivered) using Flask or FastAPI.
Phone Number Management Searching, purchasing, and releasing ACS phone numbers.
Email with Attachments Sending emails with multiple file attachments and handling size limits.
Chat with File Sharing Implementing file sharing within ACS chat threads.
Teams Interop Joining Microsoft Teams meetings and mapping identities between ACS and Teams.
from azure.communication.identity import CommunicationIdentityClient
from azure.identity import DefaultAzureCredential

endpoint = "https://<your-acs-resource-name>.communication.azure.com"
client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())

See Also

Sources