Forum Discussion
Cannot connect Azure OpenAI Embeddings model to SQL Server 2025
The credential name is likely the issue. For an external REST endpoint, SQL Server matches the database-scoped credential by URL. Name it with the endpoint’s scheme and host, including the trailing slash, rather than an arbitrary label. Use the exact Azure OpenAI resource origin, keep IDENTITY = 'HTTPEndpointHeaders', store the api-key JSON in SECRET, and reference that credential from CREATE EXTERNAL MODEL.
Set LOCATION to the deployed embeddings endpoint with a supported API version. The MODEL value must match the deployed embedding model, and the vector dimensions must match that deployment’s output dimensions.
If it still fails, test DNS and HTTPS reachability from the SQL Server host, then inspect Azure OpenAI firewall or private-endpoint rules. Recreate only the credential and external model after correcting the URL. Do not include the real key in screenshots or diagnostics; rotate it if it has appeared anywhere public.