Atualiza um serviço de pesquisa existente no determinado grupo de recursos.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}?api-version=2025-05-01
Parâmetros do URI
| Name |
Em |
Necessário |
Tipo |
Description |
|
resourceGroupName
|
path |
True
|
string
|
O nome do grupo de recursos dentro da assinatura atual. Você pode obter esse valor da API do Azure Resource Manager ou do portal.
|
|
searchServiceName
|
path |
True
|
string
|
O nome do serviço Azure AI Search a ser atualizado.
|
|
subscriptionId
|
path |
True
|
string
|
O identificador exclusivo de uma assinatura do Microsoft Azure. Você pode obter esse valor da API do Azure Resource Manager ou do portal.
|
|
api-version
|
query |
True
|
string
|
A versão da API a ser usada para cada solicitação.
|
| Name |
Necessário |
Tipo |
Description |
|
x-ms-client-request-id
|
|
string
(uuid)
|
Um valor GUID gerado pelo cliente que identifica essa solicitação. Se especificado, isso será incluído nas informações de resposta como uma forma de rastrear a solicitação.
|
Corpo do Pedido
| Name |
Tipo |
Description |
|
identity
|
Identity
|
Detalhes sobre a identidade do serviço de pesquisa. Um valor nulo indica que o serviço de pesquisa não tem nenhuma identidade atribuída.
|
|
location
|
string
|
A localização geográfica do recurso. Essa deve ser uma das regiões geográficas do Azure com suporte e registradas (por exemplo, Oeste dos EUA, Leste dos EUA, Sudeste Asiático e assim por diante). Essa propriedade é necessária ao criar um novo recurso.
|
|
properties.authOptions
|
DataPlaneAuthOptions
|
Define as opções de como a API do plano de dados de um serviço de pesquisa autentica solicitações. Isso não pode ser definido se 'disableLocalAuth' estiver definido como true.
|
|
properties.computeType
|
ComputeType
|
Configure essa propriedade para dar suporte ao serviço de pesquisa usando a Computação Padrão ou a Computação Confidencial do Azure.
|
|
properties.dataExfiltrationProtections
|
SearchDataExfiltrationProtection[]
|
Uma lista de cenários de exfiltração de dados que não são explicitamente permitidos para o serviço de pesquisa. Atualmente, o único valor suportado é 'Todos' para desativar todos os cenários possíveis de exportação de dados com controles mais refinados planejados para o futuro.
|
|
properties.disableLocalAuth
|
boolean
|
Quando definido como true, as chamadas para o serviço de pesquisa não terão permissão para utilizar chaves de API para autenticação. Isso não pode ser definido como true se 'dataPlaneAuthOptions' estiver definido.
|
|
properties.encryptionWithCmk
|
EncryptionWithCmk
|
Especifica qualquer política relativa à criptografia de recursos (como índices) usando chaves do gerenciador de clientes em um serviço de pesquisa.
|
|
properties.endpoint
|
string
(uri)
|
O ponto de extremidade do serviço Azure AI Search.
|
|
properties.hostingMode
|
HostingMode
|
Aplicável apenas para o padrão 3 SKU. Você pode definir essa propriedade para habilitar até 3 partições de alta densidade que permitem até 1000 índices, o que é muito maior do que os índices máximos permitidos para qualquer outra SKU. Para o SKU standard3, o valor é 'default' ou 'highDensity'. Para todos os outros SKUs, esse valor deve ser 'padrão'.
|
|
properties.networkRuleSet
|
NetworkRuleSet
|
Regras específicas de rede que determinam como o serviço Azure AI Search pode ser alcançado.
|
|
properties.partitionCount
|
integer
(int32)
minimum: 1 maximum: 12
|
O número de partições no serviço de pesquisa; se especificado, pode ser 1, 2, 3, 4, 6 ou 12. Valores maiores que 1 só são válidos para SKUs padrão. Para serviços 'standard3' com hostingMode definido como 'highDensity', os valores permitidos estão entre 1 e 3.
|
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
Esse valor pode ser definido como 'habilitado' para evitar alterações significativas nos recursos e modelos existentes do cliente. Se definido como 'desativado', o tráfego na interface pública não é permitido, e as conexões de ponto final privado seriam o método de acesso exclusivo.
|
|
properties.replicaCount
|
integer
(int32)
minimum: 1 maximum: 12
|
O número de réplicas no serviço de pesquisa. Se especificado, deve ser um valor entre 1 e 12 inclusive para SKUs padrão ou entre 1 e 3 inclusive para SKU básico.
|
|
properties.semanticSearch
|
SearchSemanticSearch
|
Define opções que controlam a disponibilidade da pesquisa semântica. Essa configuração só é possível para determinadas SKUs do Azure AI Search em determinados locais.
|
|
properties.upgradeAvailable
|
UpgradeAvailable
|
Indica se o serviço de pesquisa tem uma atualização disponível.
|
|
sku
|
Sku
|
O SKU do serviço de pesquisa, que determina a camada de preço e os limites de capacidade. Esta propriedade é necessária ao criar um novo serviço de pesquisa.
|
|
tags
|
object
|
Tags para ajudar a categorizar o recurso no portal do Azure.
|
Respostas
| Name |
Tipo |
Description |
|
200 OK
|
SearchService
|
A definição de serviço existente foi atualizada com êxito. Se você alterou o número de réplicas ou partições, a operação de escala acontecerá de forma assíncrona. Você pode verificar o status de uma operação de escala por meio da propriedade provisioningState retornada na resposta para uma solicitação Get Service.
|
|
Other Status Codes
|
CloudError
|
HTTP 400 (Solicitação incorreta): A definição de serviço fornecida é inválida ou você tentou alterar uma propriedade que é imutável. Consulte o código de erro e a mensagem na resposta para obter detalhes. HTTP 404 (Não encontrado): Não foi possível encontrar a subscrição ou o grupo de recursos. HTTP 409 (Conflito): A assinatura especificada está desabilitada.
|
Segurança
azure_auth
Especifica um fluxo de concessão implícito, conforme suportado na plataforma Microsoft Identity.
Tipo:
oauth2
Fluxo:
implicit
URL de Autorização:
https://login.microsoftonline.com/common/oauth2/authorize
Âmbitos
| Name |
Description |
|
user_impersonation
|
personificar a sua conta de utilizador
|
Exemplos
SearchUpdateService
Pedido de amostra
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2025-05-01
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"properties": {
"replicaCount": 2
}
}
import com.azure.resourcemanager.search.models.SearchServiceUpdate;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateService.json
*/
/**
* Sample code: SearchUpdateService.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchUpdateService(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices()
.update("rg1", "mysearchservice", new SearchServiceUpdate()
.withTags(mapOf("app-name", "My e-commerce app", "new-tag", "Adding a new tag")).withReplicaCount(2),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {"replicaCount": 2},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateService.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fb3217991ff57b5760525aeba1a0670bfe0880fa/specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateService.json
func ExampleServicesClient_Update_searchUpdateService() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
ReplicaCount: to.Ptr[int32](2),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// SystemData: &armsearch.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("My e-commerce app"),
// CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("fakeuser@contoso.com"),
// LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// ComputeType: to.Ptr(armsearch.ComputeTypeDefault),
// DataExfiltrationProtections: []*armsearch.SearchDataExfiltrationProtection{
// },
// DisableLocalAuth: to.Ptr(false),
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"),
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](2),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// UpgradeAvailable: to.Ptr(armsearch.UpgradeAvailableNotAvailable),
// },
// SKU: &armsearch.SKU{
// Name: to.Ptr(armsearch.SKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateService.json
*/
async function searchUpdateService() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
replicaCount: 2,
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateService.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(default)
{
ReplicaCount = 2,
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag"
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 2,
"partitionCount": 1,
"endpoint": "https://mysearchservice.search.windows.net/",
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"computeType": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"dataExfiltrationProtections": [],
"upgradeAvailable": "notAvailable",
"serviceUpgradedAt": null
},
"systemData": {
"createdBy": "My e-commerce app",
"createdByType": "Application",
"createdAt": "2024-01-01T00:00:00Z",
"lastModifiedBy": "fakeuser@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-11-01T00:00:00Z"
}
}
SearchUpdateServiceAuthOptions
Pedido de amostra
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2025-05-01
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"properties": {
"replicaCount": 2,
"authOptions": {
"aadOrApiKey": {
"aadAuthFailureMode": "http401WithBearerChallenge"
}
}
}
}
import com.azure.resourcemanager.search.models.AadAuthFailureMode;
import com.azure.resourcemanager.search.models.DataPlaneAadOrApiKeyAuthOption;
import com.azure.resourcemanager.search.models.DataPlaneAuthOptions;
import com.azure.resourcemanager.search.models.SearchServiceUpdate;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceAuthOptions.
* json
*/
/**
* Sample code: SearchUpdateServiceAuthOptions.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchUpdateServiceAuthOptions(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().update("rg1", "mysearchservice",
new SearchServiceUpdate().withTags(mapOf("app-name", "My e-commerce app", "new-tag", "Adding a new tag"))
.withReplicaCount(2)
.withAuthOptions(new DataPlaneAuthOptions().withAadOrApiKey(new DataPlaneAadOrApiKeyAuthOption()
.withAadAuthFailureMode(AadAuthFailureMode.HTTP401WITH_BEARER_CHALLENGE))),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_auth_options.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {
"authOptions": {"aadOrApiKey": {"aadAuthFailureMode": "http401WithBearerChallenge"}},
"replicaCount": 2,
},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceAuthOptions.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fb3217991ff57b5760525aeba1a0670bfe0880fa/specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceAuthOptions.json
func ExampleServicesClient_Update_searchUpdateServiceAuthOptions() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
AuthOptions: &armsearch.DataPlaneAuthOptions{
AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{
AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge),
},
},
ReplicaCount: to.Ptr[int32](2),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// SystemData: &armsearch.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("My e-commerce app"),
// CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("fakeuser@contoso.com"),
// LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{
// AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge),
// },
// },
// ComputeType: to.Ptr(armsearch.ComputeTypeDefault),
// DataExfiltrationProtections: []*armsearch.SearchDataExfiltrationProtection{
// },
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"),
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](2),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// UpgradeAvailable: to.Ptr(armsearch.UpgradeAvailableNotAvailable),
// },
// SKU: &armsearch.SKU{
// Name: to.Ptr(armsearch.SKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceAuthOptions.json
*/
async function searchUpdateServiceAuthOptions() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
authOptions: {
aadOrApiKey: { aadAuthFailureMode: "http401WithBearerChallenge" },
},
replicaCount: 2,
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceAuthOptions.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(default)
{
ReplicaCount = 2,
AuthOptions = new SearchAadAuthDataPlaneAuthOptions
{
AadAuthFailureMode = SearchAadAuthFailureMode.Http401WithBearerChallenge,
},
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag"
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 2,
"partitionCount": 1,
"endpoint": "https://mysearchservice.search.windows.net/",
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"computeType": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"authOptions": {
"aadOrApiKey": {
"aadAuthFailureMode": "http401WithBearerChallenge"
}
},
"dataExfiltrationProtections": [],
"upgradeAvailable": "notAvailable",
"serviceUpgradedAt": null
},
"systemData": {
"createdBy": "My e-commerce app",
"createdByType": "Application",
"createdAt": "2024-01-01T00:00:00Z",
"lastModifiedBy": "fakeuser@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-11-01T00:00:00Z"
}
}
SearchUpdateServiceDisableLocalAuth
Pedido de amostra
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2025-05-01
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"properties": {
"replicaCount": 2,
"disableLocalAuth": true
}
}
import com.azure.resourcemanager.search.models.SearchServiceUpdate;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services Update.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/
* SearchUpdateServiceDisableLocalAuth.json
*/
/**
* Sample code: SearchUpdateServiceDisableLocalAuth.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchUpdateServiceDisableLocalAuth(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().update("rg1", "mysearchservice",
new SearchServiceUpdate().withTags(mapOf("app-name", "My e-commerce app", "new-tag", "Adding a new tag"))
.withReplicaCount(2).withDisableLocalAuth(true),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_disable_local_auth.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {"disableLocalAuth": True, "replicaCount": 2},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceDisableLocalAuth.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fb3217991ff57b5760525aeba1a0670bfe0880fa/specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceDisableLocalAuth.json
func ExampleServicesClient_Update_searchUpdateServiceDisableLocalAuth() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
DisableLocalAuth: to.Ptr(true),
ReplicaCount: to.Ptr[int32](2),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// SystemData: &armsearch.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("My e-commerce app"),
// CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("fakeuser@contoso.com"),
// LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// ComputeType: to.Ptr(armsearch.ComputeTypeDefault),
// DataExfiltrationProtections: []*armsearch.SearchDataExfiltrationProtection{
// },
// DisableLocalAuth: to.Ptr(true),
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"),
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](2),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// UpgradeAvailable: to.Ptr(armsearch.UpgradeAvailableNotAvailable),
// },
// SKU: &armsearch.SKU{
// Name: to.Ptr(armsearch.SKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceDisableLocalAuth.json
*/
async function searchUpdateServiceDisableLocalAuth() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
disableLocalAuth: true,
replicaCount: 2,
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceDisableLocalAuth.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(default)
{
ReplicaCount = 2,
IsLocalAuthDisabled = true,
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag"
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 2,
"partitionCount": 1,
"endpoint": "https://mysearchservice.search.windows.net/",
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"computeType": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": true,
"authOptions": null,
"dataExfiltrationProtections": [],
"upgradeAvailable": "notAvailable",
"serviceUpgradedAt": null
},
"systemData": {
"createdBy": "My e-commerce app",
"createdByType": "Application",
"createdAt": "2024-01-01T00:00:00Z",
"lastModifiedBy": "fakeuser@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-11-01T00:00:00Z"
}
}
SearchUpdateServiceToAllowAccessFromPrivateEndpoints
Pedido de amostra
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2025-05-01
{
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"publicNetworkAccess": "disabled"
}
}
import com.azure.resourcemanager.search.models.PublicNetworkAccess;
import com.azure.resourcemanager.search.models.SearchServiceUpdate;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services Update.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/
* SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json
*/
/**
* Sample code: SearchUpdateServiceToAllowAccessFromPrivateEndpoints.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
searchUpdateServiceToAllowAccessFromPrivateEndpoints(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().update("rg1", "mysearchservice",
new SearchServiceUpdate().withReplicaCount(1).withPartitionCount(1)
.withPublicNetworkAccess(PublicNetworkAccess.DISABLED),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_to_allow_access_from_private_endpoints.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={"properties": {"partitionCount": 1, "publicNetworkAccess": "disabled", "replicaCount": 1}},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fb3217991ff57b5760525aeba1a0670bfe0880fa/specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json
func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPrivateEndpoints() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
PartitionCount: to.Ptr[int32](1),
PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled),
ReplicaCount: to.Ptr[int32](1),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// SystemData: &armsearch.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("My e-commerce app"),
// CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("fakeuser@contoso.com"),
// LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// ComputeType: to.Ptr(armsearch.ComputeTypeDefault),
// DataExfiltrationProtections: []*armsearch.SearchDataExfiltrationProtection{
// },
// DisableLocalAuth: to.Ptr(false),
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"),
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled),
// ReplicaCount: to.Ptr[int32](1),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusRunning),
// StatusDetails: to.Ptr(""),
// UpgradeAvailable: to.Ptr(armsearch.UpgradeAvailableNotAvailable),
// },
// SKU: &armsearch.SKU{
// Name: to.Ptr(armsearch.SKUNameBasic),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json
*/
async function searchUpdateServiceToAllowAccessFromPrivateEndpoints() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
partitionCount: 1,
publicNetworkAccess: "disabled",
replicaCount: 1,
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(default)
{
ReplicaCount = 1,
PartitionCount = 1,
PublicInternetAccess = SearchServicePublicInternetAccess.Disabled,
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "basic"
},
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"endpoint": "https://mysearchservice.search.windows.net/",
"status": "running",
"statusDetails": "",
"hostingMode": "default",
"computeType": "default",
"provisioningState": "succeeded",
"publicNetworkAccess": "disabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"dataExfiltrationProtections": [],
"upgradeAvailable": "notAvailable",
"serviceUpgradedAt": null
},
"systemData": {
"createdBy": "My e-commerce app",
"createdByType": "Application",
"createdAt": "2024-01-01T00:00:00Z",
"lastModifiedBy": "fakeuser@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-11-01T00:00:00Z"
}
}
SearchUpdateServiceToAllowAccessFromPublicCustomIPs
Pedido de amostra
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2025-05-01
{
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [
{
"value": "123.4.5.6"
},
{
"value": "123.4.6.0/18"
}
]
}
}
}
import com.azure.resourcemanager.search.models.IpRule;
import com.azure.resourcemanager.search.models.NetworkRuleSet;
import com.azure.resourcemanager.search.models.PublicNetworkAccess;
import com.azure.resourcemanager.search.models.SearchServiceUpdate;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services Update.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/
* SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json
*/
/**
* Sample code: SearchUpdateServiceToAllowAccessFromPublicCustomIPs.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
searchUpdateServiceToAllowAccessFromPublicCustomIPs(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().update("rg1", "mysearchservice",
new SearchServiceUpdate().withReplicaCount(3).withPartitionCount(1)
.withPublicNetworkAccess(PublicNetworkAccess.ENABLED)
.withNetworkRuleSet(new NetworkRuleSet().withIpRules(
Arrays.asList(new IpRule().withValue("123.4.5.6"), new IpRule().withValue("123.4.6.0/18")))),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_to_allow_access_from_public_custom_ips.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {
"networkRuleSet": {"ipRules": [{"value": "123.4.5.6"}, {"value": "123.4.6.0/18"}]},
"partitionCount": 1,
"publicNetworkAccess": "enabled",
"replicaCount": 3,
}
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fb3217991ff57b5760525aeba1a0670bfe0880fa/specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json
func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCustomIPs() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
NetworkRuleSet: &armsearch.NetworkRuleSet{
IPRules: []*armsearch.IPRule{
{
Value: to.Ptr("123.4.5.6"),
},
{
Value: to.Ptr("123.4.6.0/18"),
}},
},
PartitionCount: to.Ptr[int32](1),
PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
ReplicaCount: to.Ptr[int32](3),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// SystemData: &armsearch.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("My e-commerce app"),
// CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("fakeuser@contoso.com"),
// LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// ComputeType: to.Ptr(armsearch.ComputeTypeDefault),
// DataExfiltrationProtections: []*armsearch.SearchDataExfiltrationProtection{
// },
// DisableLocalAuth: to.Ptr(false),
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"),
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// IPRules: []*armsearch.IPRule{
// {
// Value: to.Ptr("10.2.3.4"),
// }},
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](3),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusRunning),
// StatusDetails: to.Ptr(""),
// UpgradeAvailable: to.Ptr(armsearch.UpgradeAvailableNotAvailable),
// },
// SKU: &armsearch.SKU{
// Name: to.Ptr(armsearch.SKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json
*/
async function searchUpdateServiceToAllowAccessFromPublicCustomIPs() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
networkRuleSet: {
ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }],
},
partitionCount: 1,
publicNetworkAccess: "enabled",
replicaCount: 3,
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(default)
{
ReplicaCount = 3,
PartitionCount = 1,
PublicInternetAccess = SearchServicePublicInternetAccess.Enabled,
NetworkRuleSet = new SearchServiceNetworkRuleSet
{
IPRules = {new SearchServiceIPRule
{
Value = "123.4.5.6",
}, new SearchServiceIPRule
{
Value = "123.4.6.0/18",
}},
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"endpoint": "https://mysearchservice.search.windows.net/",
"status": "running",
"statusDetails": "",
"hostingMode": "default",
"computeType": "default",
"provisioningState": "succeeded",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [
{
"value": "10.2.3.4"
}
]
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"dataExfiltrationProtections": [],
"upgradeAvailable": "notAvailable",
"serviceUpgradedAt": null
},
"systemData": {
"createdBy": "My e-commerce app",
"createdByType": "Application",
"createdAt": "2024-01-01T00:00:00Z",
"lastModifiedBy": "fakeuser@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-11-01T00:00:00Z"
}
}
SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass
Pedido de amostra
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2025-05-01
{
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [
{
"value": "123.4.5.6"
},
{
"value": "123.4.6.0/18"
}
],
"bypass": "AzureServices"
}
}
}
import com.azure.resourcemanager.search.models.IpRule;
import com.azure.resourcemanager.search.models.NetworkRuleSet;
import com.azure.resourcemanager.search.models.PublicNetworkAccess;
import com.azure.resourcemanager.search.models.SearchBypass;
import com.azure.resourcemanager.search.models.SearchServiceUpdate;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services Update.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/
* SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json
*/
/**
* Sample code: SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().update("rg1", "mysearchservice",
new SearchServiceUpdate().withReplicaCount(3).withPartitionCount(1)
.withPublicNetworkAccess(PublicNetworkAccess.ENABLED)
.withNetworkRuleSet(new NetworkRuleSet()
.withIpRules(
Arrays.asList(new IpRule().withValue("123.4.5.6"), new IpRule().withValue("123.4.6.0/18")))
.withBypass(SearchBypass.AZURE_SERVICES)),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_to_allow_access_from_public_custom_ips_and_bypass.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {
"networkRuleSet": {
"bypass": "AzureServices",
"ipRules": [{"value": "123.4.5.6"}, {"value": "123.4.6.0/18"}],
},
"partitionCount": 1,
"publicNetworkAccess": "enabled",
"replicaCount": 3,
}
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fb3217991ff57b5760525aeba1a0670bfe0880fa/specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json
func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
NetworkRuleSet: &armsearch.NetworkRuleSet{
Bypass: to.Ptr(armsearch.SearchBypassAzureServices),
IPRules: []*armsearch.IPRule{
{
Value: to.Ptr("123.4.5.6"),
},
{
Value: to.Ptr("123.4.6.0/18"),
}},
},
PartitionCount: to.Ptr[int32](1),
PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
ReplicaCount: to.Ptr[int32](3),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// SystemData: &armsearch.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("My e-commerce app"),
// CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("fakeuser@contoso.com"),
// LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// ComputeType: to.Ptr(armsearch.ComputeTypeDefault),
// DataExfiltrationProtections: []*armsearch.SearchDataExfiltrationProtection{
// },
// DisableLocalAuth: to.Ptr(false),
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"),
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassAzureServices),
// IPRules: []*armsearch.IPRule{
// {
// Value: to.Ptr("10.2.3.4"),
// }},
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](3),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusRunning),
// StatusDetails: to.Ptr(""),
// UpgradeAvailable: to.Ptr(armsearch.UpgradeAvailableNotAvailable),
// },
// SKU: &armsearch.SKU{
// Name: to.Ptr(armsearch.SKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json
*/
async function searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
networkRuleSet: {
bypass: "AzureServices",
ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }],
},
partitionCount: 1,
publicNetworkAccess: "enabled",
replicaCount: 3,
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(default)
{
ReplicaCount = 3,
PartitionCount = 1,
PublicInternetAccess = SearchServicePublicInternetAccess.Enabled,
NetworkRuleSet = new SearchServiceNetworkRuleSet
{
IPRules = {new SearchServiceIPRule
{
Value = "123.4.5.6",
}, new SearchServiceIPRule
{
Value = "123.4.6.0/18",
}},
Bypass = SearchBypass.AzureServices,
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"endpoint": "https://mysearchservice.search.windows.net/",
"status": "running",
"statusDetails": "",
"hostingMode": "default",
"computeType": "default",
"provisioningState": "succeeded",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [
{
"value": "10.2.3.4"
}
],
"bypass": "AzureServices"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"dataExfiltrationProtections": [],
"upgradeAvailable": "notAvailable",
"serviceUpgradedAt": null
},
"systemData": {
"createdBy": "My e-commerce app",
"createdByType": "Application",
"createdAt": "2024-01-01T00:00:00Z",
"lastModifiedBy": "fakeuser@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-11-01T00:00:00Z"
}
}
SearchUpdateServiceToRemoveIdentity
Pedido de amostra
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2025-05-01
{
"sku": {
"name": "standard"
},
"identity": {
"type": "None"
}
}
import com.azure.resourcemanager.search.models.Identity;
import com.azure.resourcemanager.search.models.IdentityType;
import com.azure.resourcemanager.search.models.SearchServiceUpdate;
import com.azure.resourcemanager.search.models.Sku;
import com.azure.resourcemanager.search.models.SkuName;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services Update.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/
* SearchUpdateServiceToRemoveIdentity.json
*/
/**
* Sample code: SearchUpdateServiceToRemoveIdentity.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchUpdateServiceToRemoveIdentity(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().update("rg1", "mysearchservice",
new SearchServiceUpdate().withSku(new Sku().withName(SkuName.STANDARD))
.withIdentity(new Identity().withType(IdentityType.NONE)),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_to_remove_identity.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={"identity": {"type": "None"}, "sku": {"name": "standard"}},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToRemoveIdentity.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fb3217991ff57b5760525aeba1a0670bfe0880fa/specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToRemoveIdentity.json
func ExampleServicesClient_Update_searchUpdateServiceToRemoveIdentity() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Identity: &armsearch.Identity{
Type: to.Ptr(armsearch.IdentityTypeNone),
},
SKU: &armsearch.SKU{
Name: to.Ptr(armsearch.SKUNameStandard),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// SystemData: &armsearch.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("My e-commerce app"),
// CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("fakeuser@contoso.com"),
// LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// ComputeType: to.Ptr(armsearch.ComputeTypeDefault),
// DataExfiltrationProtections: []*armsearch.SearchDataExfiltrationProtection{
// },
// DisableLocalAuth: to.Ptr(false),
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"),
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](3),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusRunning),
// StatusDetails: to.Ptr(""),
// UpgradeAvailable: to.Ptr(armsearch.UpgradeAvailableNotAvailable),
// },
// SKU: &armsearch.SKU{
// Name: to.Ptr(armsearch.SKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToRemoveIdentity.json
*/
async function searchUpdateServiceToRemoveIdentity() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
identity: { type: "None" },
sku: { name: "standard" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToRemoveIdentity.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(default)
{
SearchSkuName = SearchServiceSkuName.Standard,
Identity = new ManagedServiceIdentity("None"),
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"endpoint": "https://mysearchservice.search.windows.net/",
"status": "running",
"statusDetails": "",
"hostingMode": "default",
"computeType": "default",
"provisioningState": "succeeded",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"dataExfiltrationProtections": [],
"upgradeAvailable": "notAvailable",
"serviceUpgradedAt": null
},
"systemData": {
"createdBy": "My e-commerce app",
"createdByType": "Application",
"createdAt": "2024-01-01T00:00:00Z",
"lastModifiedBy": "fakeuser@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-11-01T00:00:00Z"
}
}
SearchUpdateServiceWithCmkEnforcement
Pedido de amostra
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2025-05-01
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"properties": {
"replicaCount": 2,
"encryptionWithCmk": {
"enforcement": "Enabled"
}
}
}
import com.azure.resourcemanager.search.models.EncryptionWithCmk;
import com.azure.resourcemanager.search.models.SearchEncryptionWithCmk;
import com.azure.resourcemanager.search.models.SearchServiceUpdate;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services Update.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/
* SearchUpdateServiceWithCmkEnforcement.json
*/
/**
* Sample code: SearchUpdateServiceWithCmkEnforcement.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchUpdateServiceWithCmkEnforcement(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().update("rg1", "mysearchservice",
new SearchServiceUpdate().withTags(mapOf("app-name", "My e-commerce app", "new-tag", "Adding a new tag"))
.withReplicaCount(2)
.withEncryptionWithCmk(new EncryptionWithCmk().withEnforcement(SearchEncryptionWithCmk.ENABLED)),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_with_cmk_enforcement.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {"encryptionWithCmk": {"enforcement": "Enabled"}, "replicaCount": 2},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithCmkEnforcement.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fb3217991ff57b5760525aeba1a0670bfe0880fa/specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithCmkEnforcement.json
func ExampleServicesClient_Update_searchUpdateServiceWithCmkEnforcement() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
EncryptionWithCmk: &armsearch.EncryptionWithCmk{
Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled),
},
ReplicaCount: to.Ptr[int32](2),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// SystemData: &armsearch.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("My e-commerce app"),
// CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("fakeuser@contoso.com"),
// LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// ComputeType: to.Ptr(armsearch.ComputeTypeDefault),
// DataExfiltrationProtections: []*armsearch.SearchDataExfiltrationProtection{
// },
// DisableLocalAuth: to.Ptr(false),
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled),
// },
// Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"),
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](2),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// UpgradeAvailable: to.Ptr(armsearch.UpgradeAvailableNotAvailable),
// },
// SKU: &armsearch.SKU{
// Name: to.Ptr(armsearch.SKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithCmkEnforcement.json
*/
async function searchUpdateServiceWithCmkEnforcement() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
encryptionWithCmk: { enforcement: "Enabled" },
replicaCount: 2,
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithCmkEnforcement.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(default)
{
ReplicaCount = 2,
EncryptionWithCmk = new SearchEncryptionWithCmk
{
Enforcement = SearchEncryptionWithCmkEnforcement.Enabled,
},
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag"
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 2,
"partitionCount": 1,
"endpoint": "https://mysearchservice.search.windows.net/",
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"computeType": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Enabled",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"dataExfiltrationProtections": [],
"upgradeAvailable": "notAvailable",
"serviceUpgradedAt": null
},
"systemData": {
"createdBy": "My e-commerce app",
"createdByType": "Application",
"createdAt": "2024-01-01T00:00:00Z",
"lastModifiedBy": "fakeuser@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-11-01T00:00:00Z"
}
}
SearchUpdateServiceWithDataExfiltration
Pedido de amostra
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2025-05-01
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"properties": {
"replicaCount": 2,
"dataExfiltrationProtections": [
"BlockAll"
]
}
}
import com.azure.resourcemanager.search.models.SearchDataExfiltrationProtection;
import com.azure.resourcemanager.search.models.SearchServiceUpdate;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services Update.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/
* SearchUpdateServiceWithDataExfiltration.json
*/
/**
* Sample code: SearchUpdateServiceWithDataExfiltration.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchUpdateServiceWithDataExfiltration(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().update("rg1", "mysearchservice",
new SearchServiceUpdate().withTags(mapOf("app-name", "My e-commerce app", "new-tag", "Adding a new tag"))
.withReplicaCount(2).withDataExfiltrationProtections(
Arrays.asList(SearchDataExfiltrationProtection.BLOCK_ALL)),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_with_data_exfiltration.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {"dataExfiltrationProtections": ["BlockAll"], "replicaCount": 2},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithDataExfiltration.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fb3217991ff57b5760525aeba1a0670bfe0880fa/specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithDataExfiltration.json
func ExampleServicesClient_Update_searchUpdateServiceWithDataExfiltration() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
DataExfiltrationProtections: []*armsearch.SearchDataExfiltrationProtection{
to.Ptr(armsearch.SearchDataExfiltrationProtectionBlockAll)},
ReplicaCount: to.Ptr[int32](2),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// SystemData: &armsearch.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("My e-commerce app"),
// CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("fakeuser@contoso.com"),
// LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// ComputeType: to.Ptr(armsearch.ComputeTypeDefault),
// DataExfiltrationProtections: []*armsearch.SearchDataExfiltrationProtection{
// to.Ptr(armsearch.SearchDataExfiltrationProtectionBlockAll)},
// DisableLocalAuth: to.Ptr(false),
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"),
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](2),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// UpgradeAvailable: to.Ptr(armsearch.UpgradeAvailableNotAvailable),
// },
// SKU: &armsearch.SKU{
// Name: to.Ptr(armsearch.SKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithDataExfiltration.json
*/
async function searchUpdateServiceWithDataExfiltration() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
dataExfiltrationProtections: ["BlockAll"],
replicaCount: 2,
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithDataExfiltration.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(default)
{
ReplicaCount = 2,
DataExfiltrationProtections = { SearchDataExfiltrationProtection.BlockAll },
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag"
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 2,
"partitionCount": 1,
"endpoint": "https://mysearchservice.search.windows.net/",
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"computeType": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"dataExfiltrationProtections": [
"BlockAll"
],
"upgradeAvailable": "notAvailable",
"serviceUpgradedAt": null
},
"systemData": {
"createdBy": "My e-commerce app",
"createdByType": "Application",
"createdAt": "2024-01-01T00:00:00Z",
"lastModifiedBy": "fakeuser@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-11-01T00:00:00Z"
}
}
SearchUpdateServiceWithSemanticSearch
Pedido de amostra
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2025-05-01
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"properties": {
"replicaCount": 2,
"semanticSearch": "standard"
}
}
import com.azure.resourcemanager.search.models.SearchSemanticSearch;
import com.azure.resourcemanager.search.models.SearchServiceUpdate;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services Update.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/
* SearchUpdateServiceWithSemanticSearch.json
*/
/**
* Sample code: SearchUpdateServiceWithSemanticSearch.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchUpdateServiceWithSemanticSearch(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().update("rg1", "mysearchservice",
new SearchServiceUpdate().withTags(mapOf("app-name", "My e-commerce app", "new-tag", "Adding a new tag"))
.withReplicaCount(2).withSemanticSearch(SearchSemanticSearch.STANDARD),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_with_semantic_search.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {"replicaCount": 2, "semanticSearch": "standard"},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithSemanticSearch.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fb3217991ff57b5760525aeba1a0670bfe0880fa/specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithSemanticSearch.json
func ExampleServicesClient_Update_searchUpdateServiceWithSemanticSearch() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
ReplicaCount: to.Ptr[int32](2),
SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchStandard),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// SystemData: &armsearch.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("My e-commerce app"),
// CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("fakeuser@contoso.com"),
// LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// ComputeType: to.Ptr(armsearch.ComputeTypeDefault),
// DataExfiltrationProtections: []*armsearch.SearchDataExfiltrationProtection{
// },
// DisableLocalAuth: to.Ptr(false),
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"),
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](2),
// SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchStandard),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// UpgradeAvailable: to.Ptr(armsearch.UpgradeAvailableNotAvailable),
// },
// SKU: &armsearch.SKU{
// Name: to.Ptr(armsearch.SKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithSemanticSearch.json
*/
async function searchUpdateServiceWithSemanticSearch() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
replicaCount: 2,
semanticSearch: "standard",
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithSemanticSearch.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(default)
{
ReplicaCount = 2,
SemanticSearch = SearchSemanticSearch.Standard,
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag"
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 2,
"partitionCount": 1,
"endpoint": "https://mysearchservice.search.windows.net/",
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"computeType": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"dataExfiltrationProtections": [],
"semanticSearch": "standard",
"upgradeAvailable": "notAvailable",
"serviceUpgradedAt": null
},
"systemData": {
"createdBy": "My e-commerce app",
"createdByType": "Application",
"createdAt": "2024-01-01T00:00:00Z",
"lastModifiedBy": "fakeuser@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-11-01T00:00:00Z"
}
}
SearchUpdateServiceWithSku
Pedido de amostra
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2025-05-01
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard2"
}
}
import com.azure.resourcemanager.search.models.SearchServiceUpdate;
import com.azure.resourcemanager.search.models.Sku;
import com.azure.resourcemanager.search.models.SkuName;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithSku.json
*/
/**
* Sample code: SearchUpdateServiceWithSku.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchUpdateServiceWithSku(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().update("rg1", "mysearchservice",
new SearchServiceUpdate().withSku(new Sku().withName(SkuName.STANDARD2))
.withTags(mapOf("app-name", "My e-commerce app", "new-tag", "Adding a new tag")),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_with_sku.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"sku": {"name": "standard2"},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithSku.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fb3217991ff57b5760525aeba1a0670bfe0880fa/specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithSku.json
func ExampleServicesClient_Update_searchUpdateServiceWithSku() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
SKU: &armsearch.SKU{
Name: to.Ptr(armsearch.SKUNameStandard2),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// SystemData: &armsearch.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("My e-commerce app"),
// CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("fakeuser@contoso.com"),
// LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// ComputeType: to.Ptr(armsearch.ComputeTypeDefault),
// DataExfiltrationProtections: []*armsearch.SearchDataExfiltrationProtection{
// },
// DisableLocalAuth: to.Ptr(false),
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](1),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// UpgradeAvailable: to.Ptr(armsearch.UpgradeAvailableNotAvailable),
// },
// SKU: &armsearch.SKU{
// Name: to.Ptr(armsearch.SKUNameStandard2),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithSku.json
*/
async function searchUpdateServiceWithSku() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
sku: { name: "standard2" },
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithSku.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(default)
{
SearchSkuName = SearchServiceSkuName.Standard2,
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag"
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard2"
},
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"computeType": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"dataExfiltrationProtections": [],
"upgradeAvailable": "notAvailable",
"serviceUpgradedAt": null
},
"systemData": {
"createdBy": "My e-commerce app",
"createdByType": "Application",
"createdAt": "2024-01-01T00:00:00Z",
"lastModifiedBy": "fakeuser@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-11-01T00:00:00Z"
}
}
Definições
| Name |
Description |
|
AadAuthFailureMode
|
Descreve qual resposta a API do plano de dados de um serviço de pesquisa enviaria para solicitações que falharam na autenticação.
|
|
ApiKeyOnly
|
Indica que apenas a chave da API pode ser usada para autenticação.
|
|
CloudError
|
Contém informações sobre um erro de API.
|
|
CloudErrorBody
|
Descreve um erro de API específico com um código de erro e uma mensagem.
|
|
ComputeType
|
Configure essa propriedade para dar suporte ao serviço de pesquisa usando a Computação Padrão ou a Computação Confidencial do Azure.
|
|
createdByType
|
O tipo de identidade que criou o recurso.
|
|
DataPlaneAadOrApiKeyAuthOption
|
Indica que a chave de API ou um token de acesso de um locatário do Microsoft Entra ID pode ser usado para autenticação.
|
|
DataPlaneAuthOptions
|
Define as opções de como o serviço de pesquisa autentica uma solicitação de plano de dados. Isso não pode ser definido se 'disableLocalAuth' estiver definido como true.
|
|
EncryptionWithCmk
|
Descreve uma política que determina como os recursos dentro do serviço de pesquisa devem ser criptografados com chaves gerenciadas pelo cliente.
|
|
HostingMode
|
Aplicável apenas para o padrão 3 SKU. Você pode definir essa propriedade para habilitar até 3 partições de alta densidade que permitem até 1000 índices, o que é muito maior do que os índices máximos permitidos para qualquer outra SKU. Para o SKU standard3, o valor é 'default' ou 'highDensity'. Para todos os outros SKUs, esse valor deve ser 'padrão'.
|
|
Identity
|
Detalhes sobre a identidade do serviço de pesquisa. Um valor nulo indica que o serviço de pesquisa não tem nenhuma identidade atribuída.
|
|
IdentityType
|
O tipo de identidade usado para o recurso. O tipo 'SystemAssigned, UserAssigned' inclui uma identidade criada pelo sistema e um conjunto de identidades atribuídas pelo usuário. O tipo 'Nenhum' removerá todas as identidades do serviço.
|
|
IpRule
|
A regra de restrição de IP do serviço Azure AI Search.
|
|
NetworkRuleSet
|
Regras específicas de rede que determinam como o serviço Azure AI Search pode ser alcançado.
|
|
PrivateEndpoint
|
O recurso de ponto de extremidade privado do provedor Microsoft.Network.
|
|
PrivateEndpointConnection
|
Descreve uma conexão de ponto de extremidade privada existente com o serviço Azure AI Search.
|
|
PrivateEndpointConnectionProperties
|
Descreve as propriedades de uma conexão de ponto de extremidade privado existente com o serviço de pesquisa.
|
|
PrivateLinkServiceConnectionProvisioningState
|
O estado de provisionamento da conexão de serviço de link privado. Os valores válidos são Atualizar, Excluir, Falhar, Ter êxito, Incompleto ou Cancelado.
|
|
PrivateLinkServiceConnectionState
|
Descreve o estado atual de uma conexão de serviço de Link Privado do Azure existente com o ponto de extremidade privado.
|
|
PrivateLinkServiceConnectionStatus
|
Status da conexão do serviço de link privado. Os valores válidos são Pendente, Aprovado, Rejeitado ou Desconectado.
|
|
ProvisioningState
|
O estado da última operação de provisionamento executada no serviço de pesquisa. O provisionamento é um estado intermediário que ocorre enquanto a capacidade de serviço está sendo estabelecida. Depois que a capacidade é configurada, provisioningState muda para 'Succeeded' ou 'Failed'. Os aplicativos cliente podem sondar o status de provisionamento (o intervalo de sondagem recomendado é de 30 segundos a um minuto) usando a operação Obter Serviço de Pesquisa para ver quando uma operação é concluída. Se você estiver usando o serviço gratuito, esse valor tende a voltar como 'Bem-sucedido' diretamente na chamada para Criar serviço de pesquisa. Isso ocorre porque o serviço gratuito usa a capacidade que já está configurada.
|
|
PublicNetworkAccess
|
Esse valor pode ser definido como 'habilitado' para evitar alterações significativas nos recursos e modelos existentes do cliente. Se definido como 'desativado', o tráfego na interface pública não é permitido, e as conexões de ponto final privado seriam o método de acesso exclusivo.
|
|
SearchBypass
|
Possíveis origens do tráfego de entrada que pode ignorar as regras definidas na seção 'ipRules'.
|
|
SearchDataExfiltrationProtection
|
Uma lista de cenários de exfiltração de dados que não são explicitamente permitidos para o serviço de pesquisa. Atualmente, o único valor suportado é 'Todos' para desativar todos os cenários possíveis de exportação de dados com controles mais refinados planejados para o futuro.
|
|
SearchEncryptionComplianceStatus
|
Retorna o status de conformidade do serviço de pesquisa em relação a objetos não criptografados por CMK. Se um serviço tiver mais de um objeto não criptografado e a imposição estiver habilitada, o serviço será marcado como não compatível.
|
|
SearchEncryptionWithCmk
|
Descreve como um serviço de pesquisa deve impor a conformidade se encontrar objetos que não são criptografados com a chave gerenciada pelo cliente.
|
|
SearchSemanticSearch
|
Define opções que controlam a disponibilidade da pesquisa semântica. Essa configuração só é possível para determinadas SKUs do Azure AI Search em determinados locais.
|
|
SearchService
|
Descreve um serviço Azure AI Search e seu estado atual.
|
|
SearchServiceStatus
|
O status do serviço de pesquisa. Os valores possíveis incluem: 'em execução': O serviço de pesquisa está em execução e nenhuma operação de provisionamento está em andamento. 'provisionamento': o serviço de pesquisa está sendo provisionado ou ampliado para cima ou para baixo. «Eliminação»: O serviço de pesquisa está a ser eliminado. 'degradado': O serviço de pesquisa está degradado. Isso pode ocorrer quando as unidades de pesquisa subjacentes não estão íntegras. O serviço de pesquisa provavelmente está operacional, mas o desempenho pode ser lento e algumas solicitações podem ser descartadas. 'desativado': O serviço de pesquisa está desativado. Nesse estado, o serviço rejeitará todas as solicitações de API. 'erro': O serviço de pesquisa está em um estado de erro. 'interrompido': o serviço de pesquisa está em uma assinatura desativada. Se o seu serviço estiver nos estados degradado, desativado ou de erro, isso significa que a equipe do Azure AI Search está investigando ativamente o problema subjacente. Os serviços dedicados nesses estados ainda são cobrados com base no número de unidades de pesquisa provisionadas.
|
|
SearchServiceUpdate
|
Os parâmetros usados para atualizar um serviço Azure AI Search.
|
|
SharedPrivateLinkResource
|
Descreve um recurso de link privado compartilhado gerenciado pelo serviço Azure AI Search.
|
|
SharedPrivateLinkResourceProperties
|
Descreve as propriedades de um recurso de link privado compartilhado existente gerenciado pelo serviço Azure AI Search.
|
|
SharedPrivateLinkResourceProvisioningState
|
O estado de provisionamento do recurso de link privado compartilhado. Os valores válidos são Atualizar, Excluir, Falhar, Ter êxito ou Incompleto.
|
|
SharedPrivateLinkResourceStatus
|
Status do recurso de link privado compartilhado. Os valores válidos são Pendente, Aprovado, Rejeitado ou Desconectado.
|
|
Sku
|
Define a SKU de um serviço de pesquisa, que determina a taxa de faturamento e os limites de capacidade.
|
|
SkuName
|
O SKU do serviço de pesquisa. Os valores válidos incluem: 'grátis': Serviço compartilhado. 'básico': Serviço dedicado com até 3 réplicas. 'standard': Serviço dedicado com até 12 partições e 12 réplicas. 'standard2': Semelhante ao padrão, mas com mais capacidade por unidade de pesquisa. 'standard3': A maior oferta Standard com até 12 partições e 12 réplicas (ou até 3 partições com mais índices se você também definir a propriedade hostingMode como 'highDensity'). 'storage_optimized_l1': Suporta 1TB por partição, até 12 partições. 'storage_optimized_l2': Suporta 2TB por partição, até 12 partições.'
|
|
systemData
|
Metadados referentes à criação e última modificação do recurso.
|
|
UpgradeAvailable
|
Indica se o serviço de pesquisa tem uma atualização disponível.
|
|
UserAssignedIdentity
|
Propriedades de identidade atribuídas pelo usuário
|
AadAuthFailureMode
Enumeração
Descreve qual resposta a API do plano de dados de um serviço de pesquisa enviaria para solicitações que falharam na autenticação.
| Valor |
Description |
|
http403
|
Indica que as solicitações que falharam na autenticação devem ser apresentadas com um código de status HTTP de 403 (Proibido).
|
|
http401WithBearerChallenge
|
Indica que as solicitações que falharam na autenticação devem ser apresentadas com um código de status HTTP de 401 (Não autorizado) e apresentar um Desafio ao Portador.
|
ApiKeyOnly
Object
Indica que apenas a chave da API pode ser usada para autenticação.
CloudError
Object
Contém informações sobre um erro de API.
| Name |
Tipo |
Description |
|
error
|
CloudErrorBody
|
Descreve um erro de API específico com um código de erro e uma mensagem.
|
|
message
|
string
|
Uma breve descrição do erro que sugere o que deu errado (para obter detalhes/informações de depuração, consulte a propriedade 'error.message').
|
CloudErrorBody
Object
Descreve um erro de API específico com um código de erro e uma mensagem.
| Name |
Tipo |
Description |
|
code
|
string
|
Um código de erro que descreve a condição de erro com mais precisão do que um código de status HTTP. Pode ser usado para lidar programaticamente com casos de erro específicos.
|
|
details
|
CloudErrorBody[]
|
Contém erros aninhados relacionados a esse erro.
|
|
message
|
string
|
Uma mensagem que descreve o erro em detalhes e fornece informações de depuração.
|
|
target
|
string
|
O destino do erro específico (por exemplo, o nome da propriedade em erro).
|
ComputeType
Enumeração
Configure essa propriedade para dar suporte ao serviço de pesquisa usando a Computação Padrão ou a Computação Confidencial do Azure.
| Valor |
Description |
|
default
|
Crie o serviço com a computação padrão.
|
|
confidential
|
Crie o serviço com a Computação Confidencial do Azure.
|
createdByType
Enumeração
O tipo de identidade que criou o recurso.
| Valor |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
DataPlaneAadOrApiKeyAuthOption
Object
Indica que a chave de API ou um token de acesso de um locatário do Microsoft Entra ID pode ser usado para autenticação.
| Name |
Tipo |
Description |
|
aadAuthFailureMode
|
AadAuthFailureMode
|
Descreve qual resposta a API do plano de dados de um serviço de pesquisa enviaria para solicitações que falharam na autenticação.
|
DataPlaneAuthOptions
Object
Define as opções de como o serviço de pesquisa autentica uma solicitação de plano de dados. Isso não pode ser definido se 'disableLocalAuth' estiver definido como true.
| Name |
Tipo |
Description |
|
aadOrApiKey
|
DataPlaneAadOrApiKeyAuthOption
|
Indica que a chave de API ou um token de acesso de um locatário do Microsoft Entra ID pode ser usado para autenticação.
|
|
apiKeyOnly
|
ApiKeyOnly
|
Indica que apenas a chave da API pode ser usada para autenticação.
|
EncryptionWithCmk
Object
Descreve uma política que determina como os recursos dentro do serviço de pesquisa devem ser criptografados com chaves gerenciadas pelo cliente.
| Name |
Tipo |
Description |
|
encryptionComplianceStatus
|
SearchEncryptionComplianceStatus
|
Retorna o status de conformidade do serviço de pesquisa em relação a objetos não criptografados por CMK. Se um serviço tiver mais de um objeto não criptografado e a imposição estiver habilitada, o serviço será marcado como não compatível.
|
|
enforcement
|
SearchEncryptionWithCmk
|
Descreve como um serviço de pesquisa deve impor a conformidade se encontrar objetos que não são criptografados com a chave gerenciada pelo cliente.
|
HostingMode
Enumeração
Aplicável apenas para o padrão 3 SKU. Você pode definir essa propriedade para habilitar até 3 partições de alta densidade que permitem até 1000 índices, o que é muito maior do que os índices máximos permitidos para qualquer outra SKU. Para o SKU standard3, o valor é 'default' ou 'highDensity'. Para todos os outros SKUs, esse valor deve ser 'padrão'.
| Valor |
Description |
|
default
|
O limite do número de índices é determinado pelos limites padrão para a SKU.
|
|
highDensity
|
Aplicação única para SKU standard3, onde o serviço de pesquisa pode ter até 1000 índices.
|
Identity
Object
Detalhes sobre a identidade do serviço de pesquisa. Um valor nulo indica que o serviço de pesquisa não tem nenhuma identidade atribuída.
| Name |
Tipo |
Description |
|
principalId
|
string
|
O ID principal da identidade atribuída pelo sistema do serviço de pesquisa.
|
|
tenantId
|
string
|
O ID do locatário da identidade atribuída pelo sistema do serviço de pesquisa.
|
|
type
|
IdentityType
|
O tipo de identidade usado para o recurso. O tipo 'SystemAssigned, UserAssigned' inclui uma identidade criada pelo sistema e um conjunto de identidades atribuídas pelo usuário. O tipo 'Nenhum' removerá todas as identidades do serviço.
|
|
userAssignedIdentities
|
<string,
UserAssignedIdentity>
|
A lista de identidades de usuário associadas ao recurso. As referências de chave do dicionário de identidade do usuário serão IDs de recursos ARM no formato: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
|
IdentityType
Enumeração
O tipo de identidade usado para o recurso. O tipo 'SystemAssigned, UserAssigned' inclui uma identidade criada pelo sistema e um conjunto de identidades atribuídas pelo usuário. O tipo 'Nenhum' removerá todas as identidades do serviço.
| Valor |
Description |
|
None
|
Indica que qualquer identidade associada ao serviço de pesquisa precisa ser removida.
|
|
SystemAssigned
|
Indica que a identidade atribuída pelo sistema para o serviço de pesquisa será habilitada.
|
|
UserAssigned
|
Indica que uma ou mais identidades atribuídas ao usuário serão atribuídas ao serviço de pesquisa.
|
|
SystemAssigned, UserAssigned
|
Indica que a identidade atribuída pelo sistema para o serviço de pesquisa será habilitada juntamente com a atribuição de uma ou mais identidades atribuídas ao usuário.
|
IpRule
Object
A regra de restrição de IP do serviço Azure AI Search.
| Name |
Tipo |
Description |
|
value
|
string
|
Valor correspondente a um único endereço IPv4 (por exemplo, 123.1.2.3) ou um intervalo de IP em formato CIDR (por exemplo, 123.1.2.3/24) a ser permitido.
|
NetworkRuleSet
Object
Regras específicas de rede que determinam como o serviço Azure AI Search pode ser alcançado.
| Name |
Tipo |
Description |
|
bypass
|
SearchBypass
|
Possíveis origens do tráfego de entrada que pode ignorar as regras definidas na seção 'ipRules'.
|
|
ipRules
|
IpRule[]
|
Uma lista de regras de restrição de IP que define a(s) rede(s) de entrada com permissão de acesso ao ponto de extremidade do serviço de pesquisa. Enquanto isso, todas as outras redes IP públicas são bloqueadas pelo firewall. Estas regras de restrição são aplicadas apenas quando o «acesso públicoà rede» do serviço de pesquisa está «ativado»; caso contrário, o tráfego na interface pública não é permitido, mesmo com quaisquer regras de IP públicas, e as conexões de ponto final privadas seriam o método de acesso exclusivo.
|
PrivateEndpoint
Object
O recurso de ponto de extremidade privado do provedor Microsoft.Network.
| Name |
Tipo |
Description |
|
id
|
string
|
A ID do recurso de ponto de extremidade privado do provedor Microsoft.Network.
|
PrivateEndpointConnection
Object
Descreve uma conexão de ponto de extremidade privada existente com o serviço Azure AI Search.
| Name |
Tipo |
Description |
|
id
|
string
(arm-id)
|
ID de recurso totalmente qualificado para o recurso. Por exemplo, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
name
|
string
|
O nome do recurso
|
|
properties
|
PrivateEndpointConnectionProperties
|
Descreve as propriedades de uma conexão de ponto de extremidade privada existente com o serviço Azure AI Search.
|
|
systemData
|
systemData
|
Metadados do Azure Resource Manager contendo informações createdBy e modifiedBy.
|
|
type
|
string
|
O tipo do recurso. Por exemplo, "Microsoft.Compute/virtualMachines" ou "Microsoft.Storage/storageAccounts"
|
PrivateEndpointConnectionProperties
Object
Descreve as propriedades de uma conexão de ponto de extremidade privado existente com o serviço de pesquisa.
| Name |
Tipo |
Description |
|
groupId
|
string
|
A ID de grupo do recurso do Azure para o qual o serviço de link privado é destinado.
|
|
privateEndpoint
|
PrivateEndpoint
|
O recurso de ponto de extremidade privado do provedor Microsoft.Network.
|
|
privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
Descreve o estado atual de uma conexão de serviço de Link Privado do Azure existente com o ponto de extremidade privado.
|
|
provisioningState
|
PrivateLinkServiceConnectionProvisioningState
|
O estado de provisionamento da conexão de serviço de link privado. Os valores válidos são Atualizar, Excluir, Falhar, Ter êxito, Incompleto ou Cancelado.
|
PrivateLinkServiceConnectionProvisioningState
Enumeração
O estado de provisionamento da conexão de serviço de link privado. Os valores válidos são Atualizar, Excluir, Falhar, Ter êxito, Incompleto ou Cancelado.
| Valor |
Description |
|
Updating
|
A conexão do serviço de link privado está em processo de criação junto com outros recursos para que seja totalmente funcional.
|
|
Deleting
|
A conexão do serviço de link privado está em processo de exclusão.
|
|
Failed
|
A conexão do serviço de link privado não pôde ser provisionada ou excluída.
|
|
Succeeded
|
A conexão de serviço de link privado concluiu o provisionamento e está pronta para aprovação.
|
|
Incomplete
|
A solicitação de provisionamento para o recurso de conexão do serviço de link privado foi aceita, mas o processo de criação ainda não começou.
|
|
Canceled
|
A solicitação de provisionamento para o recurso de conexão do serviço de link privado foi cancelada.
|
PrivateLinkServiceConnectionState
Object
Descreve o estado atual de uma conexão de serviço de Link Privado do Azure existente com o ponto de extremidade privado.
| Name |
Tipo |
Default value |
Description |
|
actionsRequired
|
string
|
None
|
Uma descrição de quaisquer ações adicionais que possam ser necessárias.
|
|
description
|
string
|
|
A descrição do estado de conexão do serviço de link privado.
|
|
status
|
PrivateLinkServiceConnectionStatus
|
|
Status da conexão do serviço de link privado. Os valores válidos são Pendente, Aprovado, Rejeitado ou Desconectado.
|
PrivateLinkServiceConnectionStatus
Enumeração
Status da conexão do serviço de link privado. Os valores válidos são Pendente, Aprovado, Rejeitado ou Desconectado.
| Valor |
Description |
|
Pending
|
A conexão de ponto de extremidade privado foi criada e está pendente de aprovação.
|
|
Approved
|
A conexão de ponto de extremidade privada foi aprovada e está pronta para uso.
|
|
Rejected
|
A conexão de ponto de extremidade privada foi rejeitada e não pode ser usada.
|
|
Disconnected
|
A conexão de ponto de extremidade privado foi removida do serviço.
|
ProvisioningState
Enumeração
O estado da última operação de provisionamento executada no serviço de pesquisa. O provisionamento é um estado intermediário que ocorre enquanto a capacidade de serviço está sendo estabelecida. Depois que a capacidade é configurada, provisioningState muda para 'Succeeded' ou 'Failed'. Os aplicativos cliente podem sondar o status de provisionamento (o intervalo de sondagem recomendado é de 30 segundos a um minuto) usando a operação Obter Serviço de Pesquisa para ver quando uma operação é concluída. Se você estiver usando o serviço gratuito, esse valor tende a voltar como 'Bem-sucedido' diretamente na chamada para Criar serviço de pesquisa. Isso ocorre porque o serviço gratuito usa a capacidade que já está configurada.
| Valor |
Description |
|
succeeded
|
A última operação de provisionamento foi concluída com êxito.
|
|
provisioning
|
O serviço de pesquisa está sendo provisionado ou dimensionado para cima ou para baixo.
|
|
failed
|
A última operação de provisionamento falhou.
|
PublicNetworkAccess
Enumeração
Esse valor pode ser definido como 'habilitado' para evitar alterações significativas nos recursos e modelos existentes do cliente. Se definido como 'desativado', o tráfego na interface pública não é permitido, e as conexões de ponto final privado seriam o método de acesso exclusivo.
| Valor |
Description |
|
enabled
|
O serviço de pesquisa é acessível a partir do tráfego proveniente da Internet pública.
|
|
disabled
|
O serviço de pesquisa não é acessível a partir do tráfego proveniente da Internet pública. O acesso só é permitido em conexões de ponto final privadas aprovadas.
|
SearchBypass
Enumeração
Possíveis origens do tráfego de entrada que pode ignorar as regras definidas na seção 'ipRules'.
| Valor |
Description |
|
None
|
Indica que nenhuma origem pode ignorar as regras definidas na seção 'ipRules'. Este é o padrão.
|
|
AzureServices
|
Indica que as solicitações originadas dos serviços confiáveis do Azure podem ignorar as regras definidas na seção 'ipRules'.
|
SearchDataExfiltrationProtection
Enumeração
Uma lista de cenários de exfiltração de dados que não são explicitamente permitidos para o serviço de pesquisa. Atualmente, o único valor suportado é 'Todos' para desativar todos os cenários possíveis de exportação de dados com controles mais refinados planejados para o futuro.
| Valor |
Description |
|
BlockAll
|
Indica que todos os cenários de exfiltração de dados estão desativados.
|
SearchEncryptionComplianceStatus
Enumeração
Retorna o status de conformidade do serviço de pesquisa em relação a objetos não criptografados por CMK. Se um serviço tiver mais de um objeto não criptografado e a imposição estiver habilitada, o serviço será marcado como não compatível.
| Valor |
Description |
|
Compliant
|
Indica que o serviço de pesquisa é compatível, seja porque o número de objetos não criptografados por CMK é zero ou a imposição está desabilitada.
|
|
NonCompliant
|
Indica que o serviço de pesquisa tem mais de um objeto não criptografado por CMK.
|
SearchEncryptionWithCmk
Enumeração
Descreve como um serviço de pesquisa deve impor a conformidade se encontrar objetos que não são criptografados com a chave gerenciada pelo cliente.
| Valor |
Description |
|
Disabled
|
Nenhuma imposição de criptografia de chave gerenciada pelo cliente será feita. Somente a criptografia interna gerenciada por serviço é usada.
|
|
Enabled
|
O serviço de pesquisa será marcado como não compatível se um ou mais objetos não forem criptografados com uma chave gerenciada pelo cliente.
|
|
Unspecified
|
A política de imposição não é especificada explicitamente, com o comportamento sendo o mesmo como se estivesse definido como 'Desativado'.
|
SearchSemanticSearch
Enumeração
Define opções que controlam a disponibilidade da pesquisa semântica. Essa configuração só é possível para determinadas SKUs do Azure AI Search em determinados locais.
| Valor |
Description |
|
disabled
|
Indica que o reranker semântico está desabilitado para o serviço de pesquisa. Este é o padrão.
|
|
free
|
Habilita o reranker semântico em um serviço de pesquisa e indica que ele deve ser usado dentro dos limites do plano gratuito. O plano gratuito limitaria o volume de solicitações de classificação semântica e é oferecido sem custo extra. Este é o padrão para serviços de pesquisa recém-provisionados.
|
|
standard
|
Permite o reranker semântico em um serviço de pesquisa como um recurso faturável, com maior taxa de transferência e volume de consultas semanticamente reclassificadas.
|
SearchService
Object
Descreve um serviço Azure AI Search e seu estado atual.
| Name |
Tipo |
Default value |
Description |
|
id
|
string
(arm-id)
|
|
ID de recurso totalmente qualificado para o recurso. Por exemplo, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
identity
|
Identity
|
|
A identidade do recurso.
|
|
location
|
string
|
|
A geolocalização onde o recurso vive
|
|
name
|
string
|
|
O nome do recurso
|
|
properties.authOptions
|
DataPlaneAuthOptions
|
|
Define as opções de como a API do plano de dados de um serviço de pesquisa autentica solicitações. Isso não pode ser definido se 'disableLocalAuth' estiver definido como true.
|
|
properties.computeType
|
ComputeType
|
|
Configure essa propriedade para dar suporte ao serviço de pesquisa usando a Computação Padrão ou a Computação Confidencial do Azure.
|
|
properties.dataExfiltrationProtections
|
SearchDataExfiltrationProtection[]
|
|
Uma lista de cenários de exfiltração de dados que não são explicitamente permitidos para o serviço de pesquisa. Atualmente, o único valor suportado é 'Todos' para desativar todos os cenários possíveis de exportação de dados com controles mais refinados planejados para o futuro.
|
|
properties.disableLocalAuth
|
boolean
|
|
Quando definido como true, as chamadas para o serviço de pesquisa não terão permissão para utilizar chaves de API para autenticação. Isso não pode ser definido como true se 'dataPlaneAuthOptions' estiver definido.
|
|
properties.eTag
|
string
|
|
Uma propriedade gerada pelo sistema que representa a etag do serviço que pode ser para controle de simultaneidade otimista durante as atualizações.
|
|
properties.encryptionWithCmk
|
EncryptionWithCmk
|
|
Especifica qualquer política relativa à criptografia de recursos (como índices) usando chaves do gerenciador de clientes em um serviço de pesquisa.
|
|
properties.endpoint
|
string
(uri)
|
|
O ponto de extremidade do serviço Azure AI Search.
|
|
properties.hostingMode
|
HostingMode
|
default
|
Aplicável apenas para o padrão 3 SKU. Você pode definir essa propriedade para habilitar até 3 partições de alta densidade que permitem até 1000 índices, o que é muito maior do que os índices máximos permitidos para qualquer outra SKU. Para o SKU standard3, o valor é 'default' ou 'highDensity'. Para todos os outros SKUs, esse valor deve ser 'padrão'.
|
|
properties.networkRuleSet
|
NetworkRuleSet
|
|
Regras específicas de rede que determinam como o serviço Azure AI Search pode ser alcançado.
|
|
properties.partitionCount
|
integer
(int32)
minimum: 1 maximum: 12
|
1
|
O número de partições no serviço de pesquisa; se especificado, pode ser 1, 2, 3, 4, 6 ou 12. Valores maiores que 1 só são válidos para SKUs padrão. Para serviços 'standard3' com hostingMode definido como 'highDensity', os valores permitidos estão entre 1 e 3.
|
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
|
A lista de conexões de ponto de extremidade privado para o serviço Azure AI Search.
|
|
properties.provisioningState
|
ProvisioningState
|
|
O estado da última operação de provisionamento executada no serviço de pesquisa. O provisionamento é um estado intermediário que ocorre enquanto a capacidade de serviço está sendo estabelecida. Depois que a capacidade é configurada, provisioningState muda para 'Succeeded' ou 'Failed'. Os aplicativos cliente podem sondar o status de provisionamento (o intervalo de sondagem recomendado é de 30 segundos a um minuto) usando a operação Obter Serviço de Pesquisa para ver quando uma operação é concluída. Se você estiver usando o serviço gratuito, esse valor tende a voltar como 'Bem-sucedido' diretamente na chamada para Criar serviço de pesquisa. Isso ocorre porque o serviço gratuito usa a capacidade que já está configurada.
|
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
enabled
|
Esse valor pode ser definido como 'habilitado' para evitar alterações significativas nos recursos e modelos existentes do cliente. Se definido como 'desativado', o tráfego na interface pública não é permitido, e as conexões de ponto final privado seriam o método de acesso exclusivo.
|
|
properties.replicaCount
|
integer
(int32)
minimum: 1 maximum: 12
|
1
|
O número de réplicas no serviço de pesquisa. Se especificado, deve ser um valor entre 1 e 12 inclusive para SKUs padrão ou entre 1 e 3 inclusive para SKU básico.
|
|
properties.semanticSearch
|
SearchSemanticSearch
|
|
Define opções que controlam a disponibilidade da pesquisa semântica. Essa configuração só é possível para determinadas SKUs do Azure AI Search em determinados locais.
|
|
properties.serviceUpgradedAt
|
string
(date-time)
|
|
A data e a hora em que o serviço de pesquisa foi atualizado pela última vez. Este campo será nulo até que o serviço seja atualizado pela primeira vez.
|
|
properties.sharedPrivateLinkResources
|
SharedPrivateLinkResource[]
|
|
A lista de recursos de link privado compartilhado gerenciados pelo serviço Azure AI Search.
|
|
properties.status
|
SearchServiceStatus
|
|
O status do serviço de pesquisa. Os valores possíveis incluem: 'em execução': O serviço de pesquisa está em execução e nenhuma operação de provisionamento está em andamento. 'provisionamento': o serviço de pesquisa está sendo provisionado ou ampliado para cima ou para baixo. «Eliminação»: O serviço de pesquisa está a ser eliminado. 'degradado': O serviço de pesquisa está degradado. Isso pode ocorrer quando as unidades de pesquisa subjacentes não estão íntegras. O serviço de pesquisa provavelmente está operacional, mas o desempenho pode ser lento e algumas solicitações podem ser descartadas. 'desativado': O serviço de pesquisa está desativado. Nesse estado, o serviço rejeitará todas as solicitações de API. 'erro': O serviço de pesquisa está em um estado de erro. 'interrompido': o serviço de pesquisa está em uma assinatura desativada. Se o seu serviço estiver nos estados degradado, desativado ou de erro, isso significa que a equipe do Azure AI Search está investigando ativamente o problema subjacente. Os serviços dedicados nesses estados ainda são cobrados com base no número de unidades de pesquisa provisionadas.
|
|
properties.statusDetails
|
string
|
|
Os detalhes do status do serviço de pesquisa.
|
|
properties.upgradeAvailable
|
UpgradeAvailable
|
|
Indica se o serviço de pesquisa tem uma atualização disponível.
|
|
sku
|
Sku
|
|
O SKU do serviço de pesquisa, que determina a camada de preço e os limites de capacidade. Esta propriedade é necessária ao criar um novo serviço de pesquisa.
|
|
systemData
|
systemData
|
|
Metadados do Azure Resource Manager do serviço de pesquisa que contêm informações createdBy e modifiedBy.
|
|
tags
|
object
|
|
Tags de recursos.
|
|
type
|
string
|
|
O tipo do recurso. Por exemplo, "Microsoft.Compute/virtualMachines" ou "Microsoft.Storage/storageAccounts"
|
SearchServiceStatus
Enumeração
O status do serviço de pesquisa. Os valores possíveis incluem: 'em execução': O serviço de pesquisa está em execução e nenhuma operação de provisionamento está em andamento. 'provisionamento': o serviço de pesquisa está sendo provisionado ou ampliado para cima ou para baixo. «Eliminação»: O serviço de pesquisa está a ser eliminado. 'degradado': O serviço de pesquisa está degradado. Isso pode ocorrer quando as unidades de pesquisa subjacentes não estão íntegras. O serviço de pesquisa provavelmente está operacional, mas o desempenho pode ser lento e algumas solicitações podem ser descartadas. 'desativado': O serviço de pesquisa está desativado. Nesse estado, o serviço rejeitará todas as solicitações de API. 'erro': O serviço de pesquisa está em um estado de erro. 'interrompido': o serviço de pesquisa está em uma assinatura desativada. Se o seu serviço estiver nos estados degradado, desativado ou de erro, isso significa que a equipe do Azure AI Search está investigando ativamente o problema subjacente. Os serviços dedicados nesses estados ainda são cobrados com base no número de unidades de pesquisa provisionadas.
| Valor |
Description |
|
running
|
O serviço de pesquisa está em execução e nenhuma operação de provisionamento está em andamento.
|
|
provisioning
|
O serviço de pesquisa está sendo provisionado ou dimensionado para cima ou para baixo.
|
|
deleting
|
O serviço de pesquisa está a ser eliminado.
|
|
degraded
|
O serviço de pesquisa está degradado porque as unidades de pesquisa subjacentes não estão íntegras.
|
|
disabled
|
O serviço de pesquisa está desativado e todas as solicitações de API serão rejeitadas.
|
|
error
|
O serviço de pesquisa está em estado de erro, indicando uma falha no fornecimento ou a ser excluído.
|
|
stopped
|
O serviço de pesquisa está em uma assinatura desativada.
|
SearchServiceUpdate
Object
Os parâmetros usados para atualizar um serviço Azure AI Search.
| Name |
Tipo |
Default value |
Description |
|
id
|
string
(arm-id)
|
|
ID de recurso totalmente qualificado para o recurso. Por exemplo, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
identity
|
Identity
|
|
Detalhes sobre a identidade do serviço de pesquisa. Um valor nulo indica que o serviço de pesquisa não tem nenhuma identidade atribuída.
|
|
location
|
string
|
|
A localização geográfica do recurso. Essa deve ser uma das regiões geográficas do Azure com suporte e registradas (por exemplo, Oeste dos EUA, Leste dos EUA, Sudeste Asiático e assim por diante). Essa propriedade é necessária ao criar um novo recurso.
|
|
name
|
string
|
|
O nome do recurso
|
|
properties.authOptions
|
DataPlaneAuthOptions
|
|
Define as opções de como a API do plano de dados de um serviço de pesquisa autentica solicitações. Isso não pode ser definido se 'disableLocalAuth' estiver definido como true.
|
|
properties.computeType
|
ComputeType
|
|
Configure essa propriedade para dar suporte ao serviço de pesquisa usando a Computação Padrão ou a Computação Confidencial do Azure.
|
|
properties.dataExfiltrationProtections
|
SearchDataExfiltrationProtection[]
|
|
Uma lista de cenários de exfiltração de dados que não são explicitamente permitidos para o serviço de pesquisa. Atualmente, o único valor suportado é 'Todos' para desativar todos os cenários possíveis de exportação de dados com controles mais refinados planejados para o futuro.
|
|
properties.disableLocalAuth
|
boolean
|
|
Quando definido como true, as chamadas para o serviço de pesquisa não terão permissão para utilizar chaves de API para autenticação. Isso não pode ser definido como true se 'dataPlaneAuthOptions' estiver definido.
|
|
properties.eTag
|
string
|
|
Uma propriedade gerada pelo sistema que representa a etag do serviço que pode ser para controle de simultaneidade otimista durante as atualizações.
|
|
properties.encryptionWithCmk
|
EncryptionWithCmk
|
|
Especifica qualquer política relativa à criptografia de recursos (como índices) usando chaves do gerenciador de clientes em um serviço de pesquisa.
|
|
properties.endpoint
|
string
(uri)
|
|
O ponto de extremidade do serviço Azure AI Search.
|
|
properties.hostingMode
|
HostingMode
|
default
|
Aplicável apenas para o padrão 3 SKU. Você pode definir essa propriedade para habilitar até 3 partições de alta densidade que permitem até 1000 índices, o que é muito maior do que os índices máximos permitidos para qualquer outra SKU. Para o SKU standard3, o valor é 'default' ou 'highDensity'. Para todos os outros SKUs, esse valor deve ser 'padrão'.
|
|
properties.networkRuleSet
|
NetworkRuleSet
|
|
Regras específicas de rede que determinam como o serviço Azure AI Search pode ser alcançado.
|
|
properties.partitionCount
|
integer
(int32)
minimum: 1 maximum: 12
|
1
|
O número de partições no serviço de pesquisa; se especificado, pode ser 1, 2, 3, 4, 6 ou 12. Valores maiores que 1 só são válidos para SKUs padrão. Para serviços 'standard3' com hostingMode definido como 'highDensity', os valores permitidos estão entre 1 e 3.
|
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
|
A lista de conexões de ponto de extremidade privado para o serviço Azure AI Search.
|
|
properties.provisioningState
|
ProvisioningState
|
|
O estado da última operação de provisionamento executada no serviço de pesquisa. O provisionamento é um estado intermediário que ocorre enquanto a capacidade de serviço está sendo estabelecida. Depois que a capacidade é configurada, provisioningState muda para 'Succeeded' ou 'Failed'. Os aplicativos cliente podem sondar o status de provisionamento (o intervalo de sondagem recomendado é de 30 segundos a um minuto) usando a operação Obter Serviço de Pesquisa para ver quando uma operação é concluída. Se você estiver usando o serviço gratuito, esse valor tende a voltar como 'Bem-sucedido' diretamente na chamada para Criar serviço de pesquisa. Isso ocorre porque o serviço gratuito usa a capacidade que já está configurada.
|
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
enabled
|
Esse valor pode ser definido como 'habilitado' para evitar alterações significativas nos recursos e modelos existentes do cliente. Se definido como 'desativado', o tráfego na interface pública não é permitido, e as conexões de ponto final privado seriam o método de acesso exclusivo.
|
|
properties.replicaCount
|
integer
(int32)
minimum: 1 maximum: 12
|
1
|
O número de réplicas no serviço de pesquisa. Se especificado, deve ser um valor entre 1 e 12 inclusive para SKUs padrão ou entre 1 e 3 inclusive para SKU básico.
|
|
properties.semanticSearch
|
SearchSemanticSearch
|
|
Define opções que controlam a disponibilidade da pesquisa semântica. Essa configuração só é possível para determinadas SKUs do Azure AI Search em determinados locais.
|
|
properties.serviceUpgradedAt
|
string
(date-time)
|
|
A data e a hora em que o serviço de pesquisa foi atualizado pela última vez. Este campo será nulo até que o serviço seja atualizado pela primeira vez.
|
|
properties.sharedPrivateLinkResources
|
SharedPrivateLinkResource[]
|
|
A lista de recursos de link privado compartilhado gerenciados pelo serviço Azure AI Search.
|
|
properties.status
|
SearchServiceStatus
|
|
O status do serviço de pesquisa. Os valores possíveis incluem: 'em execução': O serviço de pesquisa está em execução e nenhuma operação de provisionamento está em andamento. 'provisionamento': o serviço de pesquisa está sendo provisionado ou ampliado para cima ou para baixo. «Eliminação»: O serviço de pesquisa está a ser eliminado. 'degradado': O serviço de pesquisa está degradado. Isso pode ocorrer quando as unidades de pesquisa subjacentes não estão íntegras. O serviço de pesquisa provavelmente está operacional, mas o desempenho pode ser lento e algumas solicitações podem ser descartadas. 'desativado': O serviço de pesquisa está desativado. Nesse estado, o serviço rejeitará todas as solicitações de API. 'erro': O serviço de pesquisa está em um estado de erro. 'interrompido': o serviço de pesquisa está em uma assinatura desativada. Se o seu serviço estiver nos estados degradado, desativado ou de erro, isso significa que a equipe do Azure AI Search está investigando ativamente o problema subjacente. Os serviços dedicados nesses estados ainda são cobrados com base no número de unidades de pesquisa provisionadas.
|
|
properties.statusDetails
|
string
|
|
Os detalhes do status do serviço de pesquisa.
|
|
properties.upgradeAvailable
|
UpgradeAvailable
|
|
Indica se o serviço de pesquisa tem uma atualização disponível.
|
|
sku
|
Sku
|
|
O SKU do serviço de pesquisa, que determina a camada de preço e os limites de capacidade. Esta propriedade é necessária ao criar um novo serviço de pesquisa.
|
|
systemData
|
systemData
|
|
Metadados do Azure Resource Manager contendo informações createdBy e modifiedBy.
|
|
tags
|
object
|
|
Tags para ajudar a categorizar o recurso no portal do Azure.
|
|
type
|
string
|
|
O tipo do recurso. Por exemplo, "Microsoft.Compute/virtualMachines" ou "Microsoft.Storage/storageAccounts"
|
SharedPrivateLinkResource
Object
Descreve um recurso de link privado compartilhado gerenciado pelo serviço Azure AI Search.
| Name |
Tipo |
Description |
|
id
|
string
(arm-id)
|
ID de recurso totalmente qualificado para o recurso. Por exemplo, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
name
|
string
|
O nome do recurso
|
|
properties
|
SharedPrivateLinkResourceProperties
|
Descreve as propriedades de um recurso de link privado compartilhado gerenciado pelo serviço Azure AI Search.
|
|
systemData
|
systemData
|
Metadados do Azure Resource Manager contendo informações createdBy e modifiedBy.
|
|
type
|
string
|
O tipo do recurso. Por exemplo, "Microsoft.Compute/virtualMachines" ou "Microsoft.Storage/storageAccounts"
|
SharedPrivateLinkResourceProperties
Object
Descreve as propriedades de um recurso de link privado compartilhado existente gerenciado pelo serviço Azure AI Search.
| Name |
Tipo |
Description |
|
groupId
|
string
|
A ID de grupo do provedor de recurso para o qual o recurso de link privado compartilhado é destinado.
|
|
privateLinkResourceId
|
string
|
A ID do recurso para o qual o recurso de link privado compartilhado se destina.
|
|
provisioningState
|
SharedPrivateLinkResourceProvisioningState
|
O estado de provisionamento do recurso de link privado compartilhado. Os valores válidos são Atualizar, Excluir, Falhar, Ter êxito ou Incompleto.
|
|
requestMessage
|
string
|
A mensagem para solicitar a aprovação do recurso de link privado compartilhado.
|
|
resourceRegion
|
string
|
Opcional. Pode ser usado para especificar o local do Azure Resource Manager do recurso para o qual um link privado compartilhado está sendo criado. Isso só é necessário para os recursos cuja configuração de DNS é regional (como o Serviço Kubernetes do Azure).
|
|
status
|
SharedPrivateLinkResourceStatus
|
Status do recurso de link privado compartilhado. Os valores válidos são Pendente, Aprovado, Rejeitado ou Desconectado.
|
SharedPrivateLinkResourceProvisioningState
Enumeração
O estado de provisionamento do recurso de link privado compartilhado. Os valores válidos são Atualizar, Excluir, Falhar, Ter êxito ou Incompleto.
| Valor |
Description |
|
Updating
|
O recurso de link privado compartilhado está em processo de criação junto com outros recursos para que seja totalmente funcional.
|
|
Deleting
|
O recurso de link privado compartilhado está em processo de exclusão.
|
|
Failed
|
O recurso de link privado compartilhado não pôde ser provisionado ou excluído.
|
|
Succeeded
|
O recurso de link privado compartilhado concluiu o provisionamento e está pronto para aprovação.
|
|
Incomplete
|
A solicitação de provisionamento para o recurso de link privado compartilhado foi aceita, mas o processo de criação ainda não começou.
|
SharedPrivateLinkResourceStatus
Enumeração
Status do recurso de link privado compartilhado. Os valores válidos são Pendente, Aprovado, Rejeitado ou Desconectado.
| Valor |
Description |
|
Pending
|
O recurso de link privado compartilhado foi criado e está pendente de aprovação.
|
|
Approved
|
O recurso de link privado compartilhado foi aprovado e está pronto para uso.
|
|
Rejected
|
O recurso de link privado compartilhado foi rejeitado e não pode ser usado.
|
|
Disconnected
|
O recurso de link privado compartilhado foi removido do serviço.
|
Sku
Object
Define a SKU de um serviço de pesquisa, que determina a taxa de faturamento e os limites de capacidade.
| Name |
Tipo |
Description |
|
name
|
SkuName
|
O SKU do serviço de pesquisa. Os valores válidos incluem: 'grátis': Serviço compartilhado. 'básico': Serviço dedicado com até 3 réplicas. 'standard': Serviço dedicado com até 12 partições e 12 réplicas. 'standard2': Semelhante ao padrão, mas com mais capacidade por unidade de pesquisa. 'standard3': A maior oferta Standard com até 12 partições e 12 réplicas (ou até 3 partições com mais índices se você também definir a propriedade hostingMode como 'highDensity'). 'storage_optimized_l1': Suporta 1TB por partição, até 12 partições. 'storage_optimized_l2': Suporta 2TB por partição, até 12 partições.'
|
SkuName
Enumeração
O SKU do serviço de pesquisa. Os valores válidos incluem: 'grátis': Serviço compartilhado. 'básico': Serviço dedicado com até 3 réplicas. 'standard': Serviço dedicado com até 12 partições e 12 réplicas. 'standard2': Semelhante ao padrão, mas com mais capacidade por unidade de pesquisa. 'standard3': A maior oferta Standard com até 12 partições e 12 réplicas (ou até 3 partições com mais índices se você também definir a propriedade hostingMode como 'highDensity'). 'storage_optimized_l1': Suporta 1TB por partição, até 12 partições. 'storage_optimized_l2': Suporta 2TB por partição, até 12 partições.'
| Valor |
Description |
|
free
|
Nível gratuito, sem garantias de SLA e um subconjunto dos recursos oferecidos em níveis faturáveis.
|
|
basic
|
Nível faturável para um serviço dedicado com até 3 réplicas.
|
|
standard
|
Nível faturável para um serviço dedicado com até 12 partições e 12 réplicas.
|
|
standard2
|
Semelhante ao 'padrão', mas com mais capacidade por unidade de pesquisa.
|
|
standard3
|
A maior oferta Standard com até 12 partições e 12 réplicas (ou até 3 partições com mais índices se você também definir a propriedade hostingMode como 'highDensity').
|
|
storage_optimized_l1
|
Nível faturável para um serviço dedicado que suporta 1 TB por partição, até 12 partições.
|
|
storage_optimized_l2
|
Nível faturável para um serviço dedicado que suporta 2 TB por partição, até 12 partições.
|
systemData
Object
Metadados referentes à criação e última modificação do recurso.
| Name |
Tipo |
Description |
|
createdAt
|
string
(date-time)
|
O carimbo de data/hora da criação de recursos (UTC).
|
|
createdBy
|
string
|
A identidade que criou o recurso.
|
|
createdByType
|
createdByType
|
O tipo de identidade que criou o recurso.
|
|
lastModifiedAt
|
string
(date-time)
|
O carimbo de data/hora da última modificação do recurso (UTC)
|
|
lastModifiedBy
|
string
|
A identidade que modificou o recurso pela última vez.
|
|
lastModifiedByType
|
createdByType
|
O tipo de identidade que modificou o recurso pela última vez.
|
UpgradeAvailable
Enumeração
Indica se o serviço de pesquisa tem uma atualização disponível.
| Valor |
Description |
|
notAvailable
|
Uma atualização não está disponível no momento para o serviço.
|
|
available
|
Há uma atualização disponível para o serviço.
|
UserAssignedIdentity
Object
Propriedades de identidade atribuídas pelo usuário
| Name |
Tipo |
Description |
|
clientId
|
string
(uuid)
|
O ID do cliente da identidade atribuída.
|
|
principalId
|
string
(uuid)
|
O ID principal da identidade atribuída.
|