To run this sample, in addition to an Azure Search service, you need access to an Azure Key Vault account, and optionally also to an Azure Active Directory application.
You need to obtain the key-identifier of some Azure Key Vault key, that has at least 'get', 'wrap' and 'unwrap' capabilities. An Azure Key Vault key identifier has the following format: 'https://.vault.azure.net/keys//'.

In order for your Azure Search service to be able to use your Azure Key Vault key, you must grant your search service certain Key Vault access permissions, specifically 'get', 'wrap' and 'unwrap'.
If your Azure Search service has a managed service identity (see Create a service identity), you can grant these permissions from your key vault directly to your search service. If MSI is not enabled for your search service, and you don't wish to enable it, you must create (or use existing) Azure Active Directory (AAD) application, grant that application the required access permissions, and share the credentials of this AAD application with your Azure Search service. Learn more about this option here - Use an externally managed Azure Active Directory application.

After obtaining the required resources described about, follow this steps to run this sample:

Open the DotNetHowToAutocomplete.sln project in Visual Studio

Update the appsettings.json with your Azure Search service name and api-keys, and your Azure Key Vault key identifier

If MSI is not to be used, update the appsettings.json with your AAD credentials

Compile and Run the project

Running the DotNetHowToEncryptionUsingCMK sample

Open the DotNetHowToEncryptionUsingCMK.sln project in Visual Studio

Compile and Run the project

More information

For more details on the "how-to" sample, please refer to this article: