Microsoft Foundry SDK for JavaScript 2.5

Last reviewed Sep 20, 2026

Export as PDF

Prompt Details

Prompt Composition

4prompts
  1. JavaScript ES2026102 lines · 3.1K tokens
  2. Node.js 24101 lines · 5.3K tokens
  3. TypeScript 746 lines · 1.5K tokens
  4. Microsoft Foundry SDK for JavaScript 2.576 lines · 4K tokens
Total325 lines · 14K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 88
  • 89
  • 95
  • 113
  • 117
  • 200
  • 201
  • 208
  • 209
  • 214
  • 250
  • 295
  • 297
  • 319
  • 323
  • 330
  • 338
  • 346
  • 347
  • 352
  • 354
  • 362
  • 367
  • 377
  • 426
  • 444
  • 459
  • 471
  • 488
  • 494
  • 502
  • 522
  • 524
  • 532
  • 602
  • 639
  • 653
  • 732
  • 770
  • 807
  • 829
  • 838
  • 841
  • 862
  • 863
  • 908
  • 915
  • 916
  • 918
  • 922
  • 942
  • 943
  • 1004
  • 1321
  • 1333
  • 1427

Prompt Preview

Apply the Node.js 24 and TypeScript 7 prompts first. These rules target the @azure/ai-projects 2.5 line and its Foundry project endpoint, and were checked against 2.5.0. The package requires Node.js >=22 and supports maintained Node.js LTS releases; use Node.js 24. Its declared dependency ranges include @azure/identity ^4.13.0 and openai ^6.16.0; verify behavior against the locked dependency versions. Hosted agent runtimes are separate from this JavaScript client runtime.

Client construction and request overrides

  • Construct AIProjectClient with a server-owned HTTPS project endpoint using host <resource>.services.ai.azure.com and path /api/projects/<project>, and an Entra TokenCredential. Validate options.endpoint too: it overrides the endpoint used by project operations. Keep allowInsecureConnection disabled and keep credential scopes, API versions, transports, and additional policies under application control.
  • Select ManagedIdentityCredential or WorkloadIdentityCredential explicitly in production. If using DefaultAzureCredential, constrain it with a reviewed AZURE_TOKEN_CREDENTIALS value and requiredEnvVars: ["AZURE_TOKEN_CREDENTIALS"]; prod still permits several deployed credential sources and does not pin a single identity.
  • Keep getOpenAIClient() options trusted: baseURL overrides the project-derived destination while the helper still attaches the project's token provider for the HTTPS ai.azure.com audience's /.default scope. Never accept a caller's destination or forward project bearer tokens to arbitrary compatible