{"id":19100958,"url":"https://github.com/Azure-Samples/search-dotnet-getting-started","last_synced_at":"2025-04-18T18:31:18.823Z","repository":{"id":3557147,"uuid":"42957688","full_name":"Azure-Samples/search-dotnet-getting-started","owner":"Azure-Samples","description":"Getting Started with Azure Search using .NET","archived":false,"fork":false,"pushed_at":"2024-04-24T21:34:31.000Z","size":1794,"stargazers_count":104,"open_issues_count":2,"forks_count":156,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-04-24T22:33:21.644Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Azure-Samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-09-22T20:01:21.000Z","updated_at":"2024-04-24T21:34:36.000Z","dependencies_parsed_at":"2024-04-24T22:32:31.037Z","dependency_job_id":null,"html_url":"https://github.com/Azure-Samples/search-dotnet-getting-started","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Fsearch-dotnet-getting-started","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Fsearch-dotnet-getting-started/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Fsearch-dotnet-getting-started/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Fsearch-dotnet-getting-started/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure-Samples","download_url":"https://codeload.github.com/Azure-Samples/search-dotnet-getting-started/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223783094,"owners_count":17201905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T03:53:04.997Z","updated_at":"2025-04-18T18:31:18.815Z","avatar_url":"https://github.com/Azure-Samples.png","language":"C#","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"---\r\npage_type: sample\r\ndescription: \"Contains several projects to help you get started with Azure AI Search and the .NET SDK\"\r\nlanguages:\r\n- csharp\r\nproducts:\r\n- azure\r\n- azure-cognitive-search\r\n---\r\n\r\n# Getting Started with Azure AI Search using .NET\r\n\r\nThis repository includes several projects that show you how to use the [**Azure.Search.Documents**](https://docs.microsoft.com/dotnet/api/overview/azure/search.documents-readme) client library in Azure SDK for .NET to create C# applications that use Azure AI Search.\r\n\r\nAn earlier version of the samples that were built using the [**Microsoft.Azure.Search**](https://docs.microsoft.com/dotnet/api/overview/azure/search/client10) client libraries can be found in the **v10** branch of this repo. To download those versions, switch the branch from **master** to **v10**, and then select **Code** to download or open those samples.\r\n\r\n## DotNetHowTo\r\n\r\nThis sample is a simple .NET Core console application that shows you how to:\r\n\r\n* Create and delete a search index\r\n* Upload documents\r\n* Search and filter documents within an index\r\n\r\nTo run this sample, open the solution in Visual Studio and modify **appsettings.json** to use valid values for your search service.\r\n\r\n\u003c!-- For detailed instructions, see [How to develop in C# using Azure.Search.Documents](https://docs.microsoft.com/azure/search/search-howto-dotnet-sdk-v11).  --\u003e\r\n\r\n## DotNetHowToEncryptionUsingCMK\r\n\r\nThis sample demonstrates how to create a synonym-map and an index that are encrypted with a customer-managed key in Azure Key Vault. This sample uses several services that must be set up in advance: Azure Key Vault, Azure Active Directory, and modifications to your existing search service.\r\n\r\nThe **appsettings.json** file provides placeholders for service information.\r\n\r\nFor detailed instructions, see [How to configure customer-managed keys for data encryption in Azure AI Search](https://docs.microsoft.com/azure/search/search-security-manage-encryption-keys).\r\n\r\n## DotNetHowToIndexers\r\n\r\nThis sample is a simple .NET Core console application that shows how create and run a search indexer that retrieves data from an Azure SQL database.\r\n\r\nBefore you can run this sample, you will need an Azure SQL database that contains sample data used by the indexer. You will also need to modify settings in **appsettings.json**.\r\n\r\n1. Create a new database in Azure SQL named hotels.\r\n1. Run the `data\\hotels.sql` script provided in this sample against your Azure SQL database.\r\n1. Open the DotNetHowToIndexers.sln in Visual Studio.\r\n1. Update the appsettings.json with your service name, api key, and connection string to your Azure SQL database.\r\n1. Compile and Run the project using Visual Studio.\r\n\r\n## Retired samples\r\n\r\nThe following samples have been removed from the master branch.\r\n\r\n### DotNetETagsExplainer\r\n\r\nThis sample is [now archived](https://github.com/Azure-Samples/azure-search-sample-archive). It's a .console application that shows how to use ETags to update Azure AI Search resources safely in the presence of concurrency. The code in this sample simulates concurrent write operations so that you can see how that condition is handled.\r\n\r\n### DotNetHowToSecurityTrimming (Archived)\r\n\r\nThis sample is [now archived](https://github.com/Azure-Samples/azure-search-sample-archive). It's replaced by [instructions for setting up access control](https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/LoginAndAclSetup.md) on the [azure-search-openai-demo](https://github.com/Azure-Samples/azure-search-openai-demo/tree/main).\r\n\r\n### DotNetHowToSynonyms (Archived)\r\n\r\nThis C# sample was used to demonstrate the benefits of adding a synonym map using \"before-and-after\" queries. The Azure SDK team provides a more recent sample. See [Azure.Search.Documents Samples - Service Operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/samples/Sample02_Service.md#create-a-synonym-map) for replacement code.\r\n\r\n### DotNetHowToAutocomplete\r\n\r\nThis sample was not migrated to use the Azure.Search.Documents client library. It has been replaced by a project in the [create-first-app](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/create-first-app) sample in the [azure-search-dotnet-samples](https://github.com/Azure-Samples/azure-search-dotnet-samples) repository. Alternatively, you can look at the v10 version of the sample.\r\n\r\n### DotNetHowToMultipleDataSources\r\n\r\nThis sample was not migrated to use the Azure.Search.Documents client library. It has been replaced by the [multiple-data-sources](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/multiple-data-sources) sample in the [azure-search-dotnet-samples](https://github.com/Azure-Samples/azure-search-dotnet-samples) repository. Alternatively, you can look at the v10 version of the sample.\r\n\r\n### DotNetSample\r\n\r\nThis sample was not migrated to use the Azure.Search.Documents client library. We recommend that you refer to **DotNetHowToIndexers** to view code that calls the Azure SQL Indexer. Alternatively, you can look at the v10 version of the sample.\r\n\r\n---\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAzure-Samples%2Fsearch-dotnet-getting-started","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAzure-Samples%2Fsearch-dotnet-getting-started","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAzure-Samples%2Fsearch-dotnet-getting-started/lists"}