如何列出azure帐户的所有SubscriptionIds
?
我现在拥有的是:
const sub = require('azure-asm-subscription');
//getting the credentials
const subclient = sub.createSubscriptionClient(credentials);
subclient.subscriptions.list((err, data) => {
console.log(data);
});
但是这会返回一个status code of 200
(说一切都没问题),但是订阅数组是空的。但他们至少有一个订阅。
答案 0 :(得分:0)
好吧,我找到了解决方案:
const ArmResource = require('azure-arm-resource');
const subClient = new ArmResource.SubscriptionClient(credentials);
subClient.subscriptions.list().then(data => {
console.log(data);
})