如果我理解正確,您希望通過訂購Azure CSP集成來獲得訂閱列表。
您可以檢索與訂單對應的Azure雲解決方案提供程序(Azure CSP)訂閱資源的集合。要檢索資源,可以使用PowerShell,C#或REST API命令。
Powershell的指導
$customer = Get-PCCustomer -tenantid '<tenant id GUID>'
Get-PCSubscription -tenantid $customer.id -orderid '<order id GUID>'
C#SDK指南
通過以獲得訂閱列表,使用您的IAggregatePartner.Customers採集和調用ById()方法。然後撥打訂閱屬性,然後按ByOrderId()方法。通過致電獲取()或GetAsync()。
// IAggregatePartner partnerOperations;
// var selectedCustomerId as string;
// string orderID;
ResourceCollection<Subscription> customerSubscriptions = partnerOperations.Customers.ById(selectedCustomerId).Subscriptions.ByOrder(orderID).Get();
REST API實施例
GET https://api.partnercenter.microsoft.com/v1/customers/{customer-tenant-id}/subscriptions?order_id={id-for-order} HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 16fee928-dc2c-412f-adbb-871f68babf16
MS-CorrelationId: c49004b1-224f-4d86-a607-6c8bcc52cfdd
Connection: Keep-Alive
查看在this document更多細節。
不完全。這個用例是檢查一個已經在我們公司購買了bot的租戶的訂閱。通過檢查我的意思是檢查包含在訂閱中的數量和它的狀態。通過MSOL,我們可以檢查例如O365_BUSINESS_PREMIUM的所有訂閱。 –
@NormandBedard,好吧,這些示例沒有得到您想要的SKU信息,但它獲得了訂閱的狀態和其他詳細信息。據我所知,沒有辦法使用Graph API直接獲取所有你想要的信息。 –