# @azure-rest/arm-servicefabric

Latest version **1.0.0-beta.2** (published 2025-02-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @azure-rest/arm-servicefabric
pnpm add @azure-rest/arm-servicefabric
yarn add @azure-rest/arm-servicefabric
bun add @azure-rest/arm-servicefabric
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.0-beta.2 |
| Published | 2025-02-11 |
| First published | 2022-07-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 8 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Microsoft Corporation |
| Maintainers | azure-sdk, microsoft1es |
| Keywords | node, azure, cloud, typescript, browser, isomorphic |

## Links

- npm: https://www.npmjs.com/package/@azure-rest/arm-servicefabric
- Repository: github:Azure/azure-sdk-for-js
- Homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicefabric/arm-servicefabric-rest/README.md
- Issues: https://github.com/Azure/azure-sdk-for-js/issues
- npm.io page: https://npm.io/package/@azure-rest/arm-servicefabric

## Dependencies (8)

- [tslib](https://npm.io/package/tslib.md) ^2.2.0
- [@azure/logger](https://npm.io/package/@azure/logger.md) ^1.0.0
- [@azure/core-lro](https://npm.io/package/@azure/core-lro.md) ^3.1.0
- [@azure/core-auth](https://npm.io/package/@azure/core-auth.md) ^1.3.0
- [@azure/core-paging](https://npm.io/package/@azure/core-paging.md) ^1.2.0
- [@azure-rest/core-client](https://npm.io/package/@azure-rest/core-client.md) ^1.0.0
- [@azure/abort-controller](https://npm.io/package/@azure/abort-controller.md) ^2.1.2
- [@azure/core-rest-pipeline](https://npm.io/package/@azure/core-rest-pipeline.md) ^1.8.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.0-beta.2 (latest) — 2025-02-11
- 1.0.0-alpha.20260310.1 (dev) — 2026-03-11
- 1.0.0-alpha.20260309.1 — 2026-03-10
- 1.0.0-alpha.20260306.1 — 2026-03-07
- 1.0.0-alpha.20260305.1 — 2026-03-06
- 1.0.0-alpha.20260304.1 — 2026-03-05
- 1.0.0-alpha.20260303.1 — 2026-03-04
- 1.0.0-alpha.20260302.1 — 2026-03-03
- 1.0.0-alpha.20260227.1 — 2026-02-28
- 1.0.0-alpha.20260225.1 — 2026-02-26
- 1.0.0-alpha.20260224.1 — 2026-02-25
- 1.0.0-alpha.20260223.1 — 2026-02-24
- 1.0.0-alpha.20260219.1 — 2026-02-20
- 1.0.0-alpha.20260218.1 — 2026-02-19
- 1.0.0-alpha.20260217.1 — 2026-02-18
- … 296 more at https://npm.io/package/@azure-rest/arm-servicefabric/versions

## README

# Azure ServiceFabric client library for JavaScript

Service Fabric Client

**Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library**

Key links:

- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicefabric/arm-servicefabric-rest)
- [Package (NPM)](https://www.npmjs.com/package/@azure-rest/arm-servicefabric)
- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure-rest/arm-servicefabric?view=azure-node-preview)
- [Samples](https://github.com/Azure-Samples/azure-samples-js-management)

## Getting started

### Currently supported environments

- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)

### Prerequisites

- You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package.

### Install the `@azure-rest/arm-servicefabric` package

Install the Azure ServiceFabric client REST client library for JavaScript with `npm`:

```bash
npm install @azure-rest/arm-servicefabric
```

### Create and authenticate a `ServiceFabricClient`

To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
provide an instance of the desired credential type obtained from the
[@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library.

To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)

After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) from `@azure/identity` to use.
As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential)
can be used to authenticate the client.

Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET

## Examples

The following section shows you how to initialize and authenticate your client, then list all of your Clusters.

### List All Clusters

```typescript
import ServiceFabricManagementClient from "@azure-rest/arm-servicefabric";
import { DefaultAzureCredential } from "@azure/identity";

async function listClusters() {
  const subscriptionId = "00000000-0000-0000-0000-000000000000";
  const credential = new DefaultAzureCredential();
  const client = ServiceFabricManagementClient(credential);
  const result = await client
    .path(
      "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters",
      subscriptionId,
    )
    .get();
  console.log(result);
}

listClusters().catch(console.error);
```

## Troubleshooting

### Logging

Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

```javascript
import { setLogLevel } from "@azure/logger";

setLogLevel("info");
```

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).

---
_Source: https://npm.io/package/@azure-rest/arm-servicefabric · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
