{"record":{"id":"d22428f124e0418c","repo":"microsoft/graphrag","slug":"url-must-be-provided-for-azure-ai-search","errorCode":null,"errorMessage":"url must be provided for Azure AI Search.","messagePattern":"url must be provided for Azure AI Search\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/graphrag-vectors/graphrag_vectors/azure_ai_search.py","lineNumber":64,"sourceCode":"\n\nclass AzureAISearchVectorStore(VectorStore):\n    \"\"\"Azure AI Search vector storage implementation.\"\"\"\n\n    index_client: SearchIndexClient\n\n    def __init__(\n        self,\n        url: str,\n        api_key: str | None = None,\n        audience: str | None = None,\n        vector_search_profile_name: str = \"vectorSearchProfile\",\n        **kwargs: Any,\n    ):\n        super().__init__(**kwargs)\n        if not url:\n            msg = \"url must be provided for Azure AI Search.\"\n            raise ValueError(msg)\n        self.url = url\n        self.api_key = api_key\n        self.audience = audience\n        self.vector_search_profile_name = vector_search_profile_name\n\n    def connect(self) -> Any:\n        \"\"\"Connect to AI search vector storage.\"\"\"\n        audience_arg = (\n            {\"audience\": self.audience} if self.audience and not self.api_key else {}\n        )\n        self.db_connection = SearchClient(\n            endpoint=self.url,\n            index_name=self.index_name,\n            credential=(\n                AzureKeyCredential(self.api_key)\n                if self.api_key\n                else DefaultAzureCredential()\n            ),","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag-vectors/graphrag_vectors/azure_ai_search.py#L46-L82","documentation":"The Azure AI Search vector store adapter requires the service endpoint URL (https://<service>.search.windows.net) to construct any index client; there is no default or discovery mechanism. __init__ validates url right after super() so it fails before connect().","triggerScenarios":"Instantiating AzureAISearch (or configuring vector storage type azure_ai_search) without url — missing AZURE_AI_SEARCH_URL env var or omitted YAML key.","commonSituations":"Env var not injected in deployment; YAML key named endpoint instead of url; secrets template copied incompletely.","solutions":["Set url in the vector store config or its env var (e.g. AZURE_AI_SEARCH_URL=https://mysearch.search.windows.net)","Verify the env var is present in the executing environment (print it before init)","Use the full endpoint including https:// and .search.windows.net"],"exampleFix":"# before\nAzureAISearch(api_key=key)\n# after\nAzureAISearch(url=\"https://mysearch.search.windows.net\", api_key=key)","handlingStrategy":"validation","validationCode":"import os\nurl = os.environ.get(\"AZURE_AI_SEARCH_URL\")\nassert url, \"set AZURE_AI_SEARCH_URL before init\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Preflight env var checks for all azure endpoints","Use the full https://...search.windows.net endpoint"],"tags":["azure-ai-search","vectors","config","missing-env-var"],"backgroundTag":"missing-required-config","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}