Files
Jeremy MengandGitHub 696aa6ae52 [EngSys] remove dev-tool run vendored from individual packages (#36198)
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.
2025-10-13 16:52:42 -07:00

74 KiB

client library samples for JavaScript

These sample programs show how to use the JavaScript client libraries for in some common scenarios.

File Name Description
armTemplatesGetSample.js Get azure resource manager template. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_Get.json
armTemplatesListSample.js List azure resource manager templates in a given artifact source. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_List.json
artifactSourcesCreateOrUpdateSample.js Create or replace an existing artifact source. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_CreateOrUpdate.json
artifactSourcesDeleteSample.js Delete artifact source. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Delete.json
artifactSourcesGetSample.js Get artifact source. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Get.json
artifactSourcesListSample.js List artifact sources in a given lab. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_List.json
artifactSourcesUpdateSample.js Allows modifying tags of artifact sources. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Update.json
artifactsGenerateArmTemplateSample.js Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates the generated artifact. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_GenerateArmTemplate.json
artifactsGetSample.js Get artifact. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_Get.json
artifactsListSample.js List artifacts in a given artifact source. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_List.json
costsCreateOrUpdateSample.js Create or replace an existing cost. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_CreateOrUpdate.json
costsGetSample.js Get cost. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_Get.json
customImagesCreateOrUpdateSample.js Create or replace an existing custom image. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_CreateOrUpdate.json
customImagesDeleteSample.js Delete custom image. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Delete.json
customImagesGetSample.js Get custom image. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Get.json
customImagesListSample.js List custom images in a given lab. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_List.json
customImagesUpdateSample.js Allows modifying tags of custom images. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Update.json
disksAttachSample.js Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Attach.json
disksCreateOrUpdateSample.js Create or replace an existing disk. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_CreateOrUpdate.json
disksDeleteSample.js Delete disk. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Delete.json
disksDetachSample.js Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Detach.json
disksGetSample.js Get disk. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Get.json
disksListSample.js List disks in a given user profile. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_List.json
disksUpdateSample.js Allows modifying tags of disks. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Update.json
environmentsCreateOrUpdateSample.js Create or replace an existing environment. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_CreateOrUpdate.json
environmentsDeleteSample.js Delete environment. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Delete.json
environmentsGetSample.js Get environment. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Get.json
environmentsListSample.js List environments in a given user profile. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_List.json
environmentsUpdateSample.js Allows modifying tags of environments. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Update.json
formulasCreateOrUpdateSample.js Create or replace an existing formula. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_CreateOrUpdate.json
formulasDeleteSample.js Delete formula. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Delete.json
formulasGetSample.js Get formula. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Get.json
formulasListSample.js List formulas in a given lab. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_List.json
formulasUpdateSample.js Allows modifying tags of formulas. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Update.json
galleryImagesListSample.js List gallery images in a given lab. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GalleryImages_List.json
globalSchedulesCreateOrUpdateSample.js Create or replace an existing schedule. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_CreateOrUpdate.json
globalSchedulesDeleteSample.js Delete schedule. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Delete.json
globalSchedulesExecuteSample.js Execute a schedule. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Execute.json
globalSchedulesGetSample.js Get schedule. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Get.json
globalSchedulesListByResourceGroupSample.js List schedules in a resource group. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListByResourceGroup.json
globalSchedulesListBySubscriptionSample.js List schedules in a subscription. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListBySubscription.json
globalSchedulesRetargetSample.js Updates a schedule's target resource Id. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Retarget.json
globalSchedulesUpdateSample.js Allows modifying tags of schedules. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Update.json
labsClaimAnyVMSample.js Claim a random claimable virtual machine in the lab. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ClaimAnyVm.json
labsCreateEnvironmentSample.js Create virtual machines in a lab. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateEnvironment.json
labsCreateOrUpdateSample.js Create or replace an existing lab. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateOrUpdate.json
labsDeleteSample.js Delete lab. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Delete.json
labsExportResourceUsageSample.js Exports the lab resource usage into a storage account This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ExportResourceUsage.json
labsGenerateUploadUriSample.js Generate a URI for uploading custom disk images to a Lab. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_GenerateUploadUri.json
labsGetSample.js Get lab. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Get.json
labsImportVirtualMachineSample.js Import a virtual machine into a different lab. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ImportVirtualMachine.json
labsListByResourceGroupSample.js List labs in a resource group. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListByResourceGroup.json
labsListBySubscriptionSample.js List labs in a subscription. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListBySubscription.json
labsListVhdsSample.js List disk images available for custom image creation. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListVhds.json
labsUpdateSample.js Allows modifying tags of labs. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Update.json
notificationChannelsCreateOrUpdateSample.js Create or replace an existing notification channel. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_CreateOrUpdate.json
notificationChannelsDeleteSample.js Delete notification channel. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Delete.json
notificationChannelsGetSample.js Get notification channel. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Get.json
notificationChannelsListSample.js List notification channels in a given lab. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_List.json
notificationChannelsNotifySample.js Send notification to provided channel. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Notify.json
notificationChannelsUpdateSample.js Allows modifying tags of notification channels. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Update.json
operationsGetSample.js Get operation. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Operations_Get.json
policiesCreateOrUpdateSample.js Create or replace an existing policy. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_CreateOrUpdate.json
policiesDeleteSample.js Delete policy. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Delete.json
policiesGetSample.js Get policy. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Get.json
policiesListSample.js List policies in a given policy set. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_List.json
policiesUpdateSample.js Allows modifying tags of policies. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Update.json
policySetsEvaluatePoliciesSample.js Evaluates lab policy. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/PolicySets_EvaluatePolicies.json
providerOperationsListSample.js Result of the request to list REST API operations x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ProviderOperations_List.json
schedulesCreateOrUpdateSample.js Create or replace an existing schedule. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_CreateOrUpdate.json
schedulesDeleteSample.js Delete schedule. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Delete.json
schedulesExecuteSample.js Execute a schedule. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Execute.json
schedulesGetSample.js Get schedule. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Get.json
schedulesListApplicableSample.js Lists all applicable schedules x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_ListApplicable.json
schedulesListSample.js List schedules in a given lab. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_List.json
schedulesUpdateSample.js Allows modifying tags of schedules. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Update.json
secretsCreateOrUpdateSample.js Create or replace an existing secret. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_CreateOrUpdate.json
secretsDeleteSample.js Delete secret. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Delete.json
secretsGetSample.js Get secret. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Get.json
secretsListSample.js List secrets in a given user profile. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_List.json
secretsUpdateSample.js Allows modifying tags of secrets. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Update.json
serviceFabricSchedulesCreateOrUpdateSample.js Create or replace an existing schedule. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_CreateOrUpdate.json
serviceFabricSchedulesDeleteSample.js Delete schedule. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Delete.json
serviceFabricSchedulesExecuteSample.js Execute a schedule. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Execute.json
serviceFabricSchedulesGetSample.js Get schedule. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Get.json
serviceFabricSchedulesListSample.js List schedules in a given service fabric. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_List.json
serviceFabricSchedulesUpdateSample.js Allows modifying tags of schedules. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Update.json
serviceFabricsCreateOrUpdateSample.js Create or replace an existing service fabric. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_CreateOrUpdate.json
serviceFabricsDeleteSample.js Delete service fabric. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Delete.json
serviceFabricsGetSample.js Get service fabric. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Get.json
serviceFabricsListApplicableSchedulesSample.js Lists the applicable start/stop schedules, if any. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_ListApplicableSchedules.json
serviceFabricsListSample.js List service fabrics in a given user profile. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_List.json
serviceFabricsStartSample.js Start a service fabric. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Start.json
serviceFabricsStopSample.js Stop a service fabric This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Stop.json
serviceFabricsUpdateSample.js Allows modifying tags of service fabrics. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Update.json
serviceRunnersCreateOrUpdateSample.js Create or replace an existing service runner. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_CreateOrUpdate.json
serviceRunnersDeleteSample.js Delete service runner. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Delete.json
serviceRunnersGetSample.js Get service runner. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Get.json
usersCreateOrUpdateSample.js Create or replace an existing user profile. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_CreateOrUpdate.json
usersDeleteSample.js Delete user profile. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Delete.json
usersGetSample.js Get user profile. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Get.json
usersListSample.js List user profiles in a given lab. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_List.json
usersUpdateSample.js Allows modifying tags of user profiles. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Update.json
virtualMachineSchedulesCreateOrUpdateSample.js Create or replace an existing schedule. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_CreateOrUpdate.json
virtualMachineSchedulesDeleteSample.js Delete schedule. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Delete.json
virtualMachineSchedulesExecuteSample.js Execute a schedule. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Execute.json
virtualMachineSchedulesGetSample.js Get schedule. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Get.json
virtualMachineSchedulesListSample.js List schedules in a given virtual machine. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_List.json
virtualMachineSchedulesUpdateSample.js Allows modifying tags of schedules. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Update.json
virtualMachinesAddDataDiskSample.js Attach a new or existing data disk to virtual machine. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_AddDataDisk.json
virtualMachinesApplyArtifactsSample.js Apply artifacts to virtual machine. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_ApplyArtifacts.json
virtualMachinesClaimSample.js Take ownership of an existing virtual machine This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Claim.json
virtualMachinesCreateOrUpdateSample.js Create or replace an existing virtual machine. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_CreateOrUpdate.json
virtualMachinesDeleteSample.js Delete virtual machine. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Delete.json
virtualMachinesDetachDataDiskSample.js Detach the specified disk from the virtual machine. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_DetachDataDisk.json
virtualMachinesGetRdpFileContentsSample.js Gets a string that represents the contents of the RDP file for the virtual machine x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_GetRdpFileContents.json
virtualMachinesGetSample.js Get virtual machine. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Get.json
virtualMachinesListApplicableSchedulesSample.js Lists the applicable start/stop schedules, if any. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_ListApplicableSchedules.json
virtualMachinesListSample.js List virtual machines in a given lab. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_List.json
virtualMachinesRedeploySample.js Redeploy a virtual machine This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Redeploy.json
virtualMachinesResizeSample.js Resize Virtual Machine. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Resize.json
virtualMachinesRestartSample.js Restart a virtual machine. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Restart.json
virtualMachinesStartSample.js Start a virtual machine. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Start.json
virtualMachinesStopSample.js Stop a virtual machine This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Stop.json
virtualMachinesTransferDisksSample.js Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_TransferDisks.json
virtualMachinesUnClaimSample.js Release ownership of an existing virtual machine This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_UnClaim.json
virtualMachinesUpdateSample.js Allows modifying tags of virtual machines. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Update.json
virtualNetworksCreateOrUpdateSample.js Create or replace an existing virtual network. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_CreateOrUpdate.json
virtualNetworksDeleteSample.js Delete virtual network. This operation can take a while to complete. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Delete.json
virtualNetworksGetSample.js Get virtual network. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Get.json
virtualNetworksListSample.js List virtual networks in a given lab. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_List.json
virtualNetworksUpdateSample.js Allows modifying tags of virtual networks. All other properties will be ignored. x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Update.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:

  1. Install the dependencies using npm:
npm install
  1. Edit the file sample.env, adding the correct credentials to access the Azure service and run the samples. Then rename the file from sample.env to just .env. The sample programs will read this file automatically.

  2. Run whichever samples you like (note that some samples may require additional setup, see the table above):

node armTemplatesGetSample.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 armTemplatesGetSample.js

Next Steps

Take a look at our API Documentation for more information about the APIs that are available in the clients.