適用於 Node.js 的 Azure Advisor 模組Azure Advisor modules for Node.js

概觀Overview

Azure 建議程式是個人化的雲端顧問,可協助您依最佳做法來最佳化您的 Azure 部署。Azure Advisor is a personalized cloud consultant that helps you follow best practices to optimize your Azure deployments. Advisor 可分析您的資源組態和使用量遙測,然後建議可協助您改善 Azure 資源的成本效益、效能、高可用性和安全性的解決方案。Advisor analyzes your resource configuration and usage telemetry and then recommends solutions that can help you improve the cost effectiveness, performance, high availability, and security of your Azure resources.

使用 Advisor,您可以:With Advisor, you can:

  • 取得主動式、可採取動作且個人化的最佳做法建議。Get proactive, actionable, and personalized best practices recommendations.
  • 改善資源的效能、安全性及高可用性,同時尋找降低整體 Azure 費用的機會。Improve the performance, security, and high availability of your resources, as you identify opportunities to reduce your overall Azure spend.
  • 取得內嵌了提議動作的建議。Get recommendations with proposed actions inline.

管理封裝Management package

安裝 npm 模組Install the npm module

安裝 Azure Advisor npm 模組Install the Azure Advisor npm module

npm install azure-arm-advisor

範例Example

此範例會顯示來自 Azure Advisor 的建議清單。This example displays the list of recommendations from Azure Advisor.

const msRestAzure = require('ms-rest-azure');
const advisorManagement = require('azure-arm-advisor');

const subscriptionId = 'your-subscription-id';

msRestAzure.interactiveLogin().then(credentials => {
  const client = new advisorManagement(credentials, subscriptionId);
  client.recommendations.list().then(recommendations => {
    console.log('List of recommendations:');
    console.dir(recommendations, {depth: null, colors: true});
  });
});

範例Samples

深入探索可在應用程式中使用的 Node.js 程式碼範例Explore more sample Node.js code you can use in your apps.