@azure/arm-durabletask client library samples for JavaScript
These sample programs show how to use the JavaScript client libraries for @azure/arm-durabletask in some common scenarios.
| File Name | Description |
|---|---|
| operationsListSample.js | list the operations for the provider x-ms-original-file: 2026-02-01/Operations_List.json |
| retentionPoliciesCreateOrReplaceSample.js | create or Update a Retention Policy x-ms-original-file: 2026-02-01/RetentionPolicies_CreateOrReplace_MaximumSet_Gen.json |
| retentionPoliciesDeleteSample.js | delete a Retention Policy x-ms-original-file: 2026-02-01/RetentionPolicies_Delete_MaximumSet_Gen.json |
| retentionPoliciesGetSample.js | get a Retention Policy x-ms-original-file: 2026-02-01/RetentionPolicies_Get_MaximumSet_Gen.json |
| retentionPoliciesListBySchedulerSample.js | list Retention Policies x-ms-original-file: 2026-02-01/RetentionPolicies_ListByScheduler_MaximumSet_Gen.json |
| retentionPoliciesUpdateSample.js | update a Retention Policy x-ms-original-file: 2026-02-01/RetentionPolicies_Update_MaximumSet_Gen.json |
| schedulersCreateOrUpdatePrivateEndpointConnectionSample.js | create or update a private endpoint connection for the durable task scheduler x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json |
| schedulersCreateOrUpdateSample.js | create or update a Scheduler x-ms-original-file: 2026-02-01/Schedulers_CreateOrUpdate.json |
| schedulersDeletePrivateEndpointConnectionSample.js | delete a private endpoint connection for the durable task scheduler x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json |
| schedulersDeleteSample.js | delete a Scheduler x-ms-original-file: 2026-02-01/Schedulers_Delete.json |
| schedulersGetPrivateEndpointConnectionSample.js | get a private endpoint connection for the durable task scheduler x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json |
| schedulersGetPrivateLinkSample.js | get a private link resource for the durable task scheduler x-ms-original-file: 2026-02-01/PrivateLinkResources_Get_MaximumSet_Gen.json |
| schedulersGetSample.js | get a Scheduler x-ms-original-file: 2026-02-01/Schedulers_Get.json |
| schedulersListByResourceGroupSample.js | list Schedulers by resource group x-ms-original-file: 2026-02-01/Schedulers_ListByResourceGroup.json |
| schedulersListBySubscriptionSample.js | list Schedulers by subscription x-ms-original-file: 2026-02-01/Schedulers_ListBySubscription.json |
| schedulersListPrivateEndpointConnectionsSample.js | list private endpoint connections for the durable task scheduler x-ms-original-file: 2026-02-01/PrivateEndpointConnections_List_MaximumSet_Gen.json |
| schedulersListPrivateLinksSample.js | list private link resources for the durable task scheduler x-ms-original-file: 2026-02-01/PrivateLinkResources_List_MaximumSet_Gen.json |
| schedulersUpdatePrivateEndpointConnectionSample.js | update a private endpoint connection for the durable task scheduler x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Update.json |
| schedulersUpdateSample.js | update a Scheduler x-ms-original-file: 2026-02-01/Schedulers_Update.json |
| taskHubsCreateOrUpdateSample.js | create or Update a Task Hub x-ms-original-file: 2026-02-01/TaskHubs_CreateOrUpdate.json |
| taskHubsDeleteSample.js | delete a Task Hub x-ms-original-file: 2026-02-01/TaskHubs_Delete.json |
| taskHubsGetSample.js | get a Task Hub x-ms-original-file: 2026-02-01/TaskHubs_Get.json |
| taskHubsListBySchedulerSample.js | list Task Hubs x-ms-original-file: 2026-02-01/TaskHubs_ListByScheduler.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 operationsListSample.js
Alternatively, run a single sample with the required environment variables set (setting up the .env file is not required if you do this), for example (cross-platform):
node operationsListSample.js
Next Steps
Take a look at our API Documentation for more information about the APIs that are available in the clients.