-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSFT_TeamsAppPermissionPolicy cannot be deployed using an app registration with certificate #4018
Comments
Please make sure to grant the Teams Admin App to your application: https://learn.microsoft.com/en-us/microsoftteams/teams-powershell-application-authentication#setup-application-based-authentication |
@andikrueger Of course the app reg has also the Teams admin role assigned and all the required API permissions: If I try to create an AppPermissionPolicy directly through the PS cmdlet signed in with the service principal using certificate I get the following error: If I do the exact same with my admin account I'm able to create it: |
I have the same issue but with TeamsAppSetupPolicy, see #4258, according to https://learn.microsoft.com/en-us/microsoftteams/teams-powershell-application-authentication only the cmdlets below won't work but it seems this isn't true. New-Team |
Just found some further concerning information in this article: https://github.com/MicrosoftDocs/office-docs-powershell/blob/main/skype/skype-ps/skype/New-CsTeamsAppPermissionPolicy.md#synopsis
A further thought as I was browsing through the current API permissions of this resource: the resource does not use the graph cmdLets. In my opinion we should be good with the teams admin role. All graph api permissions should not be needed for this resource. |
Anyways, this still does not explain, why this resource can be used with a user principal but not with a service principal. I remember that we do have an open issue about this kind of problem, but can’t find it right now. |
Just found it: #3394 |
@andikrueger, yeah but TeamsOrgWideAppSettings calls [Get|Set]-CsTeamsSettingsCustomApp which falls under that table of cmdlets that are known to not work with app registration, but these other 2 resources don't call any of those cmdlets so the info on that website is wrong. |
Yes. I just was just about to add some context than I think, the root cause for this issue here would also be the underlying functionality not supporting app credentials. Either the docs are wrong or the powershell module is broken. |
This should work by now. Closing the issue. |
Description of the issue
When trying to deploy a TeamsAppPermissionPolicy I'm getting no error, but the AppPermissionPolicy is neither created nor updated. When I try to change/create the policy manually through Microsoft Teams Powershell module I get the following error:
Set-CsTeamsAppPermissionPolicy : The App Id(s) specified could not be validated from the App Catalog. Please refer to documentation. CorrelationId: d62657c6-0734-4ae7-ae9b-4ba260dd7c28
At line:1 char:1
When I try the same with my personal account it's working. All necessary API permissions are present at the app registration, so I think it is not supported to create/update AppPermissionPolicies using an application?
Microsoft 365 DSC Version
V1.23.1108.1
Which workloads are affected
Teams
The DSC configuration
Verbose logs showing the problem
No response
Environment Information + PowerShell Version
No response
The text was updated successfully, but these errors were encountered: