Microsoft Foundry SDK for JavaScript 2.5
Last reviewed Sep 20, 2026
Prompt Details
Prompt Composition
4prompts
- JavaScript ES2026102 lines · 3.1K tokens
- Node.js 24101 lines · 5.3K tokens
- TypeScript 746 lines · 1.5K tokens
- 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
AIProjectClientwith a server-owned HTTPS project endpoint using host<resource>.services.ai.azure.comand path/api/projects/<project>, and an EntraTokenCredential. Validateoptions.endpointtoo: it overrides the endpoint used by project operations. KeepallowInsecureConnectiondisabled and keep credential scopes, API versions, transports, and additional policies under application control. - Select
ManagedIdentityCredentialorWorkloadIdentityCredentialexplicitly in production. If usingDefaultAzureCredential, constrain it with a reviewedAZURE_TOKEN_CREDENTIALSvalue andrequiredEnvVars: ["AZURE_TOKEN_CREDENTIALS"];prodstill permits several deployed credential sources and does not pin a single identity. - Keep
getOpenAIClient()options trusted:baseURLoverrides the project-derived destination while the helper still attaches the project's token provider for the HTTPSai.azure.comaudience's/.defaultscope. Never accept a caller's destination or forward project bearer tokens to arbitrary compatible