Registry /
azure / azure-communication-rooms
Install & Compatibility
Where this runs
tested against v1.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.433s · 42.6MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.1s · import 0.399s · 43MB
41MB installed
● package 41MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
RoomsClient
✓ from azure.communication.rooms import RoomsClient
✗ from azure.communication.rooms._rooms_client import RoomsClient
Private underscored modules should not be imported directly; use the public API.
RoomParticipant
✓ from azure.communication.rooms import RoomParticipant
✗ from azure.communication.rooms.models import RoomParticipant
RoomParticipant is exposed at package level; the .models submodule is considered private.
ParticipantRole
✓ from azure.communication.rooms import ParticipantRole
✗ from azure.communication.rooms._models import ParticipantRole
Use the public package-level export, not private module.
Authenticate, create a room, list rooms, update, and delete. Replace the identifier and endpoint with your Azure Communication Services resource details.
import os
from azure.communication.rooms import RoomsClient, RoomParticipant, ParticipantRole
from azure.identity import DefaultAzureCredential
# Use environment variable AZURE_COMMUNICATION_CONNECTION_STRING for connection string
# or use DefaultAzureCredential with endpoint.
# For simplicity, using a connection string (replace with actual).
endpoint = os.environ.get('AZURE_COMMUNICATION_ENDPOINT', '')
credential = DefaultAzureCredential()
rooms_client = RoomsClient(endpoint, credential)
# Create a room
room = rooms_client.create_room(
valid_from=None,
valid_until=None,
participants=[
RoomParticipant(
communication_identifier='8:acs:your-identifier', # replace
role=ParticipantRole.PRESENTER
)
]
)
print(f'Room created with ID: {room.id}')
# List rooms
rooms = rooms_client.list_rooms()
for r in rooms:
print(f'Room ID: {r.id}')
# Update room validity
updated = rooms_client.update_room(room_id=room.id, valid_from=None, valid_until=None)
print(f'Room updated: {updated.id}')
# Delete room
rooms_client.delete_room(room_id=room.id)
Errors
Common errors & fixes
'RoomsClient' object has no attribute 'create_room'
Using an older version (<1.0.0) or importing from wrong module. The `create_room` method was introduced in the first stable release.
fixUpgrade to latest version: `pip install --upgrade azure-communication-rooms` and ensure import: `from azure.communication.rooms import RoomsClient`
AttributeError: module 'azure.communication.rooms' has no attribute 'RoomParticipant'
Importing from a non-existent subpackage or version mismatch. `RoomParticipant` is available from version 1.0.0+ but may be called `ParticipantRole` incorrectly.
fixUpgrade to >=1.0.0 and use correct import: `from azure.communication.rooms import RoomParticipant`
ValueError: Invalid role. Valid roles are: Attendee, Consumer, Presenter
Passing a string like 'Viewer' or 'Speaker' instead of the `ParticipantRole` enum.
fixUse `ParticipantRole.ATTENDEE`, `ParticipantRole.CONSUMER`, or `ParticipantRole.PRESENTER` (not their string counterparts).
HttpResponseError: (BadRequest) Participant identifier is not valid.
The `communication_identifier` is malformed or not a valid Communication Services identity. It must start with '8:acs:' followed by the resource ID and user ID.
fixGenerate a valid identifier via `CommunicationIdentityClient.create_user()` or use a known raw ID.
ModuleNotFoundError: No module named 'azure.communication'
Missing base `azure-communication-rooms` package or incorrect installation order.
fixInstall the package: `pip install azure-communication-rooms`. It includes the `azure.communication` namespace.
Upgrade
Version history
1.2.0latest on PyPI · released Mar 19, 2025
Audit
Dependencies
azure-corerequiredRequired for HTTP pipeline and authentication
azure-identityoptionalRecommended for obtaining credentials (DefaultAzureCredential, etc.)