Skip to content

Commit c24d725

Browse files
author
Minnie Liu
committed
Addressing comment
1 parent ce236ef commit c24d725

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

articles/communication-services/quickstarts/rooms/includes/rooms-quickstart-net.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ dotnet build
4545
Install the Azure Communication Rooms client library for .NET with [NuGet][https://www.nuget.org/]:
4646

4747
```console
48-
dotnet add package Azure.Communication.Identity
4948
dotnet add package Azure.Communication.Rooms
5049
```
5150
You'll need to use the Azure Communication Rooms client library for .NET [version 1.0.0-beta.2](https://www.nuget.org/packages/Azure.Communication.Rooms/1.0.0-beta.2) or above.
@@ -59,7 +58,7 @@ In the `Program.cs` file, add the following code to import the required namespac
5958
using System;
6059
using Azure;
6160
using Azure.Core;
62-
using Azure.Communication.Identity;
61+
using Azure.Communication.Rooms;
6362

6463
namespace RoomsQuickstart
6564
{
@@ -91,35 +90,44 @@ RoomsClient roomsClient = new RoomsClient(connectionString);
9190
## Create a room
9291

9392
### Set up room participants
94-
In order to set up room participants, you'll need to initialize a `CommunicationIdentityClient` to create the communication user identities who will be granted access to join the room.
9593

96-
```csharp
94+
In order to set up who can join a room, you'll need to have the list of the identities of those users. You can follow the instructions [here](../../identity/access-tokens.md?pivots=programming-language-csharp) for creating users and issuing access tokens. Alternatively, if you want to create the users on demand, you can create them using the `CommunicationIdentityClient`.
95+
96+
To use the `CommunicationIdentityClient`, install the following package:
97+
98+
```console
99+
dotnet add package Azure.Communication.Identity
100+
```
101+
102+
Also, import the namespace of the package at the top of your `Program.cs` file:
103+
104+
``` csharp
105+
using Azure.Communication.Identity;
106+
```
107+
108+
Now, the `CommunicationIdentityClient` can be initialized and used to create users:
97109

110+
```csharp
98111
// Create identities for users who will join the room
99112
CommunicationIdentityClient identityClient = new CommunicationIdentityClient(connectionString);
100113
CommunicationUserIdentifier user1 = await identityClient.CreateUser();
101114
CommunicationUserIdentifier user2 = await identityClient.CreateUser();
102115
```
103116

104-
Alternatively, you can follow the instructions [here](../join-rooms-call.md?pivots=platform-web#obtain-user-access-token) to create a user and access token.
117+
Then, create the list of room participants by referencing those users:
105118

106-
107-
After the user identities have been created, you can create room participants and assign a role. If a role is not assigned, then the participant will be assigned `Attendee` role by default.
108119
```csharp
109-
RoomParticipant participant1 = new RoomParticipant(user1) { Role = ParticipantRole.Presenter };
110-
RoomParticipant participant2 = new RoomParticipant(user2) { Role = ParticipantRole.Attendee };
111-
112-
List<RoomParticipant> participants = new List<RoomParticipant>();
113-
114-
participants.Add(participant1);
115-
participants.Add(participant2);
120+
List<RoomParticipant> participants = new List<RoomParticipant>()
121+
{
122+
new RoomParticipant(user1) { Role = ParticipantRole.Presenter },
123+
new RoomParticipant(user2) // The default participant role is ParticipantRole.Attendee
124+
}
116125
```
117126

118127
### Initialize the room
119128
Create a new `room` using the `participants` defined in the code snippet above:
120129

121130
```csharp
122-
123131
// Create a room
124132
DateTimeOffset validFrom = DateTimeOffset.UtcNow;
125133
DateTimeOffset validUntil = validFrom.AddDays(1);

articles/communication-services/quickstarts/rooms/join-rooms-call.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ zone_pivot_groups: acs-web-ios-android
2626
- A room resource. [Create and manage rooms](get-started-rooms.md)
2727

2828
## Obtain user access token
29+
If you have already created users and have added them as participants in the room following the instructions [here](./get-started-rooms.md), then you can directly use those users to join the room.
2930

30-
You'll need to create a User Access Token for each call participant. [Learn how to create and manage user access tokens](../identity/access-tokens.md). You can also use the Azure CLI and run the command below with your connection string to create a user and an access token.
31+
Otherwise, you'll need to create a User Access Token for each call participant. [Learn how to create and manage user access tokens](../identity/access-tokens.md). You can also use the Azure CLI and run the command below with your connection string to create a user and an access token. After the users have been created, you'll need to add them to the room as participants before they can join the room.
3132

3233
```azurecli-interactive
3334
az communication identity token issue --scope voip --connection-string "yourConnectionString"
@@ -86,7 +87,7 @@ For details, see [Use Azure CLI to Create and Manage Access Tokens](../identity/
8687
[!INCLUDE [Join a room call from Android calling SDK](./includes/rooms-quickstart-call-android.md)]
8788
::: zone-end
8889

89-
## Next steps
90+
## Next steps
9091

9192
In this section you learned how to:
9293
> [!div class="checklist"]

0 commit comments

Comments
 (0)