Crea o actualiza un servicio de búsqueda en el grupo de recursos especificado. Si el servicio de búsqueda ya existe, todas las propiedades se actualizarán con los valores especificados.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}?api-version=2024-03-01-preview
Parámetros de identificador URI
Nombre |
En |
Requerido |
Tipo |
Description |
resourceGroupName
|
path |
True
|
string
|
Nombre del grupo de recursos dentro de la suscripción actual. Puede obtener este valor en la API del Administrador de recursos o el portal de Azure.
|
searchServiceName
|
path |
True
|
string
|
Nombre del servicio Search de Azure AI para crear o actualizar. servicio Search nombres solo deben contener letras minúsculas, dígitos o guiones, no pueden usar guiones como los dos primeros o últimos caracteres, no pueden contener guiones consecutivos y deben tener entre 2 y 60 caracteres de longitud. servicio Search nombres deben ser únicos globalmente, ya que forman parte del URI del servicio (https://.search.windows.net). No se puede cambiar el nombre del servicio después de crear el servicio.
|
subscriptionId
|
path |
True
|
string
|
Identificador único de una suscripción de Microsoft Azure. Puede obtener este valor en la API del Administrador de recursos o el portal de Azure.
|
api-version
|
query |
True
|
string
|
La versión de la API que se va a usar para cada solicitud.
|
Nombre |
Requerido |
Tipo |
Description |
x-ms-client-request-id
|
|
string
uuid
|
Un valor GUID generado por el cliente que identifica esta solicitud. Si se especifica, se incluirá en la información de respuesta como una manera de realizar un seguimiento de la solicitud.
|
Cuerpo de la solicitud
Nombre |
Requerido |
Tipo |
Description |
location
|
True
|
string
|
Ubicación geográfica donde reside el recurso
|
identity
|
|
Identity
|
Identidad del recurso.
|
properties.authOptions
|
|
DataPlaneAuthOptions
|
Define las opciones de cómo la API del plano de datos de un servicio de búsqueda autentica las solicitudes. No se puede establecer si "disableLocalAuth" está establecido en true.
|
properties.disableLocalAuth
|
|
boolean
|
Cuando se establece en true, no se permitirá que las llamadas al servicio de búsqueda usen claves de API para la autenticación. No se puede establecer en true si se definen "dataPlaneAuthOptions".
|
properties.disabledDataExfiltrationOptions
|
|
SearchDisabledDataExfiltrationOption[]
|
Lista de escenarios de filtración de datos que no se permiten explícitamente para el servicio de búsqueda. Actualmente, el único valor admitido es "All" para deshabilitar todos los posibles escenarios de exportación de datos con controles más específicos planeados para el futuro.
|
properties.encryptionWithCmk
|
|
EncryptionWithCmk
|
Especifica cualquier directiva relativa al cifrado de recursos (como índices) mediante claves de administrador de clientes dentro de un servicio de búsqueda.
|
properties.hostingMode
|
|
HostingMode
|
Solo se aplica a la SKU estándar3. Puede establecer esta propiedad para habilitar hasta 3 particiones de alta densidad que permitan hasta 1000 índices, que es mucho mayor que los índices máximos permitidos para cualquier otra SKU. Para la SKU standard3, el valor es "default" o "highDensity". Para todas las demás SKU, este valor debe ser "default".
|
properties.networkRuleSet
|
|
NetworkRuleSet
|
Reglas específicas de red que determinan cómo se puede acceder al servicio Search de Azure AI.
|
properties.partitionCount
|
|
integer
|
Número de particiones en el servicio de búsqueda; si se especifica, puede ser 1, 2, 3, 4, 6 o 12. Los valores mayores que 1 solo son válidos para las SKU estándar. Para los servicios "standard3" con hostingMode establecido en "highDensity", los valores permitidos están comprendidos entre 1 y 3.
|
properties.publicNetworkAccess
|
|
PublicNetworkAccess
|
Este valor se puede establecer en "habilitado" para evitar cambios importantes en los recursos y plantillas de cliente existentes. Si se establece en "deshabilitado", no se permite el tráfico a través de la interfaz pública y las conexiones de punto de conexión privado serían el método de acceso exclusivo.
|
properties.replicaCount
|
|
integer
|
Número de réplicas en el servicio de búsqueda. Si se especifica, debe ser un valor entre 1 y 12 inclusive para las SKU estándar o entre 1 y 3 inclusive para la SKU básica.
|
properties.semanticSearch
|
|
SearchSemanticSearch
|
Establece las opciones que controlan la disponibilidad de la búsqueda semántica. Esta configuración solo es posible para determinadas SKU de Azure AI Search en determinadas ubicaciones.
|
sku
|
|
Sku
|
SKU del servicio de búsqueda, que determina los límites de nivel de tarifa y capacidad. Esta propiedad es necesaria al crear un nuevo servicio de búsqueda.
|
tags
|
|
object
|
Etiquetas del recurso.
|
Respuestas
Nombre |
Tipo |
Description |
200 OK
|
SearchService
|
La definición de servicio existente se actualizó correctamente. Si ha cambiado el número de réplicas o particiones, la operación de escalado se realizará de forma asincrónica. Puede comprobar el estado de una operación de escalado a través de la propiedad provisioningState de una solicitud Get Service.
|
201 Created
|
SearchService
|
Si solicitó la creación de un servicio de búsqueda gratuito, el servicio ahora se aprovisiona y está listo para usarse, sujeto al retraso de propagación de DNS. Para otros tipos de SKU, el aprovisionamiento se produce de forma asincrónica. Puede comprobar el estado de una operación de escalado a través de la propiedad provisioningState de una solicitud Get Service.
|
Other Status Codes
|
CloudError
|
HTTP 400 (solicitud incorrecta): el nombre de servicio o la definición de servicio especificados no son válidos. Consulte el código de error y el mensaje en la respuesta para obtener más información. HTTP 404 (no encontrado): no se encontró la suscripción o el grupo de recursos. HTTP 409 (conflicto): la suscripción especificada está deshabilitada.
|
Seguridad
azure_auth
Especifica un flujo de concesión implícita, como se admite en la Plataforma de identidad de Microsoft.
Tipo:
oauth2
Flujo:
implicit
Dirección URL de autorización:
https://login.microsoftonline.com/common/oauth2/authorize
Ámbitos
Nombre |
Description |
user_impersonation
|
suplantación de su cuenta de usuario
|
Ejemplos
SearchCreateOrUpdateService
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_create_or_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.begin_create_or_update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"location": "westus",
"properties": {"hostingMode": "default", "partitionCount": 1, "replicaCount": 3},
"sku": {"name": "standard"},
"tags": {"app-name": "My e-commerce app"},
},
).result()
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateService.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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateService.json
func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateService() {
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)
}
poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{
Location: to.Ptr("westus"),
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
},
Properties: &armsearch.ServiceProperties{
HostingMode: to.Ptr(armsearch.HostingModeDefault),
PartitionCount: to.Ptr[int32](1),
ReplicaCount: to.Ptr[int32](3),
},
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)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// 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](3),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// },
// 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");
/**
* This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
*
* @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateService.json
*/
async function searchCreateOrUpdateService() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
hostingMode: "default",
location: "westus",
partitionCount: 1,
replicaCount: 3,
sku: { name: "standard" },
tags: { appName: "My e-commerce app" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.beginCreateOrUpdateAndWait(
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.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateService.json
// this example is just showing the usage of "Services_CreateOrUpdate" 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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this SearchServiceResource
SearchServiceCollection collection = resourceGroupResource.GetSearchServices();
// invoke the operation
string searchServiceName = "mysearchservice";
SearchServiceData data = new SearchServiceData(new AzureLocation("westus"))
{
SearchSkuName = SearchServiceSkuName.Standard,
ReplicaCount = 3,
PartitionCount = 1,
HostingMode = SearchServiceHostingMode.Default,
Tags =
{
["app-name"] = "My e-commerce app",
},
};
ArmOperation<SearchServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, searchServiceName, data);
SearchServiceResource result = lro.Value;
// 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
Respuesta de muestra
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
SearchCreateOrUpdateServiceAuthOptions
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default",
"authOptions": {
"aadOrApiKey": {
"aadAuthFailureMode": "http401WithBearerChallenge"
}
}
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_create_or_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.begin_create_or_update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"location": "westus",
"properties": {
"authOptions": {"aadOrApiKey": {"aadAuthFailureMode": "http401WithBearerChallenge"}},
"hostingMode": "default",
"partitionCount": 1,
"replicaCount": 3,
},
"sku": {"name": "standard"},
"tags": {"app-name": "My e-commerce app"},
},
).result()
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.json
func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceAuthOptions() {
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)
}
poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{
Location: to.Ptr("westus"),
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
},
Properties: &armsearch.ServiceProperties{
AuthOptions: &armsearch.DataPlaneAuthOptions{
AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{
AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge),
},
},
HostingMode: to.Ptr(armsearch.HostingModeDefault),
PartitionCount: to.Ptr[int32](1),
ReplicaCount: to.Ptr[int32](3),
},
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)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{
// AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge),
// },
// },
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// 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](3),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// },
// 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");
/**
* This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
*
* @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.json
*/
async function searchCreateOrUpdateServiceAuthOptions() {
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" },
},
hostingMode: "default",
location: "westus",
partitionCount: 1,
replicaCount: 3,
sku: { name: "standard" },
tags: { appName: "My e-commerce app" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.beginCreateOrUpdateAndWait(
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.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.json
// this example is just showing the usage of "Services_CreateOrUpdate" 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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this SearchServiceResource
SearchServiceCollection collection = resourceGroupResource.GetSearchServices();
// invoke the operation
string searchServiceName = "mysearchservice";
SearchServiceData data = new SearchServiceData(new AzureLocation("westus"))
{
SearchSkuName = SearchServiceSkuName.Standard,
ReplicaCount = 3,
PartitionCount = 1,
HostingMode = SearchServiceHostingMode.Default,
AuthOptions = new SearchAadAuthDataPlaneAuthOptions()
{
AadAuthFailureMode = SearchAadAuthFailureMode.Http401WithBearerChallenge,
},
Tags =
{
["app-name"] = "My e-commerce app",
},
};
ArmOperation<SearchServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, searchServiceName, data);
SearchServiceResource result = lro.Value;
// 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
Respuesta de muestra
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"authOptions": {
"aadOrApiKey": {
"aadAuthFailureMode": "http401WithBearerChallenge"
}
},
"disabledDataExfiltrationOptions": []
}
}
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"authOptions": {
"aadOrApiKey": {
"aadAuthFailureMode": "http401WithBearerChallenge"
}
},
"disabledDataExfiltrationOptions": []
}
}
SearchCreateOrUpdateServiceDisableLocalAuth
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default",
"disableLocalAuth": true
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_create_or_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.begin_create_or_update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"location": "westus",
"properties": {"disableLocalAuth": True, "hostingMode": "default", "partitionCount": 1, "replicaCount": 3},
"sku": {"name": "standard"},
"tags": {"app-name": "My e-commerce app"},
},
).result()
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json
func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceDisableLocalAuth() {
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)
}
poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{
Location: to.Ptr("westus"),
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
},
Properties: &armsearch.ServiceProperties{
DisableLocalAuth: to.Ptr(true),
HostingMode: to.Ptr(armsearch.HostingModeDefault),
PartitionCount: to.Ptr[int32](1),
ReplicaCount: to.Ptr[int32](3),
},
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)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// },
// Properties: &armsearch.ServiceProperties{
// DisableLocalAuth: to.Ptr(true),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// 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](3),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// },
// 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");
/**
* This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
*
* @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json
*/
async function searchCreateOrUpdateServiceDisableLocalAuth() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
disableLocalAuth: true,
hostingMode: "default",
location: "westus",
partitionCount: 1,
replicaCount: 3,
sku: { name: "standard" },
tags: { appName: "My e-commerce app" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.beginCreateOrUpdateAndWait(
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.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json
// this example is just showing the usage of "Services_CreateOrUpdate" 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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this SearchServiceResource
SearchServiceCollection collection = resourceGroupResource.GetSearchServices();
// invoke the operation
string searchServiceName = "mysearchservice";
SearchServiceData data = new SearchServiceData(new AzureLocation("westus"))
{
SearchSkuName = SearchServiceSkuName.Standard,
ReplicaCount = 3,
PartitionCount = 1,
HostingMode = SearchServiceHostingMode.Default,
IsLocalAuthDisabled = true,
Tags =
{
["app-name"] = "My e-commerce app",
},
};
ArmOperation<SearchServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, searchServiceName, data);
SearchServiceResource result = lro.Value;
// 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
Respuesta de muestra
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": true,
"authOptions": null,
"disabledDataExfiltrationOptions": []
}
}
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": true,
"authOptions": null,
"disabledDataExfiltrationOptions": []
}
}
SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"publicNetworkAccess": "disabled",
"hostingMode": "default"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_create_or_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.begin_create_or_update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"location": "westus",
"properties": {
"hostingMode": "default",
"partitionCount": 1,
"publicNetworkAccess": "disabled",
"replicaCount": 3,
},
"sku": {"name": "standard"},
"tags": {"app-name": "My e-commerce app"},
},
).result()
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json
func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints() {
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)
}
poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{
Location: to.Ptr("westus"),
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
},
Properties: &armsearch.ServiceProperties{
HostingMode: to.Ptr(armsearch.HostingModeDefault),
PartitionCount: to.Ptr[int32](1),
PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled),
ReplicaCount: to.Ptr[int32](3),
},
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)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// 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.PublicNetworkAccessDisabled),
// ReplicaCount: to.Ptr[int32](3),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// },
// 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");
/**
* This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
*
* @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json
*/
async function searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
hostingMode: "default",
location: "westus",
partitionCount: 1,
publicNetworkAccess: "disabled",
replicaCount: 3,
sku: { name: "standard" },
tags: { appName: "My e-commerce app" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.beginCreateOrUpdateAndWait(
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.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json
// this example is just showing the usage of "Services_CreateOrUpdate" 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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this SearchServiceResource
SearchServiceCollection collection = resourceGroupResource.GetSearchServices();
// invoke the operation
string searchServiceName = "mysearchservice";
SearchServiceData data = new SearchServiceData(new AzureLocation("westus"))
{
SearchSkuName = SearchServiceSkuName.Standard,
ReplicaCount = 3,
PartitionCount = 1,
HostingMode = SearchServiceHostingMode.Default,
PublicInternetAccess = SearchServicePublicInternetAccess.Disabled,
Tags =
{
["app-name"] = "My e-commerce app",
},
};
ArmOperation<SearchServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, searchServiceName, data);
SearchServiceResource result = lro.Value;
// 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
Respuesta de muestra
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "disabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "disabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"networkRuleSet": {
"ipRules": [
{
"value": "123.4.5.6"
},
{
"value": "123.4.6.0/18"
}
]
},
"hostingMode": "default"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_create_or_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.begin_create_or_update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"location": "westus",
"properties": {
"hostingMode": "default",
"networkRuleSet": {"ipRules": [{"value": "123.4.5.6"}, {"value": "123.4.6.0/18"}]},
"partitionCount": 1,
"replicaCount": 1,
},
"sku": {"name": "standard"},
"tags": {"app-name": "My e-commerce app"},
},
).result()
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json
func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs() {
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)
}
poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{
Location: to.Ptr("westus"),
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
},
Properties: &armsearch.ServiceProperties{
HostingMode: to.Ptr(armsearch.HostingModeDefault),
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),
ReplicaCount: to.Ptr[int32](1),
},
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)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// 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),
// 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(""),
// },
// 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");
/**
* This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
*
* @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json
*/
async function searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
hostingMode: "default",
location: "westus",
networkRuleSet: {
ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }],
},
partitionCount: 1,
replicaCount: 1,
sku: { name: "standard" },
tags: { appName: "My e-commerce app" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.beginCreateOrUpdateAndWait(
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.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json
// this example is just showing the usage of "Services_CreateOrUpdate" 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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this SearchServiceResource
SearchServiceCollection collection = resourceGroupResource.GetSearchServices();
// invoke the operation
string searchServiceName = "mysearchservice";
SearchServiceData data = new SearchServiceData(new AzureLocation("westus"))
{
SearchSkuName = SearchServiceSkuName.Standard,
ReplicaCount = 1,
PartitionCount = 1,
HostingMode = SearchServiceHostingMode.Default,
NetworkRuleSet = new SearchServiceNetworkRuleSet()
{
IPRules =
{
new SearchServiceIPRule()
{
Value = "123.4.5.6",
},new SearchServiceIPRule()
{
Value = "123.4.6.0/18",
}
},
},
Tags =
{
["app-name"] = "My e-commerce app",
},
};
ArmOperation<SearchServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, searchServiceName, data);
SearchServiceResource result = lro.Value;
// 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
Respuesta de muestra
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [
{
"value": "123.4.5.6"
},
{
"value": "123.4.6.0/18"
}
]
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [
{
"value": "123.4.5.6"
},
{
"value": "123.4.6.0/18"
}
]
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"networkRuleSet": {
"ipRules": [
{
"value": "123.4.5.6"
},
{
"value": "123.4.6.0/18"
}
],
"bypass": "AzurePortal"
},
"hostingMode": "default"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_create_or_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.begin_create_or_update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"location": "westus",
"properties": {
"hostingMode": "default",
"networkRuleSet": {
"bypass": "AzurePortal",
"ipRules": [{"value": "123.4.5.6"}, {"value": "123.4.6.0/18"}],
},
"partitionCount": 1,
"replicaCount": 1,
},
"sku": {"name": "standard"},
"tags": {"app-name": "My e-commerce app"},
},
).result()
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json
func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() {
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)
}
poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{
Location: to.Ptr("westus"),
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
},
Properties: &armsearch.ServiceProperties{
HostingMode: to.Ptr(armsearch.HostingModeDefault),
NetworkRuleSet: &armsearch.NetworkRuleSet{
Bypass: to.Ptr(armsearch.SearchBypassAzurePortal),
IPRules: []*armsearch.IPRule{
{
Value: to.Ptr("123.4.5.6"),
},
{
Value: to.Ptr("123.4.6.0/18"),
}},
},
PartitionCount: to.Ptr[int32](1),
ReplicaCount: to.Ptr[int32](1),
},
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)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// 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.SearchBypassAzurePortal),
// IPRules: []*armsearch.IPRule{
// {
// Value: to.Ptr("123.4.5.6"),
// },
// {
// Value: to.Ptr("123.4.6.0/18"),
// }},
// },
// 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(""),
// },
// 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");
/**
* This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
*
* @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json
*/
async function searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
hostingMode: "default",
location: "westus",
networkRuleSet: {
bypass: "AzurePortal",
ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }],
},
partitionCount: 1,
replicaCount: 1,
sku: { name: "standard" },
tags: { appName: "My e-commerce app" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.beginCreateOrUpdateAndWait(
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.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json
// this example is just showing the usage of "Services_CreateOrUpdate" 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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this SearchServiceResource
SearchServiceCollection collection = resourceGroupResource.GetSearchServices();
// invoke the operation
string searchServiceName = "mysearchservice";
SearchServiceData data = new SearchServiceData(new AzureLocation("westus"))
{
SearchSkuName = SearchServiceSkuName.Standard,
ReplicaCount = 1,
PartitionCount = 1,
HostingMode = SearchServiceHostingMode.Default,
NetworkRuleSet = new SearchServiceNetworkRuleSet()
{
IPRules =
{
new SearchServiceIPRule()
{
Value = "123.4.5.6",
},new SearchServiceIPRule()
{
Value = "123.4.6.0/18",
}
},
Bypass = SearchBypass.AzurePortal,
},
Tags =
{
["app-name"] = "My e-commerce app",
},
};
ArmOperation<SearchServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, searchServiceName, data);
SearchServiceResource result = lro.Value;
// 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
Respuesta de muestra
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [
{
"value": "123.4.5.6"
},
{
"value": "123.4.6.0/18"
}
],
"bypass": "AzurePortal"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [
{
"value": "123.4.5.6"
},
{
"value": "123.4.6.0/18"
}
],
"bypass": "AzurePortal"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
SearchCreateOrUpdateServiceWithCmkEnforcement
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default",
"encryptionWithCmk": {
"enforcement": "Enabled"
}
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_create_or_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.begin_create_or_update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"location": "westus",
"properties": {
"encryptionWithCmk": {"enforcement": "Enabled"},
"hostingMode": "default",
"partitionCount": 1,
"replicaCount": 3,
},
"sku": {"name": "standard"},
"tags": {"app-name": "My e-commerce app"},
},
).result()
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json
func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithCmkEnforcement() {
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)
}
poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{
Location: to.Ptr("westus"),
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
},
Properties: &armsearch.ServiceProperties{
EncryptionWithCmk: &armsearch.EncryptionWithCmk{
Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled),
},
HostingMode: to.Ptr(armsearch.HostingModeDefault),
PartitionCount: to.Ptr[int32](1),
ReplicaCount: to.Ptr[int32](3),
},
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)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled),
// },
// 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.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// },
// 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");
/**
* This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
*
* @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json
*/
async function searchCreateOrUpdateServiceWithCmkEnforcement() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
encryptionWithCmk: { enforcement: "Enabled" },
hostingMode: "default",
location: "westus",
partitionCount: 1,
replicaCount: 3,
sku: { name: "standard" },
tags: { appName: "My e-commerce app" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.beginCreateOrUpdateAndWait(
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.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json
// this example is just showing the usage of "Services_CreateOrUpdate" 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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this SearchServiceResource
SearchServiceCollection collection = resourceGroupResource.GetSearchServices();
// invoke the operation
string searchServiceName = "mysearchservice";
SearchServiceData data = new SearchServiceData(new AzureLocation("westus"))
{
SearchSkuName = SearchServiceSkuName.Standard,
ReplicaCount = 3,
PartitionCount = 1,
HostingMode = SearchServiceHostingMode.Default,
EncryptionWithCmk = new SearchEncryptionWithCmk()
{
Enforcement = SearchEncryptionWithCmkEnforcement.Enabled,
},
Tags =
{
["app-name"] = "My e-commerce app",
},
};
ArmOperation<SearchServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, searchServiceName, data);
SearchServiceResource result = lro.Value;
// 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
Respuesta de muestra
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Enabled",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Enabled",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
SearchCreateOrUpdateServiceWithDataExfiltration
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default",
"disabledDataExfiltrationOptions": [
"All"
]
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_create_or_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.begin_create_or_update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"location": "westus",
"properties": {
"disabledDataExfiltrationOptions": ["All"],
"hostingMode": "default",
"partitionCount": 1,
"replicaCount": 3,
},
"sku": {"name": "standard"},
"tags": {"app-name": "My e-commerce app"},
},
).result()
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithDataExfiltration.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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithDataExfiltration.json
func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithDataExfiltration() {
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)
}
poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{
Location: to.Ptr("westus"),
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
},
Properties: &armsearch.ServiceProperties{
DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)},
HostingMode: to.Ptr(armsearch.HostingModeDefault),
PartitionCount: to.Ptr[int32](1),
ReplicaCount: to.Ptr[int32](3),
},
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)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)},
// 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](3),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// },
// 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");
/**
* This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
*
* @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithDataExfiltration.json
*/
async function searchCreateOrUpdateServiceWithDataExfiltration() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
disabledDataExfiltrationOptions: ["All"],
hostingMode: "default",
location: "westus",
partitionCount: 1,
replicaCount: 3,
sku: { name: "standard" },
tags: { appName: "My e-commerce app" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.beginCreateOrUpdateAndWait(
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.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithDataExfiltration.json
// this example is just showing the usage of "Services_CreateOrUpdate" 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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this SearchServiceResource
SearchServiceCollection collection = resourceGroupResource.GetSearchServices();
// invoke the operation
string searchServiceName = "mysearchservice";
SearchServiceData data = new SearchServiceData(new AzureLocation("westus"))
{
SearchSkuName = SearchServiceSkuName.Standard,
ReplicaCount = 3,
PartitionCount = 1,
HostingMode = SearchServiceHostingMode.Default,
DisabledDataExfiltrationOptions =
{
SearchDisabledDataExfiltrationOption.All
},
Tags =
{
["app-name"] = "My e-commerce app",
},
};
ArmOperation<SearchServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, searchServiceName, data);
SearchServiceResource result = lro.Value;
// 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
Respuesta de muestra
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": [
"All"
]
}
}
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": [
"All"
]
}
}
SearchCreateOrUpdateServiceWithIdentity
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default"
},
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-mi": {}
}
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_create_or_update_service_with_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.begin_create_or_update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-mi": {}
},
},
"location": "westus",
"properties": {"hostingMode": "default", "partitionCount": 1, "replicaCount": 3},
"sku": {"name": "standard"},
"tags": {"app-name": "My e-commerce app"},
},
).result()
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.json
func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithIdentity() {
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)
}
poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{
Location: to.Ptr("westus"),
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
},
Identity: &armsearch.Identity{
Type: to.Ptr(armsearch.IdentityTypeSystemAssignedUserAssigned),
UserAssignedIdentities: map[string]*armsearch.UserAssignedManagedIdentity{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-mi": {},
},
},
Properties: &armsearch.ServiceProperties{
HostingMode: to.Ptr(armsearch.HostingModeDefault),
PartitionCount: to.Ptr[int32](1),
ReplicaCount: to.Ptr[int32](3),
},
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)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// },
// Identity: &armsearch.Identity{
// Type: to.Ptr(armsearch.IdentityTypeSystemAssignedUserAssigned),
// PrincipalID: to.Ptr("9d1e1f18-2122-4988-a11c-878782e40a5c"),
// TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"),
// UserAssignedIdentities: map[string]*armsearch.UserAssignedManagedIdentity{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-mi": &armsearch.UserAssignedManagedIdentity{
// ClientID: to.Ptr("cd1dcac8-82dd-45b5-9aed-76795d529f6b"),
// PrincipalID: to.Ptr("24e07a75-1286-41e5-a15d-ded85ec3acd7"),
// },
// },
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// 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](3),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// },
// 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");
/**
* This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
*
* @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.json
*/
async function searchCreateOrUpdateServiceWithIdentity() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
hostingMode: "default",
identity: {
type: "SystemAssigned, UserAssigned",
userAssignedIdentities: {
"/subscriptions/00000000000000000000000000000000/resourcegroups/rg1/providers/MicrosoftManagedIdentity/userAssignedIdentities/userMi":
{},
},
},
location: "westus",
partitionCount: 1,
replicaCount: 3,
sku: { name: "standard" },
tags: { appName: "My e-commerce app" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.beginCreateOrUpdateAndWait(
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.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.json
// this example is just showing the usage of "Services_CreateOrUpdate" 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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this SearchServiceResource
SearchServiceCollection collection = resourceGroupResource.GetSearchServices();
// invoke the operation
string searchServiceName = "mysearchservice";
SearchServiceData data = new SearchServiceData(new AzureLocation("westus"))
{
SearchSkuName = SearchServiceSkuName.Standard,
Identity = new ManagedServiceIdentity("SystemAssigned, UserAssigned")
{
UserAssignedIdentities =
{
[new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-mi")] = new UserAssignedIdentity(),
},
},
ReplicaCount = 3,
PartitionCount = 1,
HostingMode = SearchServiceHostingMode.Default,
Tags =
{
["app-name"] = "My e-commerce app",
},
};
ArmOperation<SearchServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, searchServiceName, data);
SearchServiceResource result = lro.Value;
// 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
Respuesta de muestra
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
},
"identity": {
"type": "SystemAssigned, UserAssigned",
"principalId": "9d1e1f18-2122-4988-a11c-878782e40a5c",
"tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-mi": {
"clientId": "cd1dcac8-82dd-45b5-9aed-76795d529f6b",
"principalId": "24e07a75-1286-41e5-a15d-ded85ec3acd7"
}
}
}
}
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
},
"identity": {
"type": "SystemAssigned, UserAssigned",
"principalId": "9d1e1f18-2122-4988-a11c-878782e40a5c",
"tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-mi": {
"clientId": "cd1dcac8-82dd-45b5-9aed-76795d529f6b",
"principalId": "24e07a75-1286-41e5-a15d-ded85ec3acd7"
}
}
}
}
SearchCreateOrUpdateWithSemanticSearch
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default",
"semanticSearch": "free"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_create_or_update_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.begin_create_or_update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"location": "westus",
"properties": {"hostingMode": "default", "partitionCount": 1, "replicaCount": 3, "semanticSearch": "free"},
"sku": {"name": "standard"},
"tags": {"app-name": "My e-commerce app"},
},
).result()
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.json
func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateWithSemanticSearch() {
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)
}
poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{
Location: to.Ptr("westus"),
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
},
Properties: &armsearch.ServiceProperties{
HostingMode: to.Ptr(armsearch.HostingModeDefault),
PartitionCount: to.Ptr[int32](1),
ReplicaCount: to.Ptr[int32](3),
SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchFree),
},
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)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// 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](3),
// SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchFree),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusProvisioning),
// StatusDetails: to.Ptr(""),
// },
// 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");
/**
* This sample demonstrates how to Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
*
* @summary Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.json
*/
async function searchCreateOrUpdateWithSemanticSearch() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
hostingMode: "default",
location: "westus",
partitionCount: 1,
replicaCount: 3,
semanticSearch: "free",
sku: { name: "standard" },
tags: { appName: "My e-commerce app" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.beginCreateOrUpdateAndWait(
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.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.json
// this example is just showing the usage of "Services_CreateOrUpdate" 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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this SearchServiceResource
SearchServiceCollection collection = resourceGroupResource.GetSearchServices();
// invoke the operation
string searchServiceName = "mysearchservice";
SearchServiceData data = new SearchServiceData(new AzureLocation("westus"))
{
SearchSkuName = SearchServiceSkuName.Standard,
ReplicaCount = 3,
PartitionCount = 1,
HostingMode = SearchServiceHostingMode.Default,
SemanticSearch = SearchSemanticSearch.Free,
Tags =
{
["app-name"] = "My e-commerce app",
},
};
ArmOperation<SearchServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, searchServiceName, data);
SearchServiceResource result = lro.Value;
// 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
Respuesta de muestra
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": [],
"semanticSearch": "free"
}
}
{
"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"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": [],
"semanticSearch": "free"
}
}
Definiciones
Nombre |
Description |
AadAuthFailureMode
|
Describe qué respuesta enviaría la API del plano de datos de un servicio de búsqueda para las solicitudes con errores de autenticación.
|
ApiKeyOnly
|
Indica que solo se puede usar la clave de API para la autenticación.
|
CloudError
|
Contiene información sobre un error de API.
|
CloudErrorBody
|
Describe un error de API determinado con un código de error y un mensaje.
|
DataPlaneAadOrApiKeyAuthOption
|
Indica que se puede usar la clave de API o un token de acceso de un inquilino de Microsoft Entra ID para la autenticación.
|
DataPlaneAuthOptions
|
Define las opciones de cómo el servicio de búsqueda autentica una solicitud de plano de datos. No se puede establecer si "disableLocalAuth" está establecido en true.
|
EncryptionWithCmk
|
Describe una directiva que determina cómo se cifran los recursos del servicio de búsqueda con claves administradas por el cliente.
|
HostingMode
|
Solo se aplica a la SKU estándar3. Puede establecer esta propiedad para habilitar hasta 3 particiones de alta densidad que permitan hasta 1000 índices, que es mucho mayor que los índices máximos permitidos para cualquier otra SKU. Para la SKU estándar3, el valor es "default" o "highDensity". Para todas las demás SKU, este valor debe ser 'default'.
|
Identity
|
Detalles sobre la identidad del servicio de búsqueda. Un valor NULL indica que el servicio de búsqueda no tiene asignada ninguna identidad.
|
IdentityType
|
Tipo de identidad que se usa para el recurso. El tipo "SystemAssigned, UserAssigned" incluye una identidad creada por el sistema y un conjunto de identidades asignadas por el usuario. El tipo "None" quitará todas las identidades del servicio.
|
IpRule
|
La regla de restricción de IP del servicio Search de Azure AI.
|
NetworkRuleSet
|
Reglas específicas de red que determinan cómo se puede acceder al servicio Search de Azure AI.
|
PrivateEndpoint
|
Recurso de punto de conexión privado del proveedor Microsoft.Network.
|
PrivateEndpointConnection
|
Describe una conexión de punto de conexión privado existente al servicio Search de Azure AI.
|
PrivateEndpointConnectionProperties
|
Describe las propiedades de una conexión de punto de conexión privado existente al servicio de búsqueda.
|
PrivateLinkServiceConnectionProvisioningState
|
Estado de aprovisionamiento de la conexión del servicio private link. Los valores válidos son Actualización, Eliminación, Error, Correcto, Incompleto o Cancelado.
|
PrivateLinkServiceConnectionState
|
Describe el estado actual de una conexión de servicio de Azure Private Link existente al punto de conexión privado.
|
PrivateLinkServiceConnectionStatus
|
Estado de la conexión del servicio private link. Los valores válidos son Pendiente, Aprobado, Rechazado o Desconectado.
|
ProvisioningState
|
Estado de la última operación de aprovisionamiento realizada en el servicio de búsqueda. El aprovisionamiento es un estado intermedio que se produce cuando se está estableciendo la capacidad de servicio. Una vez configurada la capacidad, provisioningState cambia a "succeeded" o "failed". Las aplicaciones cliente pueden sondear el estado de aprovisionamiento (el intervalo de sondeo recomendado es de 30 segundos a un minuto) mediante la operación Get Search Service para ver cuándo se completa una operación. Si usa el servicio gratuito, este valor tiende a volver como "correcto" directamente en la llamada a Crear servicio de búsqueda. Esto ocurre porque el servicio gratuito usa una capacidad que ya está configurada.
|
PublicNetworkAccess
|
Este valor se puede establecer en "habilitado" para evitar cambios importantes en las plantillas y los recursos del cliente existentes. Si se establece en "deshabilitado", no se permite el tráfico a través de la interfaz pública y las conexiones de punto de conexión privado serían el método de acceso exclusivo.
|
SearchBypass
|
Posibles orígenes del tráfico entrante que pueden omitir las reglas definidas en la sección "ipRules".
|
SearchDisabledDataExfiltrationOption
|
Lista de escenarios de filtración de datos que no se permiten explícitamente para el servicio de búsqueda. Actualmente, el único valor admitido es "All" para deshabilitar todos los posibles escenarios de exportación de datos con controles más específicos planeados para el futuro.
|
SearchEncryptionComplianceStatus
|
Devuelve el estado del cumplimiento del servicio de búsqueda con respecto a los objetos no cifrados por CMK. Si un servicio tiene más de un objeto sin cifrar y la aplicación está habilitada, el servicio se marca como no conforme.
|
SearchEncryptionWithCmk
|
Describe cómo un servicio de búsqueda debe aplicar el cumplimiento si encuentra objetos que no están cifrados con la clave administrada por el cliente.
|
SearchSemanticSearch
|
Establece las opciones que controlan la disponibilidad de la búsqueda semántica. Esta configuración solo es posible para determinadas SKU de Azure AI Search en determinadas ubicaciones.
|
SearchService
|
Describe un servicio Search de Azure AI y su estado actual.
|
SearchServiceStatus
|
Estado del servicio de búsqueda. Entre los valores posibles se incluyen: "en ejecución": el servicio de búsqueda se está ejecutando y no hay ninguna operación de aprovisionamiento en curso. 'aprovisionamiento': el servicio de búsqueda se está aprovisionando o escalando vertical o verticalmente. 'eliminar': se está eliminando el servicio de búsqueda. 'degradado': el servicio de búsqueda está degradado. Esto puede ocurrir cuando las unidades de búsqueda subyacentes no están en buen estado. Es más probable que el servicio de búsqueda esté operativo, pero el rendimiento podría ser lento y algunas solicitudes podrían quitarse. 'disabled': el servicio de búsqueda está deshabilitado. En este estado, el servicio rechazará todas las solicitudes de API. 'error': el servicio de búsqueda está en estado de error. 'Detenido': el servicio de búsqueda está en una suscripción deshabilitada. Si el servicio está en los estados degradados, deshabilitados o de error, significa que el equipo de Azure AI Search está investigando activamente el problema subyacente. En estos estados, los servicios dedicados son todavía facturables en función del número de unidades de búsqueda aprovisionado.
|
SharedPrivateLinkResource
|
Describe un recurso de vínculo privado compartido administrado por azure AI servicio Search.
|
SharedPrivateLinkResourceProperties
|
Describe las propiedades de un recurso de vínculo privado compartido existente administrado por azure AI servicio Search.
|
SharedPrivateLinkResourceProvisioningState
|
Estado de aprovisionamiento del recurso de vínculo privado compartido. Los valores válidos son Actualización, Eliminación, Error, Correcto o Incompleto.
|
SharedPrivateLinkResourceStatus
|
Estado del recurso de vínculo privado compartido. Los valores válidos son Pendiente, Aprobado, Rechazado o Desconectado.
|
Sku
|
Define la SKU de un servicio de búsqueda, que determina la tasa de facturación y los límites de capacidad.
|
SkuName
|
SKU del servicio de búsqueda. Los valores válidos incluyen: "gratis": servicio compartido. 'basic': servicio dedicado con hasta 3 réplicas. 'estándar': servicio dedicado con hasta 12 particiones y 12 réplicas. 'standard2': similar al estándar, pero con más capacidad por unidad de búsqueda. 'standard3': la oferta estándar más grande con hasta 12 particiones y 12 réplicas (o hasta 3 particiones con más índices si también establece la propiedad hostingMode en 'highDensity'). 'storage_optimized_l1': admite 1 TB por partición, hasta 12 particiones. "storage_optimized_l2": admite 2 TB por partición, hasta 12 particiones".
|
UserAssignedManagedIdentity
|
Los detalles de la identidad administrada asignada por el usuario asignada al servicio de búsqueda.
|
AadAuthFailureMode
Describe qué respuesta enviaría la API del plano de datos de un servicio de búsqueda para las solicitudes con errores de autenticación.
Nombre |
Tipo |
Description |
http401WithBearerChallenge
|
string
|
Indica que las solicitudes de autenticación con error deben presentarse con un código de estado HTTP 401 (no autorizado) y presentar un desafío de portador.
|
http403
|
string
|
Indica que las solicitudes que no se pudieron autenticar deben presentarse con un código de estado HTTP de 403 (Prohibido).
|
ApiKeyOnly
Indica que solo se puede usar la clave de API para la autenticación.
CloudError
Contiene información sobre un error de API.
Nombre |
Tipo |
Description |
error
|
CloudErrorBody
|
Describe un error de API determinado con un código de error y un mensaje.
|
message
|
string
|
Una breve descripción del error que indica lo que salió mal (para obtener detalles o información de depuración, consulte la propiedad "error.message").
|
CloudErrorBody
Describe un error de API determinado con un código de error y un mensaje.
Nombre |
Tipo |
Description |
code
|
string
|
Código de error que describe la condición de error de forma más precisa que un código de estado HTTP. Se puede usar para controlar mediante programación casos de error específicos.
|
details
|
CloudErrorBody[]
|
Contiene errores anidados relacionados con este error.
|
message
|
string
|
Mensaje que describe el error en detalle y proporciona información de depuración.
|
target
|
string
|
Destino del error determinado (por ejemplo, el nombre de la propiedad en error).
|
DataPlaneAadOrApiKeyAuthOption
Indica que se puede usar la clave de API o un token de acceso de un inquilino de Microsoft Entra ID para la autenticación.
Nombre |
Tipo |
Description |
aadAuthFailureMode
|
AadAuthFailureMode
|
Describe qué respuesta enviaría la API del plano de datos de un servicio de búsqueda para las solicitudes con errores de autenticación.
|
DataPlaneAuthOptions
Define las opciones de cómo el servicio de búsqueda autentica una solicitud de plano de datos. No se puede establecer si "disableLocalAuth" está establecido en true.
Nombre |
Tipo |
Description |
aadOrApiKey
|
DataPlaneAadOrApiKeyAuthOption
|
Indica que se puede usar la clave de API o un token de acceso de un inquilino de Microsoft Entra ID para la autenticación.
|
apiKeyOnly
|
ApiKeyOnly
|
Indica que solo se puede usar la clave de API para la autenticación.
|
EncryptionWithCmk
Describe una directiva que determina cómo se cifran los recursos del servicio de búsqueda con claves administradas por el cliente.
Nombre |
Tipo |
Description |
encryptionComplianceStatus
|
SearchEncryptionComplianceStatus
|
Devuelve el estado del cumplimiento del servicio de búsqueda con respecto a los objetos no cifrados por CMK. Si un servicio tiene más de un objeto sin cifrar y la aplicación está habilitada, el servicio se marca como no conforme.
|
enforcement
|
SearchEncryptionWithCmk
|
Describe cómo un servicio de búsqueda debe aplicar el cumplimiento si encuentra objetos que no están cifrados con la clave administrada por el cliente.
|
HostingMode
Solo se aplica a la SKU estándar3. Puede establecer esta propiedad para habilitar hasta 3 particiones de alta densidad que permitan hasta 1000 índices, que es mucho mayor que los índices máximos permitidos para cualquier otra SKU. Para la SKU estándar3, el valor es "default" o "highDensity". Para todas las demás SKU, este valor debe ser 'default'.
Nombre |
Tipo |
Description |
default
|
string
|
El límite del número de índices viene determinado por los límites predeterminados de la SKU.
|
highDensity
|
string
|
Solo la aplicación para la SKU standard3, donde el servicio de búsqueda puede tener hasta 1000 índices.
|
Identity
Detalles sobre la identidad del servicio de búsqueda. Un valor NULL indica que el servicio de búsqueda no tiene asignada ninguna identidad.
Nombre |
Tipo |
Description |
principalId
|
string
|
Identificador de entidad de seguridad de la identidad asignada por el sistema del servicio de búsqueda.
|
tenantId
|
string
|
Identificador de inquilino de la identidad asignada por el sistema del servicio de búsqueda.
|
type
|
IdentityType
|
Tipo de identidad que se usa para el recurso. El tipo "SystemAssigned, UserAssigned" incluye una identidad creada por el sistema y un conjunto de identidades asignadas por el usuario. El tipo "None" quitará todas las identidades del servicio.
|
userAssignedIdentities
|
<string,
UserAssignedManagedIdentity>
|
Lista de identidades de usuario asociadas al recurso. Las referencias de clave de diccionario de identidad de usuario serán identificadores de recursos arm con el formato : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
|
IdentityType
Tipo de identidad que se usa para el recurso. El tipo "SystemAssigned, UserAssigned" incluye una identidad creada por el sistema y un conjunto de identidades asignadas por el usuario. El tipo "None" quitará todas las identidades del servicio.
Nombre |
Tipo |
Description |
None
|
string
|
Indica que se debe quitar cualquier identidad asociada al servicio de búsqueda.
|
SystemAssigned
|
string
|
Indica que se habilitará la identidad asignada por el sistema para el servicio de búsqueda.
|
SystemAssigned, UserAssigned
|
string
|
Indica que la identidad asignada por el sistema para el servicio de búsqueda se habilitará junto con la asignación de una o varias identidades asignadas por el usuario.
|
UserAssigned
|
string
|
Indica que una o varias identidades asignadas por el usuario se asignarán al servicio de búsqueda.
|
IpRule
La regla de restricción de IP del servicio Search de Azure AI.
Nombre |
Tipo |
Description |
value
|
string
|
Valor correspondiente a una única dirección IPv4 (por ejemplo, 123.1.2.3) o a un intervalo IP en formato CIDR (p. ej., 123.1.2.3/24) que se va a permitir.
|
NetworkRuleSet
Reglas específicas de red que determinan cómo se puede acceder al servicio Search de Azure AI.
Nombre |
Tipo |
Description |
bypass
|
SearchBypass
|
Posibles orígenes del tráfico entrante que pueden omitir las reglas definidas en la sección "ipRules".
|
ipRules
|
IpRule[]
|
Lista de reglas de restricción de IP que definen las redes entrantes con permiso de acceso al punto de conexión del servicio de búsqueda. Mientras tanto, el firewall bloquea todas las demás redes IP públicas. Estas reglas de restricción solo se aplican cuando "publicNetworkAccess" del servicio de búsqueda está "habilitado"; de lo contrario, el tráfico a través de la interfaz pública no se permite incluso con ninguna regla de IP pública y las conexiones de punto de conexión privado serían el método de acceso exclusivo.
|
PrivateEndpoint
Recurso de punto de conexión privado del proveedor Microsoft.Network.
Nombre |
Tipo |
Description |
id
|
string
|
Identificador de recurso del recurso de punto de conexión privado del proveedor Microsoft.Network.
|
PrivateEndpointConnection
Describe una conexión de punto de conexión privado existente al servicio Search de Azure AI.
Nombre |
Tipo |
Description |
id
|
string
|
Identificador de recurso completo del recurso. Por ejemplo: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
Nombre del recurso.
|
properties
|
PrivateEndpointConnectionProperties
|
Describe las propiedades de una conexión de punto de conexión privado existente al servicio Search de Azure AI.
|
type
|
string
|
Tipo de recurso. Por ejemplo, "Microsoft.Compute/virtualMachines" o "Microsoft.Storage/storageAccounts"
|
PrivateEndpointConnectionProperties
Describe las propiedades de una conexión de punto de conexión privado existente al servicio de búsqueda.
Nombre |
Tipo |
Description |
groupId
|
string
|
Identificador de grupo del recurso de Azure para el que está el servicio Private Link.
|
privateEndpoint
|
PrivateEndpoint
|
Recurso de punto de conexión privado del proveedor Microsoft.Network.
|
privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
Describe el estado actual de una conexión de servicio Azure Private Link existente al punto de conexión privado.
|
provisioningState
|
PrivateLinkServiceConnectionProvisioningState
|
Estado de aprovisionamiento de la conexión del servicio Private Link. Los valores válidos son Actualización, Eliminación, Error, Correcto, Incompleto o Cancelado.
|
PrivateLinkServiceConnectionProvisioningState
Estado de aprovisionamiento de la conexión del servicio private link. Los valores válidos son Actualización, Eliminación, Error, Correcto, Incompleto o Cancelado.
Nombre |
Tipo |
Description |
Canceled
|
string
|
Se ha cancelado la solicitud de aprovisionamiento para el recurso de conexión del servicio Private Link.
|
Deleting
|
string
|
La conexión del servicio private link está en proceso de eliminación.
|
Failed
|
string
|
No se pudo aprovisionar o eliminar la conexión del servicio private link.
|
Incomplete
|
string
|
Se ha aceptado la solicitud de aprovisionamiento para el recurso de conexión del servicio private link, pero el proceso de creación aún no ha comenzado.
|
Succeeded
|
string
|
La conexión del servicio private link ha terminado de aprovisionar y está lista para su aprobación.
|
Updating
|
string
|
La conexión del servicio private link está en proceso de creación junto con otros recursos para que sea totalmente funcional.
|
PrivateLinkServiceConnectionState
Describe el estado actual de una conexión de servicio de Azure Private Link existente al punto de conexión privado.
Nombre |
Tipo |
Valor predeterminado |
Description |
actionsRequired
|
string
|
None
|
Descripción de cualquier acción adicional que pueda ser necesaria.
|
description
|
string
|
|
Descripción del estado de conexión del servicio private link.
|
status
|
PrivateLinkServiceConnectionStatus
|
|
Estado de la conexión del servicio private link. Los valores válidos son Pendiente, Aprobado, Rechazado o Desconectado.
|
PrivateLinkServiceConnectionStatus
Estado de la conexión del servicio private link. Los valores válidos son Pendiente, Aprobado, Rechazado o Desconectado.
Nombre |
Tipo |
Description |
Approved
|
string
|
La conexión del punto de conexión privado se aprueba y está lista para su uso.
|
Disconnected
|
string
|
La conexión del punto de conexión privado se ha quitado del servicio.
|
Pending
|
string
|
La conexión del punto de conexión privado se ha creado y está pendiente de aprobación.
|
Rejected
|
string
|
La conexión del punto de conexión privado se ha rechazado y no se puede usar.
|
ProvisioningState
Estado de la última operación de aprovisionamiento realizada en el servicio de búsqueda. El aprovisionamiento es un estado intermedio que se produce cuando se está estableciendo la capacidad de servicio. Una vez configurada la capacidad, provisioningState cambia a "succeeded" o "failed". Las aplicaciones cliente pueden sondear el estado de aprovisionamiento (el intervalo de sondeo recomendado es de 30 segundos a un minuto) mediante la operación Get Search Service para ver cuándo se completa una operación. Si usa el servicio gratuito, este valor tiende a volver como "correcto" directamente en la llamada a Crear servicio de búsqueda. Esto ocurre porque el servicio gratuito usa una capacidad que ya está configurada.
Nombre |
Tipo |
Description |
failed
|
string
|
Error en la última operación de aprovisionamiento.
|
provisioning
|
string
|
El servicio de búsqueda se aprovisiona o se escala o reduce verticalmente.
|
succeeded
|
string
|
La última operación de aprovisionamiento se ha completado correctamente.
|
PublicNetworkAccess
Este valor se puede establecer en "habilitado" para evitar cambios importantes en las plantillas y los recursos del cliente existentes. Si se establece en "deshabilitado", no se permite el tráfico a través de la interfaz pública y las conexiones de punto de conexión privado serían el método de acceso exclusivo.
Nombre |
Tipo |
Description |
disabled
|
string
|
El servicio de búsqueda no es accesible desde el tráfico procedente de la red pública de Internet. El acceso solo se permite a través de conexiones de punto de conexión privado aprobadas.
|
enabled
|
string
|
El servicio de búsqueda es accesible desde el tráfico procedente de la red pública de Internet.
|
SearchBypass
Posibles orígenes del tráfico entrante que pueden omitir las reglas definidas en la sección "ipRules".
Nombre |
Tipo |
Description |
AzurePortal
|
string
|
Indica que las solicitudes que se originan en el Azure Portal pueden omitir las reglas definidas en la sección "ipRules".
|
None
|
string
|
Indica que ningún origen puede omitir las reglas definidas en la sección "ipRules". Este es el valor predeterminado.
|
SearchDisabledDataExfiltrationOption
Lista de escenarios de filtración de datos que no se permiten explícitamente para el servicio de búsqueda. Actualmente, el único valor admitido es "All" para deshabilitar todos los posibles escenarios de exportación de datos con controles más específicos planeados para el futuro.
Nombre |
Tipo |
Description |
All
|
string
|
Indica que todos los escenarios de filtración de datos están deshabilitados.
|
SearchEncryptionComplianceStatus
Devuelve el estado del cumplimiento del servicio de búsqueda con respecto a los objetos no cifrados por CMK. Si un servicio tiene más de un objeto sin cifrar y la aplicación está habilitada, el servicio se marca como no conforme.
Nombre |
Tipo |
Description |
Compliant
|
string
|
Indica que el servicio de búsqueda es compatible, ya sea porque el número de objetos no cifrados con CMK es cero o la aplicación está deshabilitada.
|
NonCompliant
|
string
|
Indica que el servicio de búsqueda tiene más de un objeto no cifrado con CMK.
|
SearchEncryptionWithCmk
Describe cómo un servicio de búsqueda debe aplicar el cumplimiento si encuentra objetos que no están cifrados con la clave administrada por el cliente.
Nombre |
Tipo |
Description |
Disabled
|
string
|
No se realizará ninguna aplicación del cifrado de claves administradas por el cliente. Solo se usa el cifrado administrado por el servicio integrado.
|
Enabled
|
string
|
servicio Search se marcarán como no compatibles si uno o varios objetos no están cifrados con una clave administrada por el cliente.
|
Unspecified
|
string
|
La directiva de cumplimiento no se especifica explícitamente, con el comportamiento que es el mismo que si estuviera establecido en "Deshabilitado".
|
SearchSemanticSearch
Establece las opciones que controlan la disponibilidad de la búsqueda semántica. Esta configuración solo es posible para determinadas SKU de Azure AI Search en determinadas ubicaciones.
Nombre |
Tipo |
Description |
disabled
|
string
|
Indica que el recesador semántico está deshabilitado para el servicio de búsqueda. Este es el valor predeterminado.
|
free
|
string
|
Habilita el reempleo semántico en un servicio de búsqueda e indica que se va a usar dentro de los límites del plan gratuito. El plan gratuito limitaría el volumen de solicitudes de clasificación semántica y se ofrece sin cargo adicional. Este es el valor predeterminado para los servicios de búsqueda recién aprovisionados.
|
standard
|
string
|
Habilita el reeranker semántico en un servicio de búsqueda como una característica facturable, con un mayor rendimiento y volumen de consultas semánticamente reprobadas.
|
SearchService
Describe un servicio Search de Azure AI y su estado actual.
Nombre |
Tipo |
Valor predeterminado |
Description |
id
|
string
|
|
Identificador de recurso completo del recurso. Por ejemplo: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
identity
|
Identity
|
|
Identidad del recurso.
|
location
|
string
|
|
Ubicación geográfica donde reside el recurso
|
name
|
string
|
|
Nombre del recurso.
|
properties.authOptions
|
DataPlaneAuthOptions
|
|
Define las opciones de cómo la API del plano de datos de un servicio de búsqueda autentica las solicitudes. No se puede establecer si "disableLocalAuth" está establecido en true.
|
properties.disableLocalAuth
|
boolean
|
|
Cuando se establece en true, no se permitirá que las llamadas al servicio de búsqueda usen claves de API para la autenticación. No se puede establecer en true si se definen "dataPlaneAuthOptions".
|
properties.disabledDataExfiltrationOptions
|
SearchDisabledDataExfiltrationOption[]
|
|
Lista de escenarios de filtración de datos que no se permiten explícitamente para el servicio de búsqueda. Actualmente, el único valor admitido es "All" para deshabilitar todos los posibles escenarios de exportación de datos con controles más específicos planeados para el futuro.
|
properties.eTag
|
string
|
|
Propiedad generada por el sistema que representa la etag del servicio que puede ser para el control de simultaneidad optimista durante las actualizaciones.
|
properties.encryptionWithCmk
|
EncryptionWithCmk
|
|
Especifica cualquier directiva relativa al cifrado de recursos (como índices) mediante claves de administrador de clientes dentro de un servicio de búsqueda.
|
properties.hostingMode
|
HostingMode
|
default
|
Solo se aplica a la SKU estándar3. Puede establecer esta propiedad para habilitar hasta 3 particiones de alta densidad que permitan hasta 1000 índices, que es mucho mayor que los índices máximos permitidos para cualquier otra SKU. Para la SKU estándar3, el valor es "default" o "highDensity". Para todas las demás SKU, este valor debe ser 'default'.
|
properties.networkRuleSet
|
NetworkRuleSet
|
|
Reglas específicas de red que determinan cómo se puede acceder al servicio Search de Azure AI.
|
properties.partitionCount
|
integer
|
1
|
Número de particiones en el servicio de búsqueda; si se especifica, puede ser 1, 2, 3, 4, 6 o 12. Los valores mayores que 1 solo son válidos para las SKU estándar. Para los servicios "standard3" con hostingMode establecido en "highDensity", los valores permitidos están comprendidos entre 1 y 3.
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
|
La lista de conexiones de punto de conexión privado a azure AI servicio Search.
|
properties.provisioningState
|
ProvisioningState
|
|
Estado de la última operación de aprovisionamiento realizada en el servicio de búsqueda. El aprovisionamiento es un estado intermedio que se produce cuando se está estableciendo la capacidad de servicio. Una vez configurada la capacidad, provisioningState cambia a "succeeded" o "failed". Las aplicaciones cliente pueden sondear el estado de aprovisionamiento (el intervalo de sondeo recomendado es de 30 segundos a un minuto) mediante la operación Obtener servicio de búsqueda para ver cuándo se completa una operación. Si usa el servicio gratuito, este valor tiende a volver como "correcto" directamente en la llamada a Crear servicio de búsqueda. Esto ocurre porque el servicio gratuito usa una capacidad que ya está configurada.
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
enabled
|
Este valor se puede establecer en "habilitado" para evitar cambios importantes en las plantillas y los recursos del cliente existentes. Si se establece en "deshabilitado", no se permite el tráfico a través de la interfaz pública y las conexiones de punto de conexión privado serían el método de acceso exclusivo.
|
properties.replicaCount
|
integer
|
1
|
Número de réplicas en el servicio de búsqueda. Si se especifica, debe ser un valor entre 1 y 12 inclusive para las SKU estándar o entre 1 y 3 inclusive para la SKU básica.
|
properties.semanticSearch
|
SearchSemanticSearch
|
|
Establece las opciones que controlan la disponibilidad de la búsqueda semántica. Esta configuración solo es posible para determinadas SKU de Azure AI Search en determinadas ubicaciones.
|
properties.sharedPrivateLinkResources
|
SharedPrivateLinkResource[]
|
|
La lista de recursos de vínculo privado compartidos administrados por azure AI servicio Search.
|
properties.status
|
SearchServiceStatus
|
|
Estado del servicio de búsqueda. Entre los valores posibles se incluyen: "en ejecución": el servicio de búsqueda se está ejecutando y no hay ninguna operación de aprovisionamiento en curso. 'aprovisionamiento': el servicio de búsqueda se está aprovisionando o escalando vertical o verticalmente. 'eliminar': se está eliminando el servicio de búsqueda. 'degradado': el servicio de búsqueda está degradado. Esto puede ocurrir cuando las unidades de búsqueda subyacentes no están en buen estado. Es más probable que el servicio de búsqueda esté operativo, pero el rendimiento podría ser lento y algunas solicitudes podrían quitarse. 'disabled': el servicio de búsqueda está deshabilitado. En este estado, el servicio rechazará todas las solicitudes de API. 'error': el servicio de búsqueda está en estado de error. 'Detenido': el servicio de búsqueda está en una suscripción deshabilitada. Si el servicio está en los estados degradados, deshabilitados o de error, significa que el equipo de Azure AI Search está investigando activamente el problema subyacente. En estos estados, los servicios dedicados son todavía facturables en función del número de unidades de búsqueda aprovisionado.
|
properties.statusDetails
|
string
|
|
Detalles del estado del servicio de búsqueda.
|
sku
|
Sku
|
|
La SKU del servicio de búsqueda, que determina los límites de nivel de precio y capacidad. Esta propiedad es necesaria al crear un nuevo servicio de búsqueda.
|
tags
|
object
|
|
Etiquetas del recurso.
|
type
|
string
|
|
Tipo de recurso. Por ejemplo, "Microsoft.Compute/virtualMachines" o "Microsoft.Storage/storageAccounts"
|
SearchServiceStatus
Estado del servicio de búsqueda. Entre los valores posibles se incluyen: "en ejecución": el servicio de búsqueda se está ejecutando y no hay ninguna operación de aprovisionamiento en curso. 'aprovisionamiento': el servicio de búsqueda se está aprovisionando o escalando vertical o verticalmente. 'eliminar': se está eliminando el servicio de búsqueda. 'degradado': el servicio de búsqueda está degradado. Esto puede ocurrir cuando las unidades de búsqueda subyacentes no están en buen estado. Es más probable que el servicio de búsqueda esté operativo, pero el rendimiento podría ser lento y algunas solicitudes podrían quitarse. 'disabled': el servicio de búsqueda está deshabilitado. En este estado, el servicio rechazará todas las solicitudes de API. 'error': el servicio de búsqueda está en estado de error. 'Detenido': el servicio de búsqueda está en una suscripción deshabilitada. Si el servicio está en los estados degradados, deshabilitados o de error, significa que el equipo de Azure AI Search está investigando activamente el problema subyacente. En estos estados, los servicios dedicados son todavía facturables en función del número de unidades de búsqueda aprovisionado.
Nombre |
Tipo |
Description |
degraded
|
string
|
El servicio de búsqueda se degrada porque las unidades de búsqueda subyacentes no están en buen estado.
|
deleting
|
string
|
Se está eliminando el servicio de búsqueda.
|
disabled
|
string
|
El servicio de búsqueda está deshabilitado y se rechazarán todas las solicitudes de API.
|
error
|
string
|
El servicio de búsqueda está en estado de error, lo que indica un error al aprovisionar o eliminarse.
|
provisioning
|
string
|
El servicio de búsqueda se aprovisiona o se escala o reduce verticalmente.
|
running
|
string
|
El servicio de búsqueda se está ejecutando y no hay ninguna operación de aprovisionamiento en curso.
|
stopped
|
string
|
El servicio de búsqueda está en una suscripción deshabilitada.
|
SharedPrivateLinkResource
Describe un recurso de vínculo privado compartido administrado por azure AI servicio Search.
Nombre |
Tipo |
Description |
id
|
string
|
Identificador de recurso completo del recurso. Por ejemplo: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
Nombre del recurso.
|
properties
|
SharedPrivateLinkResourceProperties
|
Describe las propiedades de un recurso de vínculo privado compartido administrado por el servicio Search de Azure AI.
|
type
|
string
|
Tipo de recurso. Por ejemplo, "Microsoft.Compute/virtualMachines" o "Microsoft.Storage/storageAccounts"
|
SharedPrivateLinkResourceProperties
Describe las propiedades de un recurso de vínculo privado compartido existente administrado por azure AI servicio Search.
Nombre |
Tipo |
Description |
groupId
|
string
|
El identificador de grupo del proveedor del recurso para el que está el recurso de vínculo privado compartido.
|
privateLinkResourceId
|
string
|
Identificador de recurso del recurso para el que está el recurso de vínculo privado compartido.
|
provisioningState
|
SharedPrivateLinkResourceProvisioningState
|
Estado de aprovisionamiento del recurso de vínculo privado compartido. Los valores válidos son Actualizar, Eliminar, Error, Correcto o Incompleto.
|
requestMessage
|
string
|
Mensaje para solicitar la aprobación del recurso de vínculo privado compartido.
|
resourceRegion
|
string
|
Opcional. Se puede usar para especificar la ubicación de Azure Resource Manager del recurso para el que se va a crear un vínculo privado compartido. Esto solo es necesario para aquellos recursos cuya configuración dns sea regional (por ejemplo, Azure Kubernetes Service).
|
status
|
SharedPrivateLinkResourceStatus
|
Estado del recurso de vínculo privado compartido. Los valores válidos son Pendiente, Aprobado, Rechazado o Desconectado.
|
SharedPrivateLinkResourceProvisioningState
Estado de aprovisionamiento del recurso de vínculo privado compartido. Los valores válidos son Actualización, Eliminación, Error, Correcto o Incompleto.
Nombre |
Tipo |
Description |
Deleting
|
string
|
El recurso de vínculo privado compartido está en proceso de eliminación.
|
Failed
|
string
|
No se pudo aprovisionar o eliminar el recurso de vínculo privado compartido.
|
Incomplete
|
string
|
Se ha aceptado la solicitud de aprovisionamiento para el recurso de vínculo privado compartido, pero el proceso de creación aún no ha comenzado.
|
Succeeded
|
string
|
El recurso de vínculo privado compartido ha terminado de aprovisionar y está listo para su aprobación.
|
Updating
|
string
|
El recurso de vínculo privado compartido está en proceso de creación junto con otros recursos para que sea totalmente funcional.
|
SharedPrivateLinkResourceStatus
Estado del recurso de vínculo privado compartido. Los valores válidos son Pendiente, Aprobado, Rechazado o Desconectado.
Nombre |
Tipo |
Description |
Approved
|
string
|
El recurso de vínculo privado compartido se aprueba y está listo para su uso.
|
Disconnected
|
string
|
El recurso de vínculo privado compartido se ha quitado del servicio.
|
Pending
|
string
|
Se ha creado el recurso de vínculo privado compartido y está pendiente de aprobación.
|
Rejected
|
string
|
El recurso de vínculo privado compartido se ha rechazado y no se puede usar.
|
Sku
Define la SKU de un servicio de búsqueda, que determina la tasa de facturación y los límites de capacidad.
Nombre |
Tipo |
Description |
name
|
SkuName
|
SKU del servicio de búsqueda. Los valores válidos incluyen: "gratis": servicio compartido. 'basic': servicio dedicado con hasta 3 réplicas. 'estándar': servicio dedicado con hasta 12 particiones y 12 réplicas. 'standard2': similar al estándar, pero con más capacidad por unidad de búsqueda. 'standard3': la oferta estándar más grande con hasta 12 particiones y 12 réplicas (o hasta 3 particiones con más índices si también establece la propiedad hostingMode en 'highDensity'). 'storage_optimized_l1': admite 1 TB por partición, hasta 12 particiones. "storage_optimized_l2": admite 2 TB por partición, hasta 12 particiones".
|
SkuName
SKU del servicio de búsqueda. Los valores válidos incluyen: "gratis": servicio compartido. 'basic': servicio dedicado con hasta 3 réplicas. 'estándar': servicio dedicado con hasta 12 particiones y 12 réplicas. 'standard2': similar al estándar, pero con más capacidad por unidad de búsqueda. 'standard3': la oferta estándar más grande con hasta 12 particiones y 12 réplicas (o hasta 3 particiones con más índices si también establece la propiedad hostingMode en 'highDensity'). 'storage_optimized_l1': admite 1 TB por partición, hasta 12 particiones. "storage_optimized_l2": admite 2 TB por partición, hasta 12 particiones".
Nombre |
Tipo |
Description |
basic
|
string
|
Nivel facturable para un servicio dedicado que tiene hasta 3 réplicas.
|
free
|
string
|
Nivel gratis, sin garantías de Acuerdo de Nivel de Servicio y un subconjunto de las características que se ofrecen en los niveles facturables.
|
standard
|
string
|
Nivel facturable para un servicio dedicado que tiene hasta 12 particiones y 12 réplicas.
|
standard2
|
string
|
Similar a "estándar", pero con más capacidad por unidad de búsqueda.
|
standard3
|
string
|
La oferta estándar más grande con hasta 12 particiones y 12 réplicas (o hasta 3 particiones con más índices si también establece la propiedad hostingMode en "highDensity").
|
storage_optimized_l1
|
string
|
Nivel facturable para un servicio dedicado que admite 1 TB por partición, hasta 12 particiones.
|
storage_optimized_l2
|
string
|
Nivel facturable para un servicio dedicado que admite 2 TB por partición, hasta 12 particiones.
|
UserAssignedManagedIdentity
Los detalles de la identidad administrada asignada por el usuario asignada al servicio de búsqueda.
Nombre |
Tipo |
Description |
clientId
|
string
|
Identificador de cliente de la identidad asignada por el usuario.
|
principalId
|
string
|
Identificador principal de la identidad asignada por el usuario.
|