我在Azure Node SDK上看到一个奇怪的错误,当我在options参数的filter属性中包含任何内容时,我会收到500错误。我正在使用ConsumptionManagementClient类中的Usage Details调用。代码如下:
const credentials = await MsRest.loginWithServicePrincipalSecret(config.appId, config.apiKey, config.tenantId);
let client = new ConsumptionManagementClient(credentials, subscriptionId);
const scope = `/subscriptions/${subscriptionId}`;
const options = { filter: "usageStart ge datetime'2017-10-13T00:00:00.000Z'"};
let usage = await client.usageDetails.list(scope, options);
上面的代码产生500错误(甚至尝试搜索其他的例子,另一个例子是“billableQuantity ge 0.001”)但是无论我给它什么,它似乎都会出错。
当我尝试使用另一个选项参数时,代码工作正常:
const credentials = await MsRest.loginWithServicePrincipalSecret(config.appId, config.apiKey, config.tenantId);
let client = new ConsumptionManagementClient(credentials, subscriptionId);
const scope = `/subscriptions/${subscriptionId}`;
const options = { top: 50 };
let usage = await client.usageDetails.list(scope, options);
有什么想法吗?在此先感谢您的帮助!