在用Microsoft call API时候,比如call https://graph.microsoft.com/v1.0/...时候弹出401错误。
当前使用的account已经有global admin权限,但是仍然提示权限不足。经过排查,执行此操作需要grant tenant-wide admin consent到app。
具体操作步骤如下:
1. 使用admin登录Microsoft entra admin center
2. 到Identify -> Applications -> Enterprise applications
3. 找到对应app,在Security下选择Permissions,点击Grant admin consent for app button赋予权限
4. 重新尝试call API可以成功,问题解决
感谢阅读