3

I'm trying to figure out if resources exist in Azure by using their resource ID. The Azure CLI command would be az resource show $resourceID. My application is in NodeJS.

Is there some equivalent in NodeJS I can use in my application? If not, is there another way to show a resource exists (information populates) or does not exist (null fields) in NodeJS?

Ultimately want to return true (exists) or false (does not exist).

Yury Fedorov
  • 14,508
  • 6
  • 50
  • 66

1 Answers1

0

To access Azure from your application, you can use their SDK. It uses similar terminology to Azure CLI. For your specific command, I believe checkExistenceById is what you are looking for.

Follow the installation instructions and learn the docs to see how to integrate the SDK into your app:

$ npm install azure-arm-resource
Yury Fedorov
  • 14,508
  • 6
  • 50
  • 66