How to get user context from Teams private message using MS bot framework

Once you retrieve the IDs using the ITeamsContext object, you need to use those Ids to fully populate the Teams object. You can do so using the Operations.FetchTeamDetailsAsync method.

To get a roster of members in the conversation, you'll use the GetConversationParametersForCreateOrGetDirectConversation() method. #epicmethodname.

using Microsoft.Bot.Builder.Teams;
using Microsoft.Bot.Schema.Teams;
using Microsoft.Bot.Connector.Teams;
ConversationList channels = await teamsContext.Operations.FetchChannelListAsync(incomingTeamId);

TeamDetails teamInfo = await teamsContext.Operations.FetchTeamDetailsAsync(incomingTeamId);

var roster = teamsContext.GetConversationParametersForCreateOrGetDirectConversation(turnContext.Activity.From).Members;

List<TeamsChannelAccount> rosterTC = roster.ToList().ConvertAll(member =>
    return teamsContext.AsTeamsChannelAccount(member);

await turnContext.SendActivityAsync($"You have {roster.Count} number of people in this group. You are {from.Name}");

You can find some getting started help, and additional resources here: