Azure 中的碳優化可與 Azure Advisor 搭配使用,以提供優化建議。 Azure Advisor 會識別閑置和使用量過低的資源,並顯示實作建議的相關碳和成本節省。 建議可能包括關閉閑置的虛擬機,以及將虛擬機調整為許可權。 如需 Azure Advisor 的詳細資訊和建議,請參閱使用 Azure Advisor 降低服務成本。
若要檢視碳優化建議,請流覽至 [減排] 頁面,然後選取所需的訂用帳戶和資源群組。
此頁面顯示可用建議總數,以及成本和碳方面的潛在節省機會。 它還顯示由美國環保局溫室氣體對等值計算機 計算的碳節約等價物。
檢視建議
下表中的建議清單顯示低效利用的資源,有助於減少碳排放。 每個建議都會顯示相關的碳減排和可能的成本節約,這些成本節約來自於採取建議行動。
根據建議採取行動
若要根據建議採取行動,請選取 [建議] 數據行中的資源名稱或文字。 選取建議文字會帶您前往資源的動作頁面。 例如,重設大小頁面、實例計數變更頁面,或用於刪除建議的資源概觀頁面。
將排放節省轉換為等值
溫室氣體等價計算機 可讓您使用該量將排放數據轉換為等量的二氧化碳(CO2)。 計算機可協助您將抽象測量轉譯成您可以瞭解的具體詞彙,例如樹木、家庭或垃圾袋的年度排放量。 此計算機可能有助於傳達您的溫室氣體減排策略、減排目標或其他旨在減少溫室氣體排放的舉措。
若要了解建議類型,請參閱使用 Azure Advisor 降低服務成本。
出口減排建議
您可以使用 Azure Resource Graph 匯出減排建議。 在 Azure Resource Graph 瀏覽器中執行下列查詢。 之後,您可以將結果下載為 CSV。
匯出包括:
- 建議標識碼
- 訂用帳戶標識碼/訂用帳戶名稱
- 資源群組名稱
- 每月成本節省
- 每月可節省公斤的碳
- 資源名稱
- 建議訊息
- 建議類型
- 建議的詳細數據,包括資源元數據,例如資源標識碼和角色名稱
// Export emissions reduction recommendations using Azure Resource Graph
advisorresources
| where tolower(type) == "microsoft.advisor/recommendations"
| extend RecommendationTypeId = tostring(properties.recommendationTypeId)
| where RecommendationTypeId in ("94aea435-ef39-493f-a547-8408092c22a7", "e10b1381-5f0a-47ff-8c7b-37bd13d7c974")
| project stableId=name, subscriptionId, resourceGroup, properties, recommendationId=id
| join kind=leftouter(
advisorresources
| where tolower(type) == 'microsoft.advisor/suppressions'
| extend tokens = split(id, '/')
| extend stableId = iff(array_length(tokens) > 3, tokens[(array_length(tokens)-3)], '')
| extend expirationTimeStamp = todatetime(iff(strcmp(tostring(properties.ttl), '-1') == 0, '9999-12-31', properties.expirationTimeStamp))
| where expirationTimeStamp > now()
| project suppressionId = tostring(properties.suppressionId), stableId, expirationTimeStamp
) on stableId
| join kind = leftouter (
advisorresources
| where tolower(type) == 'microsoft.advisor/configurations'
| where isempty(resourceGroup) == true
| project subscriptionId, excludeRecomm = properties.exclude, lowCpuThreshold = properties.lowCpuThreshold
) on subscriptionId
| extend isActive = iff(isempty(excludeRecomm), true, tobool(excludeRecomm) == false)
| extend isNotExcludedViaCpuThreshold = iff((isnotempty(lowCpuThreshold) and isnotnull(properties.extendedProperties) and isnotempty(properties.extendedProperties.MaxCpuP95)),
todouble(properties.extendedProperties.MaxCpuP95) < todouble(lowCpuThreshold),
iff((isnull(properties.extendedProperties) or isempty(properties.extendedProperties.MaxCpuP95) or todouble(properties.extendedProperties.MaxCpuP95) < 100),
true,
false))
| where isActive == true and isNotExcludedViaCpuThreshold == true
| join kind = leftouter (
advisorresources
| where type =~ 'microsoft.advisor/configurations'
| where isnotempty(resourceGroup) == true
| project subscriptionId, resourceGroup, excludeProperty = properties.exclude
) on subscriptionId, resourceGroup
| extend shouldBeIncluded = iff(isempty(excludeProperty), true, tobool(excludeProperty) == false)
| where shouldBeIncluded == true
| summarize expirationTimeStamp = max(expirationTimeStamp), suppressionIds = make_list(suppressionId) by recommendationId, stableId, subscriptionId, resourceGroup, tostring(properties)
| extend isRecommendationActive = (isnull(expirationTimeStamp) or isempty(expirationTimeStamp))
| extend properties = parse_json(properties)
| extend monthlyCostSavings = toreal(properties.extendedProperties.savingsAmount)
| extend monthlyCarbonSavingsKg = toreal(properties.extendedProperties.PotentialMonthlyCarbonSavings)
| where monthlyCarbonSavingsKg > 0
| extend resourceId = properties.resourceMetadata.resourceId, resourceName = tostring(properties.extendedProperties.roleName), recommendationMessage = properties.extendedProperties.recommendationMessage, recommendationType=tostring(properties.extendedProperties.recommendationType)
| project recommendationId, subscriptionId, resourceGroup, suppressionIds, isRecommendationActive, monthlyCostSavings, monthlyCarbonSavingsKg, resourceId, resourceName, recommendationMessage, recommendationType| where isRecommendationActive == true| order by monthlyCarbonSavingsKg desc