The primary reason that we added `dev-tool run vendored` command is to manage dependencies centrally. Now we can achieve that with pnpm workspace/catalog feature. This PR removes most of the `dev-tool run vendored` usages from individual packages and replace them with direct tool calls. Those tools are also added to individual package's dev dependencies per Pnpm recommendation.
16 KiB
client library samples for JavaScript (Beta)
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
| File Name | Description |
|---|---|
| cloudManifestFileGetSample.js | Returns a cloud specific manifest JSON file. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/CloudManifestFile/Get.json |
| cloudManifestFileListSample.js | Returns a cloud specific manifest JSON file with latest version. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/CloudManifestFile/List.json |
| customerSubscriptionsCreateSample.js | Creates a new customer subscription under a registration. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/CustomerSubscription/Put.json |
| customerSubscriptionsDeleteSample.js | Deletes a customer subscription under a registration. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/CustomerSubscription/Delete.json |
| customerSubscriptionsGetSample.js | Returns the specified product. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/CustomerSubscription/Get.json |
| customerSubscriptionsListSample.js | Returns a list of products. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/CustomerSubscription/List.json |
| linkedSubscriptionsCreateOrUpdateSample.js | Create or update a linked subscription resource. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/LinkedSubscription/Put.json |
| linkedSubscriptionsDeleteSample.js | Delete the requested Linked Subscription resource. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/LinkedSubscription/Delete.json |
| linkedSubscriptionsGetSample.js | Returns the properties of a Linked Subscription resource. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/LinkedSubscription/Get.json |
| linkedSubscriptionsListByResourceGroupSample.js | Returns a list of all linked subscriptions under current resource group. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/LinkedSubscription/List.json |
| linkedSubscriptionsListBySubscriptionSample.js | Returns a list of all linked subscriptions under current subscription. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/LinkedSubscription/ListBySubscription.json |
| linkedSubscriptionsUpdateSample.js | Patch a Linked Subscription resource. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/LinkedSubscription/Patch.json |
| operationsListSample.js | Returns the list of supported REST operations. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Operation/List.json |
| productsGetProductSample.js | Returns the specified product. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Product/GetPost.json |
| productsGetProductsSample.js | Returns a list of products. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Product/ListPost.json |
| productsGetSample.js | Returns the specified product. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Product/Get.json |
| productsListDetailsSample.js | Returns the extended properties of a product. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Product/Post.json |
| productsListSample.js | Returns a list of products. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Product/List.json |
| productsUploadLogSample.js | Returns the specified product. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Product/UploadLog.json |
| registrationsCreateOrUpdateSample.js | Create or update an Azure Stack registration. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Registration/Put.json |
| registrationsDeleteSample.js | Delete the requested Azure Stack registration. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Registration/Delete.json |
| registrationsEnableRemoteManagementSample.js | Enables remote management for device under the Azure Stack registration. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/RemoteManagement/Post.json |
| registrationsGetActivationKeySample.js | Returns Azure Stack Activation Key. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Registration/Post.json |
| registrationsGetSample.js | Returns the properties of an Azure Stack registration. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Registration/Get.json |
| registrationsListBySubscriptionSample.js | Returns a list of all registrations under current subscription. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Registration/ListBySubscription.json |
| registrationsListSample.js | Returns a list of all registrations. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Registration/List.json |
| registrationsUpdateSample.js | Patch an Azure Stack registration. x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/examples/Registration/Patch.json |
Prerequisites
The sample programs are compatible with LTS versions of Node.js.
You need an Azure subscription to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the package README.
Setup
To run the samples using the published version of the package:
- Install the dependencies using
npm:
npm install
-
Edit the file
sample.env, adding the correct credentials to access the Azure service and run the samples. Then rename the file fromsample.envto just.env. The sample programs will read this file automatically. -
Run whichever samples you like (note that some samples may require additional setup, see the table above):
node cloudManifestFileGetSample.js
Alternatively, run a single sample with the correct environment variables set (setting up the .env file is not required if you do this), for example (cross-platform):
cross-env node cloudManifestFileGetSample.js
Next Steps
Take a look at our API Documentation for more information about the APIs that are available in the clients.