You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

寻求获取Power Platform租户环境存储容量的Graph API用于告警

检索Power Platform租户内环境存储容量的API方案

是的,存在可以检索租户内各Power Platform环境存储容量使用情况的API,以下是具体实现方案:

可用API端点

你可以使用Power Platform Admin REST API获取存储数据,核心端点有两个:

  • 获取租户下所有环境的存储使用情况:
    GET https://api.powerplatform.com/admin/environments/storageusage?api-version=2020-06-01
  • 获取单个指定环境的存储使用情况:
    GET https://api.powerplatform.com/admin/environments/{environmentId}/storageusage?api-version=2020-06-01

权限要求

  • 调用者需拥有Power Platform Administrator角色,或通过Azure AD注册的应用程序持有Dynamics365Environment.Read.All权限
  • 调用API前需通过Azure AD获取OAuth 2.0访问令牌,令牌需包含https://api.powerplatform.com的作用域

调用示例(curl)

curl --request GET \
  --url 'https://api.powerplatform.com/admin/environments/storageusage?api-version=2020-06-01' \
  --header 'Authorization: Bearer {your-access-token}'

返回数据说明

返回的JSON响应包含每个环境的关键字段:

  • environmentId:环境唯一标识
  • environmentName:环境名称
  • totalStorageUsedInMB:已使用存储(MB)
  • totalStorageAllocatedInMB:分配的总存储(MB)

通过公式(totalStorageUsedInMB / totalStorageAllocatedInMB) * 100计算使用率,即可判断是否超出阈值。

告警逻辑实现

  1. 定期调度API调用(如每小时执行一次)
  2. 解析返回数据,逐个计算环境存储使用率
  3. 当使用率超过80%时,调用第三方监控工具的webhook或API发送告警通知

内容的提问来源于stack exchange,提问作者Tejaswi Angotu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.03 09:11:31