[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live) [AI SDK](/c/ai-sdk/62) # Azure OpenAI Web Search 521 views · 3 likes · 5 posts Ben (@frescoanalytics) · 2025-04-24 <!-- Questions that get answered the fastest are the ones with relevant info included in the original post. Be sure to include all detail needed to let others see and understand the problem! --> https://sdk.vercel.ai/providers/ai-sdk-providers/azure#web-search According the documentation above, ai-sdk allows web search via azure. However, google search, and chatbots do not return more details on Azure's support of web search. <!-- Current versus Expected behavior --> <!-- Code, configuration, and steps that reproduce this issue --> ``` import { createAzure } from '@ai-sdk/azure'; import { generateText } from 'ai'; const endpoint = process.env.AZURE_OPENAI_ENDPOINT; const apiKey = process.env.AZURE_OPENAI_API_KEY; const deploymentName = process.env.AZURE_OPENAI_DEPLOYMENT; if (!endpoint || !apiKey || !deploymentName) { console.error( 'Error: One or more required env vars are missing: AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY, AZURE_OPENAI_DEPLOYMENT', ); process.exit(1); } // Extract resource name from endpoint const resourceName = endpoint.replace(/^https?:\/\//, '').split('.')[0]; const azure = createAzure({ resourceName, apiKey, }); const prompt = process.argv.slice(2).join(' '); if (!prompt) { console.error('Usage: pnpm tsx azure-chat.ts "Your prompt here"'); process.exit(1); } async function main() { try { const { text } = await generateText({ model: azure.responses(deploymentName as string), prompt, // tools: { // web_search_preview: azure.tools.webSearchPreview({ // // optional configuration: // searchContextSize: 'high', // userLocation: { // type: 'approximate', // city: 'San Francisco', // region: 'California', // }, // }), // // Force web search tool: // toolChoice: { type: 'tool', toolName: 'web_search_preview' }, // // You can add providerOptions here if needed // }, }); console.log('\nAzure OpenAI response:\n', text); } catch (err) { console.error('Error communicating with Azure OpenAI:', err); process.exit(1); } } main(); ``` My above code works. The commented part is copied from the documentation. But if I uncomment it , error occurs. TypeError: undefined is not an object (evaluating 'azure.tools.webSearchPreview') <!-- Project information (URL, framework, environment, project settings) --> @ai-sdk/azure": "^1.3.19", "ai": "4.3.4", Nico Albanese (@nicoalbanese) · 2025-04-28 · ♥ 2 Hey! This appears to be an error in our docs. I don't believe we support provider tools with Azure yet. I will update the docs to remove. Ben (@frescoanalytics) · 2025-04-28 Nico. Appreciate your response! two quick follow-up questions, 1) any plan to support Azure Tools soon? 2) is the aisdk documentation page open sourced? Jacob Paris (@jacobparis) · 2025-04-28 · ♥ 1 Nico has submitted this fix already but yes the docs are open source. Here's the link to the page in quesiton https://github.com/vercel/ai/blob/main/content/providers/01-ai-sdk-providers/03-azure.mdx Ben (@frescoanalytics) · 2025-04-28 Great! Thank you. Look forward to more progress and integration with Azure OpenAI