Forum Discussion

JustDavidJ's avatar
JustDavidJ
Copper Contributor
Feb 02, 2024

Azure Communication Services Chat add MicrosoftTeamsUserIdentifier fails

I am trying to build a proof of concept chat app that allows our internal Teams users to join an Azure Communication Services Chat thread. 

I have managed to convert the Azure AD token to a Communication Services Token using
identity_client.get_token_for_teams_user()  in Python. 

I then create a MicrosoftTeamsUserIdentifier object using the 'oid' attribute from the Azure account. 

But when I attempt to add this user to the thread using 'chat_client_thread.add_participants()
it errors out with 403 permissions check failed. 
the underlying call to the communication services add api succeeds with a 201 response code. 
but after that it somehow gets converted to a 403 response. 

 

Then after that it errors again because the underlying code is expecting all Communication Identifiers to contain an 'id' field and MicrosoftTeamsUserIdentifier does not contain that field. 

This is the final error I see at the top level.

File "******/chat-server-poc/.venv/lib/python3.10/site-packages/azure/communication/chat/_utils.py", line 53, in create_dict
    result[participant.identifier.properties['id']] = participant
KeyError: 'id'



Looking for guidance or example code.

Thanks.

  • Hi JustDavidJ, it seems like you are trying to use a scenario for Communication as Teams user identity for ACS communication. Currently, we do not support adding MicrosoftTeamsUserIdentifers for Chat, Communication as Teams user is only supported for Calling. Communication as Teams user for Chat is on the roadmap.

     

    As a workaround, we recommend to create an ACS user identity while keeping your own mapping to the Teams user to use ACS Chat.

    • Vinayaka1970's avatar
      Vinayaka1970
      Copper Contributor

      Hi jimchou-dev "Thank you for the information. Could you please provide more details on the timeline or expected release date for the support of MicrosoftTeamsUserIdentifiers in ACS Chat, as mentioned in the roadmap? Also, is there any official documentation or updates we can follow regarding this feature?"

Resources