OfficeDev / microsoft-teams-apps-requestateam

Power Platform based solution that allows users to request teams and automates team creation. NO LONGER MAINTAINED. Please use 'Provision Assist' - https://github.com/pnp/provision-assist-m365/ instead.
MIT License
236 stars 66 forks source link

Error in ProcessTeamRequest - failed to get license information for the user #355

Open ChristianHoffmannn opened 2 years ago

ChristianHoffmannn commented 2 years ago

Description

Since 3 weeks we are having an issue with new created teams from the request a team app. The service user is not removed from new teams. In the logic app from ProcessTeamRequest i saw that there is an error at the step post welcome message to general channel: { "error": { "code": "Forbidden", "message": "Failed to get license information for the user. Ensure user has a valid Office365 license assigned to them.", "innerError": { "date": "2022-03-17T09:12:34", "request-id": "9bbb0587-5a17-4f78-b437-51af0f516184", "client-request-id": "9bbb0587-5a17-4f78-b437-51af0f516184" } } }

We have one service user, which with who, we created the app via powershell and in keyvault we have another user saved as sausername.

I checked both users and both users got an active license (Azure AD Premium P1 and the other one got an O365 E3 license) I do not really unterstand, why this error appears.

Does anyone have an idea?

Kind regards Christian

Steps to reproduce

  1. checked service user for active license
  2. created new team with request a team app

Expected results

With an active license for the service user, new teams should be created and all steps from Processteamrequest should be successfull.

Actual Results

New teams are created but Processteamrequest logic fails at step posting welcome message to new team.

Solution component

Logic Apps

Operating system (environment)

Windows

Additional Info

No response

ChristianHoffmannn commented 2 years ago

@alexc-MSFT do you have an idea,why this error happens?

alexc-MSFT commented 2 years ago

@ChristianHoffmannn your service account - does this have an O365 license or only AD P1? The service account is used to post the welcome message so if that doesn't have an O365 license then the step will fail.

zaaj commented 1 year ago

I'm getting the same error just on "Get-MgBetaTeamworkDevice" after connecting with a TeamsAdmin account - my admin account doesn't have any licenses, none of the other admin powershell modules seem to require one, and I wouldn't expect a retrieval request to need one when the ROP account can use the MicrosoftTeams module with no licensing issues.

bsj17 commented 1 month ago

@alexc-MSFT

Using Microsoft.Graph.Beta.Teams version 2.19.0.

Getting an error if I want to get list of all devices, on one of them there's account without a license. Query breaks without returning any data. If I check Teams Admin Centar there is indication of device with account that has sign-in issue. Why not do the same logic in MGraph?

$TeamsPhones = (Get-MgBetaTeamworkDevice -all ).id

Error returned:

Get-MgBetaTeamworkDevice_List: Failed to get license information for the user. Ensure user has a valid Office365 license assigned to them.

Status: 403 (Forbidden) ErrorCode: Forbidden Date: 2024-10-09T07:08:09

alexc-MSFT commented 1 month ago

@bsj17 I’m afraid request a team is no longer maintained actively and as such I’m not able to resolve this issue. We have a newer solution that covers far more than teams - https://github.com/pnp/provision-assist-m365/.

This is updated and maintained and we recommend moving from Request a team to Provision Assist.

Thanks