# azure/azure-sdk-for-js architecture

> Architecture diagram of the GitHub repository azure/azure-sdk-for-js, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azure/azure-sdk-for-js
- Repository: https://github.com/azure/azure-sdk-for-js

## Overview

This is the Azure SDK for JavaScript monorepo: service client libraries let applications consume Azure services, while ARM management libraries provision and manage resources. The main workflow is application code calling a service client, which uses shared HTTP pipeline capabilities to communicate with Azure; management clients target Azure Resource Manager. The Cosmos DB package also has a substantial query-execution subsystem. The README documents repository-wide capabilities, while source excerpts expose only selected implementations, so unsampled service-family links are documented at a high level rather than inferred between modules.

Main entry points: [`sdk`](https://github.com/azure/azure-sdk-for-js/tree/main/sdk) (Client libraries), [`sdk/cosmosdb/cosmos/src/queryExecutionContext`](https://github.com/azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/cosmos/src/queryExecutionContext) (Query execution), [`sdk/cosmosdb/cosmos/src/ClientContext.ts`](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/cosmos/src/ClientContext.ts) (Cosmos DB client), [`sdk/core/ts-http-runtime/src/pipeline.ts`](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/core/ts-http-runtime/src/pipeline.ts) (HTTP pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Service clients"]
  node_clientlibs["Client libraries"]
  node_cosmosclient["Cosmos DB client<br/>[ClientContext.ts]"]
end

subgraph group_management["Resource management"]
  node_managementlibs["Management libraries"]
  node_baremetalops["Bare-metal operations"]
  node_baremetalmodels["Bare-metal models<br/>[mappers.ts]"]
  node_databoxops["Data Box operations<br/>[storageAccounts.ts]"]
  node_databoxmodels["Data Box models<br/>[mappers.ts]"]
  node_lakeops["Data Lake operations<br/>[storageAccounts.ts]"]
  node_lakemodels["Data Lake models<br/>[mappers.ts]"]
  node_dellcontext["Dell storage client<br/>[storageContext.ts]"]
  node_dellmodels["Dell storage models<br/>[models.ts]"]
end

subgraph group_runtime["Shared runtime"]
  node_pipeline["HTTP pipeline<br/>[pipeline.ts]"]
end

subgraph group_cosmos["Cosmos DB internals"]
  node_cosmosquery["Query execution"]
  node_continuation["Continuation tokens"]
  node_groupby["Group aggregation"]
  node_cosmosdiag["Diagnostics"]
end

node_app(("Application"))
node_managementuser(("Management consumer"))
node_azure{{"Azure services / ARM"}}

node_app -->|"calls"| node_clientlibs
node_clientlibs -.->|"uses shared capabilities"| node_pipeline
node_clientlibs -->|"interacts with"| node_azure
node_app -.->|"calls"| node_cosmosclient
node_cosmosclient -.->|"executes queries"| node_cosmosquery
node_cosmosquery -->|"manages tokens"| node_continuation
node_cosmosquery -->|"wraps execution"| node_groupby
node_managementuser -->|"calls"| node_managementlibs
node_managementlibs -->|"manages resources"| node_azure
node_managementlibs -.->|"uses shared capabilities"| node_pipeline
node_baremetalops -->|"uses types"| node_baremetalmodels
node_databoxops -->|"uses types"| node_databoxmodels
node_lakeops -->|"uses types"| node_lakemodels
node_dellcontext -->|"uses versions"| node_dellmodels

click node_clientlibs "https://github.com/azure/azure-sdk-for-js/tree/main/sdk"
click node_cosmosclient "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/cosmos/src/ClientContext.ts"
click node_cosmosquery "https://github.com/azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/cosmos/src/queryExecutionContext"
click node_continuation "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/cosmos/src/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.ts"
click node_groupby "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/cosmos/src/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.ts"
click node_cosmosdiag "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/cosmos/src/diagnostics/DiagnosticNodeInternal.ts"
click node_pipeline "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/core/ts-http-runtime/src/pipeline.ts"
click node_managementlibs "https://github.com/azure/azure-sdk-for-js/tree/main/sdk"
click node_baremetalops "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/src/operations/azureBareMetalStorageInstances.ts"
click node_baremetalmodels "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/src/models/mappers.ts"
click node_databoxops "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/storageAccounts.ts"
click node_databoxmodels "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/mappers.ts"
click node_lakeops "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/datalake-analytics/arm-datalake-analytics/src/operations/storageAccounts.ts"
click node_lakemodels "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/datalake-analytics/arm-datalake-analytics/src/models/mappers.ts"
click node_dellcontext "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/dell/arm-dell-storage/src/api/storageContext.ts"
click node_dellmodels "https://github.com/azure/azure-sdk-for-js/blob/main/sdk/dell/arm-dell-storage/src/models/models.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_clientlibs,node_cosmosclient toneBlue
class node_managementlibs,node_baremetalops,node_baremetalmodels,node_databoxops,node_databoxmodels,node_lakeops,node_lakemodels,node_dellcontext,node_dellmodels toneAmber
class node_pipeline toneMint
class node_cosmosquery,node_continuation,node_groupby,node_cosmosdiag toneRose
class node_app,node_managementuser,node_azure toneIndigo
```

## Components

### Service clients

- [Client libraries](https://github.com/azure/azure-sdk-for-js/tree/main/sdk): `sdk`
- [Cosmos DB client](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/cosmos/src/ClientContext.ts): `sdk/cosmosdb/cosmos/src/ClientContext.ts`

### Resource management

- [Management libraries](https://github.com/azure/azure-sdk-for-js/tree/main/sdk): `sdk`
- [Bare-metal operations](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/src/operations/azureBareMetalStorageInstances.ts): `sdk/baremetalinfrastructure/arm-baremetalinfrastructure/src/operations/azureBareMetalStorageInstances.ts`
- [Bare-metal models](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/src/models/mappers.ts): `sdk/baremetalinfrastructure/arm-baremetalinfrastructure/src/models/mappers.ts`
- [Data Box operations](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/storageAccounts.ts): `sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/storageAccounts.ts`
- [Data Box models](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/mappers.ts): `sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/mappers.ts`
- [Data Lake operations](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/datalake-analytics/arm-datalake-analytics/src/operations/storageAccounts.ts): `sdk/datalake-analytics/arm-datalake-analytics/src/operations/storageAccounts.ts`
- [Data Lake models](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/datalake-analytics/arm-datalake-analytics/src/models/mappers.ts): `sdk/datalake-analytics/arm-datalake-analytics/src/models/mappers.ts`
- [Dell storage client](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/dell/arm-dell-storage/src/api/storageContext.ts): `sdk/dell/arm-dell-storage/src/api/storageContext.ts`
- [Dell storage models](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/dell/arm-dell-storage/src/models/models.ts): `sdk/dell/arm-dell-storage/src/models/models.ts`

### Shared runtime

- [HTTP pipeline](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/core/ts-http-runtime/src/pipeline.ts): `sdk/core/ts-http-runtime/src/pipeline.ts`

### Cosmos DB internals

- [Query execution](https://github.com/azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/cosmos/src/queryExecutionContext): `sdk/cosmosdb/cosmos/src/queryExecutionContext`
- [Continuation tokens](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/cosmos/src/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.ts): `sdk/cosmosdb/cosmos/src/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.ts`
- [Group aggregation](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/cosmos/src/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.ts): `sdk/cosmosdb/cosmos/src/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.ts`
- [Diagnostics](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/cosmos/src/diagnostics/DiagnosticNodeInternal.ts): `sdk/cosmosdb/cosmos/src/diagnostics/DiagnosticNodeInternal.ts`

### Other components

- **Application**
- **Management consumer**
- **Azure services / ARM**

## Connections

- Application → Client libraries: calls
- Client libraries → HTTP pipeline: uses shared capabilities (evidence: `sdk/core/ts-http-runtime/src/pipeline.ts`)
- Client libraries → Azure services / ARM: interacts with
- Application → Cosmos DB client: calls
- Cosmos DB client → Query execution: executes queries (evidence: `sdk/cosmosdb/cosmos/src/ClientContext.ts`)
- Query execution → Continuation tokens: manages tokens (evidence: `sdk/cosmosdb/cosmos/src/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.ts`)
- Query execution → Group aggregation: wraps execution (evidence: `sdk/cosmosdb/cosmos/src/queryExecutionContext/pipelinedQueryExecutionContext.ts`)
- Management consumer → Management libraries: calls
- Management libraries → Azure services / ARM: manages resources
- Management libraries → HTTP pipeline: uses shared capabilities (evidence: `sdk/core/ts-http-runtime/src/pipeline.ts`)
- Bare-metal operations → Bare-metal models: uses types (evidence: `sdk/baremetalinfrastructure/arm-baremetalinfrastructure/src/operations/azureBareMetalStorageInstances.ts`)
- Data Box operations → Data Box models: uses types (evidence: `sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/storageAccounts.ts`)
- Data Lake operations → Data Lake models: uses types (evidence: `sdk/datalake-analytics/arm-datalake-analytics/src/operations/storageAccounts.ts`)
- Dell storage client → Dell storage models: uses versions (evidence: `sdk/dell/arm-dell-storage/src/api/storageContext.ts`)
