The `azure-communication-identity` library provides client-side functionality for managing user identities and issuing access tokens for Azure Communication Services. It allows applications to create, delete, and manage users, and to generate tokens required for client-side authentication with various communication functionalities like chat and calling. The current version is 1.5.0, and new versions are released regularly as part of the broader Azure SDK for Python, typically every 1-2 months or as features/fixes dictate.
pip install azure-communication-identityVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `CommunicationIdentityClient`, create a new user identity, and issue an access token for that identity with specific scopes (e.g., chat and VoIP). It requires the `COMMUNICATION_SERVICES_CONNECTION_STRING` environment variable to be set, containing your Azure Communication Services resource's endpoint and access key. Identities incur costs, so consider deleting them after use if they are temporary.
Update your code to use `from azure.communication.identity import CommunicationIdentityClient` and instantiate this class.
Replace calls to `client.issue_token(...)` with `client.get_token(...)`.
Update your import statement from `from azure.communication.identity import CommunicationTokenScope` to `from azure.communication.identity.models import CommunicationTokenScope`.
Implement proper lifecycle management, including calling `client.delete_user(user)` when an identity is no longer required.
Verify the connection string obtained from the Azure portal, ensuring both 'endpoint=' and 'accesskey=' components are present and correctly formatted.
Run: `pip install azure-communication-identity`
Update your code to use `client.get_token(user, scopes=[...])` instead of `client.issue_token(...)`.
Double-check your `COMMUNICATION_SERVICES_CONNECTION_STRING` environment variable or hardcoded string against the format `endpoint=https://<your-resource>.communication.azure.com/;accesskey=<your-access-key>`.
Change your import statement to `from azure.communication.identity.models import CommunicationTokenScope`.
No dependency data recorded yet.