{"record":{"id":"b0ed231df063e0d5","repo":"microsoft/autogen","slug":"authentication-failed-please-check-your-credentia","errorCode":null,"errorMessage":"Authentication failed. Please check your credentials.","messagePattern":"Authentication failed\\. Please check your credentials\\.","errorType":"exception","errorClass":"ValueError","httpStatus":401,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/tools/azure/_ai_search.py","lineNumber":407,"sourceCode":"        Raises:\n            ValueError: If index doesn't exist or authentication fails\n        \"\"\"\n        if self._client is not None:\n            return self._client\n\n        try:\n            self._client = SearchClient(\n                endpoint=self.search_config.endpoint,\n                index_name=self.search_config.index_name,\n                credential=self.search_config.credential,\n                api_version=self.search_config.api_version,\n            )\n            return self._client\n        except ResourceNotFoundError as e:\n            raise ValueError(f\"Index '{self.search_config.index_name}' not found in Azure AI Search service.\") from e\n        except HttpResponseError as e:\n            if e.status_code == 401:\n                raise ValueError(\"Authentication failed. Please check your credentials.\") from e\n            elif e.status_code == 403:\n                raise ValueError(\"Permission denied to access this index.\") from e\n            else:\n                raise ValueError(f\"Error connecting to Azure AI Search: {str(e)}\") from e\n        except Exception as e:\n            raise ValueError(f\"Unexpected error initializing search client: {str(e)}\") from e\n\n    async def run(\n        self, args: Union[str, Dict[str, Any], SearchQuery], cancellation_token: Optional[CancellationToken] = None\n    ) -> SearchResults:\n        \"\"\"Execute a search against the Azure AI Search index.\n\n        Args:\n            args: Search query text or SearchQuery object\n            cancellation_token: Optional token to cancel the operation\n\n        Returns:\n            SearchResults: Container with search results and metadata","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/tools/azure/_ai_search.py#L389-L425","documentation":"Error \"Authentication failed. Please check your credentials.\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at python/packages/autogen-ext/src/autogen_ext/tools/azure/_ai_search.py:407 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the credential used"],"exampleFix":"Verify the API key or token credential is valid","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}