Help: I want to obtain billing information through Microsoft Cloud's API, but I failed to call it. I am using the recommended example

王帅 0 信誉分
2024-02-07T07:04:39.7433333+00:00

this is my code: ClientSecretCredential clientSecretCredential = new ClientSecretCredentialBuilder() .clientId("my clientId") .clientSecret("my clientSecret") .tenantId("my tenantId") .build(); AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); CostManagementManager manager = CostManagementManager .authenticate(clientSecretCredential, profile); CostDetailsOperationResults operation = manager.generateCostDetailsReports().createOperation("/providers/Microsoft.Billing/billingAccounts/billingAccountId", new GenerateCostDetailsReportRequestDefinition() .withMetric(CostDetailsMetricType.ACTUAL_COST) .withTimePeriod(new CostDetailsTimePeriod().withStart("2023-03-01").withEnd("2023-03-15")), Context.NONE); but error : Status code 401, "{"error":{"code":"401","message":"No claims present for the caller in the system"}}": No claims present for the caller in the system

Windows 应用 SDK
Windows 应用 SDK
一组 Microsoft 开源库、框架、组件和工具,可供各种应用使用,以便在多个版本的 Windows 上访问 Windows 平台功能。 以前称为 Project Reunion。
15 个问题
0 个注释 无注释
{count} 票

1 个答案

排序依据: 非常有帮助
  1. Jeanine Zhang-MSFT 9,181 信誉分 Microsoft 供应商
    2024-02-07T08:45:42.38+00:00

    你好,

    欢迎来到 Microsoft Q&A!

    这里是处理与Windows APP SDK开发相关的中文论坛。 根据你的描述,你的问题跟Azure相关。 目前,Q&A还没有Azure相关的中文论坛, 我建议你可以把问题发布到Azure相关的英文论坛以获得更好的帮助。

    谢谢,

    Jeanine

    0 个注释 无注释