azure-sdk-for-js/sdk/devcenter/developer-devcenter-rest/README.md

3.9 KiB

Azure DevCenter REST client library for JavaScript

The Azure DevCenter library provides access to manage resources for Microsoft Dev Box and Azure Deployment Environments. This package enables managing developer machines and environments in Azure.

Use the package for Azure DevCenter to:

Create, access, manage, and delete Dev Box resources Create, deploy, manage, and delete Environment resources

DevCenter service

Please rely heavily on our REST client docs to use this library

Key links:

Getting started

Currently supported environments

  • LTS versions of Node.js

Prerequisites

  • You must have an Azure subscription to use this package.
  • You must have configured a DevCenter, Project, Network Connection, Dev Box Definition, and Pool before you can create Dev Boxes
  • You must have configured a DevCenter, Project, Catalog, and Environment Type before you can create Environments

Install the @azure-rest/developer-devcenter package

Install the Azure DevCenter REST client REST client library for JavaScript with npm:

npm install @azure-rest/developer-devcenter

Create and authenticate a AzureDeveloperDevCenterClient

To use an Azure Active Directory (AAD) token credential, provide an instance of the desired credential type obtained from the @azure/identity library.

To authenticate with AAD, you must first npm install @azure/identity

After setup, you can choose which type of credential from @azure/identity to use. As an example, DefaultAzureCredential can be used to authenticate the client.

Set the value of dev center endpoint as environment variable: DEVCENTER_ENDPOINT

Key Concepts

REST Client

This client is one of our REST clients. We highly recommend you read how to use a REST client here.

DevCenter Concepts

Dev Boxes refer to managed developer machines running in Azure. Dev Boxes are provisioned in Pools, which define the network and image used for a Dev Box.

Environments refer to templated developer environments, which combine a template (Catalog Item) and parameters, as well as an Environment Type which defines permissions and where the resources are deployed.

Troubleshooting

Logging

Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the AZURE_LOG_LEVEL environment variable to info. Alternatively, logging can be enabled at runtime by calling setLogLevel in the @azure/logger:

const { setLogLevel } = require("@azure/logger");

setLogLevel("info");

For more detailed instructions on how to enable logs, you can look at the @azure/logger package docs.