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

概觀Overview

Azure Service Fabric 是一個分散式系統平台,可讓您輕鬆封裝、部署及管理可調整和可信賴的微服務與容器。Azure Service Fabric is a distributed systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices and containers.

深入了解 Azure Service FabricLearn more about Azure Service Fabric.

管理封裝Management package

安裝 npm 模組Install the npm module

安裝 Azure Service Fabric npm 模組Install the Azure Service Fabric npm module

npm install azure-arm-servicefabric

範例Example

此範例會示範如何列出 Azure 訂用帳戶的叢集。This example shows how you can list the clusters for an Azure subscription.

const msRestAzure = require('ms-rest-azure');
const ServiceFabricManagement = require('azure-arm-servicefabric');

const subscriptionId = 'your-subscription-id';

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

範例Samples

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