檢查客戶升級至 Azure 方案的資格
您可以使用 ProductUpgradeRequest 資源來檢查客戶是否有資格從 Microsoft Azure (MS-AZR-0145P) 訂用帳戶升級至 Azure 方案。此方法會傳回具有客戶產品升級資格的 ProductUpgradesEligibility 資源。
先決條件
合作夥伴中心驗證中所述的認證。 此案例支援使用App+User認證進行驗證。 搭配合作夥伴中心 API 使用 App+使用者驗證時,請遵循 安全的應用程式模型。
客戶標識碼 (
customer-tenant-id
)。 如果您不知道客戶的 ID,您可以在 合作夥伴中心 中選擇 客戶 工作區,然後從客戶清單中選擇客戶,再選擇 帳戶進行查閱。 在客戶的 [帳戶] 頁面上,於 [客戶帳戶資訊] 區段中尋找 Microsoft ID。 Microsoft識別碼與客戶標識碼 (customer-tenant-id
) 相同。產品系列。
C#
若要檢查客戶是否有資格升級至 Azure 方案:
建立 ProductUpgradesRequest 物件,並將客戶標識碼和 “Azure” 指定為產品系列。
使用 IAggregatePartner.ProductUpgrades 集合。
呼叫 CheckEligibility 方法,並傳入 ProductUpgradesRequest 物件,這會傳回 ProductUpgradesEligibility 物件。
// IAggregatePartner partnerOperations;
string selectedCustomerId = "58e2af4f-0ad3-4688-8744-be2357cd939a";
string selectedProductFamily = "azure";
var productUpgradeRequest = new ProductUpgradesRequest
{
CustomerId = selectedCustomerId,
ProductFamily = selectedProductFamily
};
ProductUpgradesEligibility productUpgradeEligibility = partnerOperations.ProductUpgrades.CheckEligibility(productUpgradeRequest);
if (productUpgradeEligibility.IsEligibile)
{
....
}
REST 要求
要求語法
方法 | 要求 URI |
---|---|
POST | {baseURL}/v1/productUpgrades/eligibility HTTP/1.1 |
請求標頭
請求正文
請求本文必須包含 ProductUpgradeRequest 資源。
要求範例
POST https://api.partnercenter.microsoft.com/v1/productupgrades/eligibility HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: c245d5f2-1de3-4ae0-9e42-95e38e3cb8ff
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
X-Locale: en-US
MS-PartnerCenter-Application: Partner Center .NET SDK Samples
Content-Type: application/json
Host: api.partnercenter.microsoft.com
Content-Length: 340
Expect: 100-continue
Connection: Keep-Alive
{
"customerId": "4c721420-72ad-4708-a0a7-371a2f7b0969",
"productFamily": "azure"
}
重要
自 2023 年 6 月起,最新的合作夥伴中心 .NET SDK 3.4.0 版現已封存。 您可以從 GitHub下載 SDK 版本,以及包含實用資訊的 自述檔。
鼓勵合作夥伴繼續使用 合作夥伴中心 REST API。
REST 回應
如果成功,這個方法會傳回本文中 ProductUpgradesEligibility 資源。
回應成功和錯誤碼
每個回應都有一個 HTTP 狀態代碼,指出成功或失敗和其他偵錯資訊。 使用網路追蹤工具來讀取此程式代碼、錯誤類型和其他參數。 如需完整清單,請參閱 合作夥伴中心 REST 錯誤碼。
回應範例
HTTP/1.1 200 Ok
Content-Length: 150
MS-CorrelationId: bbbb1111-cc22-3333-44dd-555555eeeeee
MS-RequestId: cb82f7d6-f0d9-44d4-82f9-f6eee6e68390
MS-CV: iqOqN0FnaE2y0HcD.0
MS-ServerId: 030020525
Date: Thu, 04 Oct 2019 20:35:35 GMT
{
"customerId": "c1958bc7-3284-4952-a257-de594ee64743",
"isEligible": true,
"productFamily": "azure"
}