SearchServiceCollection.CreateOrUpdateAsync Method

Definition

Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.

  • Request Path. : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}.
  • Operation Id. : SearchServices_CreateOrUpdate.
  • Default Api Version. : 2026-03-01-preview.
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Search.SearchServiceResource>> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string searchServiceName, Azure.ResourceManager.Search.SearchServiceData data, Azure.ResourceManager.Search.Models.SearchManagementRequestOptions searchManagementRequestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.Search.SearchServiceData * Azure.ResourceManager.Search.Models.SearchManagementRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Search.SearchServiceResource>>
override this.CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.Search.SearchServiceData * Azure.ResourceManager.Search.Models.SearchManagementRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Search.SearchServiceResource>>
Public Overridable Function CreateOrUpdateAsync (waitUntil As WaitUntil, searchServiceName As String, data As SearchServiceData, Optional searchManagementRequestOptions As SearchManagementRequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of SearchServiceResource))

Parameters

waitUntil
WaitUntil

Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

searchServiceName
String

The name of the Azure AI Search service associated with the specified resource group.

data
SearchServiceData

The definition of the search service to create or update.

searchManagementRequestOptions
SearchManagementRequestOptions
cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

searchServiceName or data is null.

searchServiceName is an empty string, and was expected to be non-empty.

Applies to