{"library":"ms-rest-azure","title":"Azure Client Runtime for AutoRest Generated Node.js Libraries","description":"ms-rest-azure served as the foundational client runtime for Node.js Azure client libraries generated using the AutoRest toolchain. It provided essential infrastructure for handling HTTP requests, error responses, tracing, and Azure-specific authentication mechanisms such as Device Token, Service Principal, and Managed Identity. The package (version 3.0.2, last published approximately four years ago) was part of the older `azure-sdk-for-node` repository. As of March 2023, this package, along with many others in its repository, has been officially deprecated. The Azure SDK team has transitioned to a new generation of SDKs (`@azure/*` packages) that offer isomorphic capabilities (browser and Node.js support), consistent design guidelines, and native TypeScript support. Users are strongly encouraged to migrate to the newer `@azure/core-client` and `@azure/identity` packages for modern Azure development.","language":"javascript","status":"deprecated","last_verified":"Tue Apr 21","install":{"commands":["npm install ms-rest-azure"],"cli":null},"imports":["import { loginWithServicePrincipalSecret } from 'ms-rest-azure';","import { DeviceTokenCredentials } from 'ms-rest-azure';","import { AzureServiceClient } from 'ms-rest-azure';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { loginWithServicePrincipalSecret } from 'ms-rest-azure';\nimport { SubscriptionClient } from '@azure/arm-subscriptions'; // Example: using a client that depends on ms-rest-azure\n\nconst clientId = process.env.AZURE_CLIENT_ID ?? '';\nconst secret = process.env.AZURE_CLIENT_SECRET ?? '';\nconst domain = process.env.AZURE_TENANT_ID ?? ''; // Also known as tenantId\nconst subscriptionId = process.env.AZURE_SUBSCRIPTION_ID ?? '';\n\nasync function authenticateAndListSubscriptions() {\n  if (!clientId || !secret || !domain || !subscriptionId) {\n    console.error('Please set AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID, and AZURE_SUBSCRIPTION_ID environment variables.');\n    return;\n  }\n\n  try {\n    console.log('Attempting to log in with Service Principal...');\n    const credentials = await loginWithServicePrincipalSecret(clientId, secret, domain);\n    console.log('Successfully authenticated.');\n\n    const client = new SubscriptionClient(credentials);\n    const subscriptions = await client.subscriptions.list();\n\n    console.log('Azure Subscriptions:');\n    for await (const sub of subscriptions) {\n      console.log(`- ${sub.displayName} (${sub.subscriptionId})`);\n    }\n  } catch (err) {\n    console.error('Authentication or API call failed:', err);\n  }\n}\n\nauthenticateAndListSubscriptions();\n","lang":"typescript","description":"Demonstrates authenticating with Azure using a service principal and listing subscriptions, typical for older SDK clients.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}