我在尝试使用 Microsoft Graph 编写脚本以将 Excel 文件上传到 OneDrive 然后读取 Excel 文件时出错。
我按照Microsoft 文档在没有用户的情况下获取访问令牌。我成功获得了访问令牌,但在使用访问令牌调用 OneDrive API 时出错。
这是回应:
{
"error": {
"code": "BadRequest",
"message": "Tenant does not have a SPO license.",
"innerError": {
"request-id": "5ec31d17-3aea-469f-9078-de3608f11d0d",
"date": "2017-10-10T04:34:05"
}
}
}
Run Code Online (Sandbox Code Playgroud)
我不明白为什么在调用图形 API 时需要拥有 SPO 许可证以及如何获取它。由于此错误消息,所以我正在尝试购买 SPO 许可证。
根据此文档,我认为我应该在许可证页面中看到许多产品,但是在使用 Azure 门户登录并转到许可证页面时,我只看到 2 个产品:Azure AD Premium 和 Enterprise Mobility Suite:
