Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions sdk/compute/arm-compute-disk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Release History

## 1.0.0-beta.1 (2025-11-18)

### Features Added

The package of @azure/arm-compute-disk is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart).
21 changes: 21 additions & 0 deletions sdk/compute/arm-compute-disk/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
115 changes: 115 additions & 0 deletions sdk/compute/arm-compute-disk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Azure ComputeDisk client library for JavaScript

This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ComputeDisk client.

Compute Disk Client

[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute-disk) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-compute-disk) |
[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-compute-disk?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)
- Latest versions of Safari, Chrome, Edge and Firefox.

See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.

### Prerequisites

- An [Azure subscription][azure_sub].

### Install the `@azure/arm-compute-disk` package

Install the Azure ComputeDisk client library for JavaScript with `npm`:

```bash
npm install @azure/arm-compute-disk
```

### Create and authenticate a `ComputeDiskClient`

To create a client object to access the Azure ComputeDisk API, you will need the `endpoint` of your Azure ComputeDisk resource and a `credential`. The Azure ComputeDisk client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure ComputeDisk resource in the [Azure Portal][azure_portal].

You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).

To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:

```bash
npm install @azure/identity
```

You will also need to **register a new AAD application and grant access to Azure ComputeDisk** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).

For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).

Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client.

```ts snippet:ReadmeSampleCreateClient_Node
import { ComputeDiskClient } from "@azure/arm-compute-disk";
import { DefaultAzureCredential } from "@azure/identity";

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ComputeDiskClient(new DefaultAzureCredential(), subscriptionId);
```

For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate.

```ts snippet:ReadmeSampleCreateClient_Browser
import { InteractiveBrowserCredential } from "@azure/identity";
import { ComputeDiskClient } from "@azure/arm-compute-disk";

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new InteractiveBrowserCredential({
tenantId: "<YOUR_TENANT_ID>",
clientId: "<YOUR_CLIENT_ID>",
});
const client = new ComputeDiskClient(credential, subscriptionId);
```

### JavaScript Bundle
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).

## Key concepts

### ComputeDiskClient

`ComputeDiskClient` is the primary interface for developers using the Azure ComputeDisk client library. Explore the methods on this client object to understand the different features of the Azure ComputeDisk service that you can access.

## 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`:

```ts snippet:SetLogLevel
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).

## Next steps

Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library.

## Contributing

If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.

## Related projects

- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)


[azure_cli]: https://learn.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/
[azure_sub]: https://azure.microsoft.com/free/
[azure_portal]: https://portal.azure.com
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential
9 changes: 9 additions & 0 deletions sdk/compute/arm-compute-disk/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"commit": "0b1e63c8a946be5d52d24dce6f10222a1a2de51c",
"readme": "specification/compute/resource-manager/Microsoft.Compute/DiskRP/readme.md",
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/compute/resource-manager/Microsoft.Compute/DiskRP/readme.md --tag=package-2025-04-01 --use=@autorest/typescript@^6.0.52",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/[email protected]",
"tag": "package-2025-04-01",
"use": "@autorest/typescript@^6.0.52"
}
3 changes: 3 additions & 0 deletions sdk/compute/arm-compute-disk/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../../api-extractor-base.json"
}
127 changes: 127 additions & 0 deletions sdk/compute/arm-compute-disk/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"name": "@azure/arm-compute-disk",
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for ComputeDiskClient.",
"version": "1.0.0-beta.1",
"engines": {
"node": ">=20.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^2.1.2",
"@azure/core-paging": "^1.6.2",
"@azure/core-client": "^1.9.3",
"@azure/core-auth": "^1.9.0",
"@azure/core-rest-pipeline": "^1.19.1",
"tslib": "^2.8.1"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic",
"cloud"
],
"license": "MIT",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/commonjs/index.d.ts",
"type": "module",
"devDependencies": {
"typescript": "catalog:",
"rimraf": "catalog:",
"dotenv": "catalog:testing",
"@azure/dev-tool": "workspace:^",
"cross-env": "catalog:",
"eslint": "catalog:",
"prettier": "catalog:",
"tshy": "catalog:",
"@azure/identity": "catalog:internal",
"@azure/logger": "workspace:^",
"@azure-tools/test-recorder": "workspace:^",
"@azure-tools/test-credential": "workspace:^",
"@azure-tools/test-utils-vitest": "workspace:^",
"@types/node": "catalog:",
"@vitest/browser-playwright": "catalog:testing",
"@vitest/coverage-istanbul": "catalog:testing",
"playwright": "catalog:testing",
"vitest": "catalog:testing"
},
"repository": "github:Azure/azure-sdk-for-js",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/",
"README.md",
"LICENSE"
],
"scripts": {
"build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
"pack": "pnpm pack 2>&1",
"extract-api": "dev-tool run extract-api",
"lint": "echo skipped",
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:samples": "echo skipped.",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
"execute:samples": "echo skipped",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
"test": "npm run test:node && npm run test:browser",
"test:node": "dev-tool run test:vitest",
"test:browser": "echo skipped",
"update-snippets": "dev-tool run update-snippets",
"test:node:esm": "dev-tool run test:vitest --esm"
},
"sideEffects": false,
"//metadata": {
"constantPaths": [
{
"path": "src/computeDiskClient.ts",
"prefix": "packageDetails"
}
]
},
"autoPublish": true,
"browser": "./dist/browser/index.js",
"react-native": "./dist/react-native/index.js",
"tshy": {
"project": "../../../tsconfig.src.build.json",
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"esmDialects": [
"browser",
"react-native"
],
"selfLink": false
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute-disk",
"exports": {
"./package.json": "./package.json",
".": {
"browser": {
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"react-native": {
"types": "./dist/react-native/index.d.ts",
"default": "./dist/react-native/index.js"
},
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
}
}
Loading
Loading