簡體   English   中英

Azure SQL數據庫的“定價層”詳細信息 - powershell

[英]'Pricing tier' details of Azure SQL databases - powershell

是否可以通過PowerShell獲取Azure SQL數據庫的定價層詳細信息? 謝謝。

您可以從powershell調用其余的api來獲取定價詳細信息: new-azure-billing-apis-available

有關定價詳細信息,您可以調用ratecard api: 獲取Azure訂閱中使用的資源的價格和元數據信息

您可以閱讀Azure新的價目表API以獲取有關您的資源的定價信息。 https://docs.microsoft.com/en-us/azure/billing/billing-usage-rate-card-overview

閱讀整篇文章很繁瑣,但您可以為您的任務參考此示例帖子如何通過PowerShell計算Azure SQL數據庫價格

以下是代碼段

$Ret = Invoke-AzureRestGetAPI -Uri "https://management.azure.com/subscriptions/$subscriptionid/providers/Microsoft.Commerce/RateCard?api-version=2015-06-01-preview&`$filter=OfferDurableId eq 'MS-AZR-$OfferDurableId' and Currency eq '$Currency' and Locale eq '$Locale' and RegionInfo eq '$RegionInfo'" 

$Sum = 0 
$Ret.Meters | ForEach-Object { 
    If ($_.MeterSubCategory -eq "SQL Database") { 
        $Sum += $_.MeterRates.0 
        Write-Host ($_ | ConvertTo-Json -depth 4) 
        Write-Host "" 
    } 
} 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM