azure-docs-sdk-node
azure-docs-sdk-node copied to clipboard
Backup.md example -> TypeError: client.jobs.list is not a function
Hi,
When I execute code example provided at https://github.com/MicrosoftDocs/azure-docs-sdk-node/blob/master/docs-ref-services/backup.md I get the following error message:
To sign in, use a web browser to open the page https://aka.ms/devicelogin and enter the code CA3LZDEPE to authenticate. TypeError: client.jobs.list is not a function at msRestAzure.interactiveLogin.then.credentials (C:\Temp\AzureFunction\BackupCheck.js:15:24) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)
I did provide the subscriptionId, vault and resourceGroupName information.
Can you please point out what I'm doing wrong?
Cheers, Marc
Managed to figure out the solution myself.
return client.jobs.list(vault, resourceGroupName);
should be
return client.*backupJobs.list(vault, resourceGroupName);
Class jobs does not have method list. https://docs.microsoft.com/en-us/javascript/api/azure-arm-recoveryservicesbackup/jobs?view=azure-node-latest&viewFallbackFrom=azure-node-2.2.0