Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Please understand that our forum is a public platform, and we will modify your question to cover the personal information in the description. Kindly ensure that you hide these personal or organization information next time you post error or some information to protect personal data.
Dear @Sushil Dangi,
Welcome to Microsoft Q&A Forum!
Thanks for sharing the additional details and the error output. Based on everything reviewed from the beginning, here is my insights of what happened, why the error occurred, and suggestions for you to check.
1.What you did (correct steps):
- Created an Application Access Policy using New-CsApplicationAccessPolicy.
- Created a mail-enabled security group.
- Added a user to the group.
- Assigned the policy to the group using:
Grant-CsApplicationAccessPolicy -Group XXXXXelabstech -PolicyName OrgTranscriptPolicy
- Called Microsoft Graph APIs using application permissions (client credentials flow).
All of the above steps are supported and valid.
Mail-enabled security groups are a supported group type for CsApplicationAccessPolicy. No special group settings (dynamic group, M365 group, etc.) are required.
Reference: Grant-CsApplicationAccessPolicy
2.The error: “No application access policy found for this app” may not cause by the group and not cause by the assignment command. This error occurs when the Application (Client) ID used at runtime does not match the App ID listed in the Application Access Policy.
At runtime, Microsoft Graph checks only one thing:
Does the appId in the access token exist in the AppIds list of the CsApplicationAccessPolicy assigned to the user (directly or via group)?
If the App ID does not match, Graph returns this error even if:
- The policy exists
- The policy is assigned correctly
- The user is in the group
This behavior may be expected.
3.Common causes of this issue:
Wrong ID used in the policy:
- The policy must contain the Application (Client) ID
- Not the Object ID
- Not the Enterprise Application ID
Token issued for a different app:
- The access token used in Graph must belong to the same App Registration
- If the token is generated for App A but the policy contains App B → error occurs
Multiple app registrations:
- Policy created for one app
- Token generated for another app
4.Here are recommended validation checklist:
Please validate in this order:
- App Registration: please note the Application (client) ID
- Check the Policy:
Get-CsApplicationAccessPolicy -Identity "OrgTranscriptPolicy"to confirm the same App ID is listed under AppIds - Token: decode token to confirm
appIdmatches the policy - Group:
- User is a member of the group
- Group is already assigned the policy (your command is correct)
Once the App ID and token alignment is corrected, the error may stop without changing anything else.
For more information of your concern:
-What New-CsApplicationAccessPolicy actually does:
- It creates a policy that contains Application (Client) IDs
- When assigned, those apps may access online meetings / virtual events on behalf of users
-Does assigning it to “all users” cover new users? The answer is No. If you run:
Get-CsOnlineUser | Grant-CsApplicationAccessPolicy -PolicyName MyPolicy
It applies only to users that exist at that moment. New users created later will not automatically get it. Please kindly review this case: https://learn.microsoft.com/en-us/answers/questions/5746422/rsc-policy-assignment
-New-CsGroupPolicyAssignment may not work for CsApplicationAccessPolicy
- It supports only certain Teams policies.
- Application Access Policies may not support.
- So, the correct cmdlet is only:
Grant-CsApplicationAccessPolicy -Group
Please see this case for more insights: https://learn.microsoft.com/en-us/answers/questions/5514401/regarding-the-csapplicationaccesspolicy-in-teams-p
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.