Hiermee wordt een zoekservice in de opgegeven resourcegroep gemaakt of bijgewerkt. Als de zoekservice al bestaat, worden alle eigenschappen bijgewerkt met de opgegeven waarden.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}?api-version=2023-11-01
URI-parameters
Name |
In |
Vereist |
Type |
Description |
resourceGroupName
|
path |
True
|
string
|
De naam van de resourcegroep binnen het huidige abonnement. U kunt deze waarde verkrijgen via de Azure Resource Manager-API of de portal.
|
searchServiceName
|
path |
True
|
string
|
De naam van de zoekservice die moet worden gemaakt of bijgewerkt. Search-service namen mogen alleen kleine letters, cijfers of streepjes bevatten, mogen geen streepjes gebruiken als de eerste twee of laatste tekens, mogen geen opeenvolgende streepjes bevatten en moeten tussen 2 en 60 tekens lang zijn. Search-service namen moeten wereldwijd uniek zijn omdat ze deel uitmaken van de service-URI (https://.search.windows.net). U kunt de servicenaam niet wijzigen nadat de service is gemaakt.
|
subscriptionId
|
path |
True
|
string
|
De unieke id voor een Microsoft Azure-abonnement. U kunt deze waarde verkrijgen via de Azure Resource Manager-API, opdrachtregelprogramma's of de portal.
|
api-version
|
query |
True
|
string
|
De API-versie die voor elke aanvraag moet worden gebruikt.
|
Name |
Vereist |
Type |
Description |
x-ms-client-request-id
|
|
string
uuid
|
Een door de client gegenereerde GUID-waarde die deze aanvraag identificeert. Indien opgegeven, wordt dit opgenomen in de antwoordinformatie als een manier om de aanvraag bij te houden.
|
Aanvraagbody
Name |
Vereist |
Type |
Description |
location
|
True
|
string
|
De geografische locatie waar de resource zich bevindt
|
identity
|
|
Identity
|
De identiteit van de resource.
|
properties.authOptions
|
|
DataPlaneAuthOptions
|
Definieert de opties voor de wijze waarop de gegevensvlak-API van een zoekservice aanvragen verifieert. Dit kan niet worden ingesteld als 'disableLocalAuth' is ingesteld op true.
|
properties.disableLocalAuth
|
|
boolean
|
Als deze optie is ingesteld op true, mogen aanroepen naar de zoekservice geen API-sleutels gebruiken voor verificatie. Dit kan niet worden ingesteld op true als 'dataPlaneAuthOptions' is gedefinieerd.
|
properties.encryptionWithCmk
|
|
EncryptionWithCmk
|
Hiermee geeft u elk beleid met betrekking tot het versleutelen van resources (zoals indexen) met behulp van klantmanagersleutels binnen een zoekservice.
|
properties.hostingMode
|
|
HostingMode
|
Alleen van toepassing op de standard3-SKU. U kunt deze eigenschap instellen om maximaal 3 high-densitypartities in te schakelen die maximaal 1000 indexen toestaan, wat veel hoger is dan het maximum aantal indexen dat is toegestaan voor een andere SKU. Voor de standard3-SKU is de waarde 'default' of 'highDensity'. Voor alle andere SKU's moet deze waarde 'standaard' zijn.
|
properties.networkRuleSet
|
|
NetworkRuleSet
|
Netwerkspecifieke regels die bepalen hoe de zoekservice kan worden bereikt.
|
properties.partitionCount
|
|
integer
|
Het aantal partities in de zoekservice; indien opgegeven, kan dit 1, 2, 3, 4, 6 of 12 zijn. Waarden groter dan 1 zijn alleen geldig voor standaard-SKU's. Voor 'standard3'-services waarbij hostingMode is ingesteld op 'highDensity', liggen de toegestane waarden tussen 1 en 3.
|
properties.publicNetworkAccess
|
|
PublicNetworkAccess
|
Deze waarde kan worden ingesteld op 'ingeschakeld' om te voorkomen dat wijzigingen in bestaande klantresources en sjablonen fouten veroorzaken. Als deze optie is ingesteld op uitgeschakeld, is verkeer via de openbare interface niet toegestaan en zijn privé-eindpuntverbindingen de exclusieve toegangsmethode.
|
properties.replicaCount
|
|
integer
|
Het aantal replica's in de zoekservice. Indien opgegeven, moet dit een waarde zijn tussen 1 en 12 voor standaard-SKU's of tussen 1 en 3 voor de Basis-SKU.
|
properties.semanticSearch
|
|
SearchSemanticSearch
|
Hiermee stelt u opties in die de beschikbaarheid van semantisch zoeken bepalen. Deze configuratie is alleen mogelijk voor bepaalde zoek-SKU's op bepaalde locaties.
|
sku
|
|
Sku
|
De SKU van de zoekservice, die de factureringssnelheid en capaciteitslimieten bepaalt. Deze eigenschap is vereist bij het maken van een nieuwe zoekservice.
|
tags
|
|
object
|
Resourcetags.
|
Antwoorden
Name |
Type |
Description |
200 OK
|
SearchService
|
De bestaande servicedefinitie is bijgewerkt. Als u het aantal replica's of partities hebt gewijzigd, wordt de schaalbewerking asynchroon uitgevoerd. U kunt periodiek uw servicedefinitie ophalen en de voortgang bewaken via de eigenschap provisioningState.
|
201 Created
|
SearchService
|
Als u het maken van een gratis zoekservice hebt aangevraagd, is de service nu ingericht en klaar voor gebruik, afhankelijk van vertraging bij dns-doorgifte. Voor andere SKU-typen vindt het inrichten asynchroon plaats. U kunt periodiek uw servicedefinitie ophalen en de voortgang bewaken via de eigenschap provisioningState.
|
Other Status Codes
|
CloudError
|
HTTP 400 (ongeldige aanvraag): de opgegeven servicenaam of servicedefinitie is ongeldig; Zie de foutcode en het bericht in het antwoord voor meer informatie. HTTP 404 (niet gevonden): het abonnement of de resourcegroep kan niet worden gevonden. HTTP 409 (conflict): het opgegeven abonnement is uitgeschakeld.
|
Beveiliging
azure_auth
Microsoft Entra ID OAuth2-autorisatiestroom.
Type:
oauth2
Stroom:
implicit
Autorisatie-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiken
Name |
Description |
user_impersonation
|
Uw gebruikersaccount imiteren
|
Voorbeelden
SearchCreateOrUpdateService
Voorbeeldaanvraag
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2023-11-01
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default"
}
}
import com.azure.resourcemanager.search.fluent.models.SearchServiceInner;
import com.azure.resourcemanager.search.models.HostingMode;
import com.azure.resourcemanager.search.models.Sku;
import com.azure.resourcemanager.search.models.SkuName;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateService.
* json
*/
/**
* Sample code: SearchCreateOrUpdateService.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchCreateOrUpdateService(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().createOrUpdate("rg1", "mysearchservice",
new SearchServiceInner().withLocation("westus").withTags(mapOf("app-name", "My e-commerce app"))
.withSku(new Sku().withName(SkuName.STANDARD)).withReplicaCount(3).withPartitionCount(1)
.withHostingMode(HostingMode.DEFAULT),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_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/stable/2023-11-01/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/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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{
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// 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),
// 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/stable/2023-11-01/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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search;
using Azure.ResourceManager.Search.Models;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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"))
{
SkuName = SearchSkuName.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
Voorbeeldrespons
{
"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": []
},
"privateEndpointConnections": []
}
}
{
"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": []
},
"privateEndpointConnections": []
}
}
SearchCreateOrUpdateServiceAuthOptions
Voorbeeldaanvraag
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2023-11-01
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default",
"authOptions": {
"aadOrApiKey": {
"aadAuthFailureMode": "http401WithBearerChallenge"
}
}
}
}
import com.azure.resourcemanager.search.fluent.models.SearchServiceInner;
import com.azure.resourcemanager.search.models.AadAuthFailureMode;
import com.azure.resourcemanager.search.models.DataPlaneAadOrApiKeyAuthOption;
import com.azure.resourcemanager.search.models.DataPlaneAuthOptions;
import com.azure.resourcemanager.search.models.HostingMode;
import com.azure.resourcemanager.search.models.Sku;
import com.azure.resourcemanager.search.models.SkuName;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/
* SearchCreateOrUpdateServiceAuthOptions.json
*/
/**
* Sample code: SearchCreateOrUpdateServiceAuthOptions.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchCreateOrUpdateServiceAuthOptions(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().createOrUpdate("rg1", "mysearchservice",
new SearchServiceInner().withLocation("westus").withTags(mapOf("app-name", "My e-commerce app"))
.withSku(new Sku().withName(SkuName.STANDARD)).withReplicaCount(3).withPartitionCount(1)
.withHostingMode(HostingMode.DEFAULT)
.withAuthOptions(new DataPlaneAuthOptions().withAadOrApiKey(new DataPlaneAadOrApiKeyAuthOption()
.withAadAuthFailureMode(AadAuthFailureMode.HTTP401WITH_BEARER_CHALLENGE))),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_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/stable/2023-11-01/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/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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),
// },
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](3),
// 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/stable/2023-11-01/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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search;
using Azure.ResourceManager.Search.Models;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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"))
{
SkuName = SearchSkuName.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
Voorbeeldrespons
{
"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": []
},
"authOptions": {
"aadOrApiKey": {
"aadAuthFailureMode": "http401WithBearerChallenge"
}
}
}
}
{
"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": []
},
"authOptions": {
"aadOrApiKey": {
"aadAuthFailureMode": "http401WithBearerChallenge"
}
}
}
}
SearchCreateOrUpdateServiceDisableLocalAuth
Voorbeeldaanvraag
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2023-11-01
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default",
"disableLocalAuth": true
}
}
import com.azure.resourcemanager.search.fluent.models.SearchServiceInner;
import com.azure.resourcemanager.search.models.HostingMode;
import com.azure.resourcemanager.search.models.Sku;
import com.azure.resourcemanager.search.models.SkuName;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/
* SearchCreateOrUpdateServiceDisableLocalAuth.json
*/
/**
* Sample code: SearchCreateOrUpdateServiceDisableLocalAuth.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
searchCreateOrUpdateServiceDisableLocalAuth(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().createOrUpdate("rg1", "mysearchservice",
new SearchServiceInner().withLocation("westus").withTags(mapOf("app-name", "My e-commerce app"))
.withSku(new Sku().withName(SkuName.STANDARD)).withReplicaCount(3).withPartitionCount(1)
.withHostingMode(HostingMode.DEFAULT).withDisableLocalAuth(true),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_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/stable/2023-11-01/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/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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),
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](3),
// 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/stable/2023-11-01/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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search;
using Azure.ResourceManager.Search.Models;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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"))
{
SkuName = SearchSkuName.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
Voorbeeldrespons
{
"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": []
},
"disableLocalAuth": true,
"authOptions": null
}
}
{
"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": []
},
"disableLocalAuth": true,
"authOptions": null
}
}
SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints
Voorbeeldaanvraag
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2023-11-01
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"publicNetworkAccess": "disabled",
"hostingMode": "default"
}
}
import com.azure.resourcemanager.search.fluent.models.SearchServiceInner;
import com.azure.resourcemanager.search.models.HostingMode;
import com.azure.resourcemanager.search.models.PublicNetworkAccess;
import com.azure.resourcemanager.search.models.Sku;
import com.azure.resourcemanager.search.models.SkuName;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/
* SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json
*/
/**
* Sample code: SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().createOrUpdate("rg1", "mysearchservice",
new SearchServiceInner().withLocation("westus").withTags(mapOf("app-name", "My e-commerce app"))
.withSku(new Sku().withName(SkuName.STANDARD)).withReplicaCount(3).withPartitionCount(1)
.withHostingMode(HostingMode.DEFAULT).withPublicNetworkAccess(PublicNetworkAccess.DISABLED),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_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/stable/2023-11-01/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/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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{
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// 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),
// 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/stable/2023-11-01/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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search;
using Azure.ResourceManager.Search.Models;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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"))
{
SkuName = SearchSkuName.Standard,
ReplicaCount = 3,
PartitionCount = 1,
HostingMode = SearchServiceHostingMode.Default,
PublicNetworkAccess = SearchServicePublicNetworkAccess.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
Voorbeeldrespons
{
"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": []
},
"privateEndpointConnections": []
}
}
{
"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": []
},
"privateEndpointConnections": []
}
}
SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs
Voorbeeldaanvraag
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2023-11-01
{
"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"
}
}
import com.azure.resourcemanager.search.fluent.models.SearchServiceInner;
import com.azure.resourcemanager.search.models.HostingMode;
import com.azure.resourcemanager.search.models.IpRule;
import com.azure.resourcemanager.search.models.NetworkRuleSet;
import com.azure.resourcemanager.search.models.Sku;
import com.azure.resourcemanager.search.models.SkuName;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/
* SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json
*/
/**
* Sample code: SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().createOrUpdate("rg1", "mysearchservice",
new SearchServiceInner().withLocation("westus").withTags(mapOf("app-name", "My e-commerce app"))
.withSku(new Sku().withName(SkuName.STANDARD)).withReplicaCount(1).withPartitionCount(1)
.withHostingMode(HostingMode.DEFAULT)
.withNetworkRuleSet(new NetworkRuleSet().withIpRules(
Arrays.asList(new IpRule().withValue("123.4.5.6"), new IpRule().withValue("123.4.6.0/18")))),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_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/stable/2023-11-01/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/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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{
// 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),
// 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/stable/2023-11-01/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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search;
using Azure.ResourceManager.Search.Models;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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"))
{
SkuName = SearchSkuName.Standard,
ReplicaCount = 1,
PartitionCount = 1,
HostingMode = SearchServiceHostingMode.Default,
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
Voorbeeldrespons
{
"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": []
}
}
{
"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": []
}
}
SearchCreateOrUpdateServiceWithCmkEnforcement
Voorbeeldaanvraag
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2023-11-01
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default",
"encryptionWithCmk": {
"enforcement": "Enabled"
}
}
}
import com.azure.resourcemanager.search.fluent.models.SearchServiceInner;
import com.azure.resourcemanager.search.models.EncryptionWithCmk;
import com.azure.resourcemanager.search.models.HostingMode;
import com.azure.resourcemanager.search.models.SearchEncryptionWithCmk;
import com.azure.resourcemanager.search.models.Sku;
import com.azure.resourcemanager.search.models.SkuName;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/
* SearchCreateOrUpdateServiceWithCmkEnforcement.json
*/
/**
* Sample code: SearchCreateOrUpdateServiceWithCmkEnforcement.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
searchCreateOrUpdateServiceWithCmkEnforcement(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().createOrUpdate("rg1", "mysearchservice",
new SearchServiceInner().withLocation("westus").withTags(mapOf("app-name", "My e-commerce app"))
.withSku(new Sku().withName(SkuName.STANDARD)).withReplicaCount(3).withPartitionCount(1)
.withHostingMode(HostingMode.DEFAULT)
.withEncryptionWithCmk(new EncryptionWithCmk().withEnforcement(SearchEncryptionWithCmk.ENABLED)),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_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/stable/2023-11-01/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/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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),
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// 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/stable/2023-11-01/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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search;
using Azure.ResourceManager.Search.Models;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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"))
{
SkuName = SearchSkuName.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
Voorbeeldrespons
{
"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": []
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Enabled",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
}
}
}
{
"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": []
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Enabled",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
}
}
}
SearchCreateOrUpdateServiceWithIdentity
Voorbeeldaanvraag
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2023-11-01
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default"
},
"identity": {
"type": "SystemAssigned"
}
}
import com.azure.resourcemanager.search.fluent.models.SearchServiceInner;
import com.azure.resourcemanager.search.models.HostingMode;
import com.azure.resourcemanager.search.models.Identity;
import com.azure.resourcemanager.search.models.IdentityType;
import com.azure.resourcemanager.search.models.Sku;
import com.azure.resourcemanager.search.models.SkuName;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/
* SearchCreateOrUpdateServiceWithIdentity.json
*/
/**
* Sample code: SearchCreateOrUpdateServiceWithIdentity.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchCreateOrUpdateServiceWithIdentity(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().createOrUpdate("rg1", "mysearchservice",
new SearchServiceInner().withLocation("westus").withTags(mapOf("app-name", "My e-commerce app"))
.withSku(new Sku().withName(SkuName.STANDARD))
.withIdentity(new Identity().withType(IdentityType.SYSTEM_ASSIGNED)).withReplicaCount(3)
.withPartitionCount(1).withHostingMode(HostingMode.DEFAULT),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_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"},
"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/stable/2023-11-01/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/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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.IdentityTypeSystemAssigned),
},
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.IdentityTypeSystemAssigned),
// PrincipalID: to.Ptr("9d1e1f18-2122-4988-a11c-878782e40a5c"),
// TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"),
// },
// Properties: &armsearch.ServiceProperties{
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// 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),
// 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/stable/2023-11-01/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" },
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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search;
using Azure.ResourceManager.Search.Models;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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"))
{
SkuName = SearchSkuName.Standard,
Identity = new ManagedServiceIdentity("SystemAssigned"),
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
Voorbeeldrespons
{
"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": []
},
"privateEndpointConnections": []
},
"identity": {
"type": "SystemAssigned",
"principalId": "9d1e1f18-2122-4988-a11c-878782e40a5c",
"tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd"
}
}
{
"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": []
},
"privateEndpointConnections": []
},
"identity": {
"type": "SystemAssigned",
"principalId": "9d1e1f18-2122-4988-a11c-878782e40a5c",
"tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd"
}
}
SearchCreateOrUpdateWithSemanticSearch
Voorbeeldaanvraag
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2023-11-01
{
"location": "westus",
"tags": {
"app-name": "My e-commerce app"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"hostingMode": "default",
"semanticSearch": "free"
}
}
import com.azure.resourcemanager.search.fluent.models.SearchServiceInner;
import com.azure.resourcemanager.search.models.HostingMode;
import com.azure.resourcemanager.search.models.SearchSemanticSearch;
import com.azure.resourcemanager.search.models.Sku;
import com.azure.resourcemanager.search.models.SkuName;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Services CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/
* SearchCreateOrUpdateWithSemanticSearch.json
*/
/**
* Sample code: SearchCreateOrUpdateWithSemanticSearch.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void searchCreateOrUpdateWithSemanticSearch(com.azure.resourcemanager.AzureResourceManager azure) {
azure.searchServices().manager().serviceClient().getServices().createOrUpdate("rg1", "mysearchservice",
new SearchServiceInner().withLocation("westus").withTags(mapOf("app-name", "My e-commerce app"))
.withSku(new Sku().withName(SkuName.STANDARD)).withReplicaCount(3).withPartitionCount(1)
.withHostingMode(HostingMode.DEFAULT).withSemanticSearch(SearchSemanticSearch.FREE),
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_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/stable/2023-11-01/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/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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),
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// 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/stable/2023-11-01/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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search;
using Azure.ResourceManager.Search.Models;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/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"))
{
SkuName = SearchSkuName.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
Voorbeeldrespons
{
"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": []
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"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": []
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"semanticSearch": "free"
}
}
Definities
Name |
Description |
AadAuthFailureMode
|
Beschrijft welk antwoord de gegevensvlak-API van een zoekservice verzendt voor aanvragen waarvoor de verificatie is mislukt.
|
ApiKeyOnly
|
Geeft aan dat alleen de API-sleutel kan worden gebruikt voor verificatie.
|
CloudError
|
Bevat informatie over een API-fout.
|
CloudErrorBody
|
Beschrijft een bepaalde API-fout met een foutcode en een bericht.
|
DataPlaneAadOrApiKeyAuthOption
|
Geeft aan dat de API-sleutel of een toegangstoken van een Microsoft Entra ID tenant kan worden gebruikt voor verificatie.
|
DataPlaneAuthOptions
|
Definieert de opties voor de wijze waarop de zoekservice een aanvraag voor een gegevensvlak verifieert. Dit kan niet worden ingesteld als 'disableLocalAuth' is ingesteld op true.
|
EncryptionWithCmk
|
Beschrijft een beleid dat bepaalt hoe resources binnen de zoekservice moeten worden versleuteld met door de klant beheerde sleutels.
|
HostingMode
|
Alleen van toepassing op de standard3-SKU. U kunt deze eigenschap instellen om maximaal 3 high-densitypartities in te schakelen die maximaal 1000 indexen toestaan, wat veel hoger is dan het maximum aantal indexen dat is toegestaan voor een andere SKU. Voor de standard3-SKU is de waarde 'default' of 'highDensity'. Voor alle andere SKU's moet deze waarde 'standaard' zijn.
|
Identity
|
Identiteit voor de resource.
|
IdentityType
|
Het identiteitstype.
|
IpRule
|
De IP-beperkingsregel van de zoekservice.
|
NetworkRuleSet
|
Netwerkspecifieke regels die bepalen hoe de zoekservice kan worden bereikt.
|
PrivateEndpoint
|
De resource van het privé-eindpunt van de Microsoft.Network-provider.
|
PrivateEndpointConnection
|
Beschrijft een bestaande privé-eindpuntverbinding met de zoekservice.
|
PrivateEndpointConnectionProperties
|
Beschrijft de eigenschappen van een bestaande privé-eindpuntverbinding met de zoekservice.
|
PrivateLinkServiceConnectionProvisioningState
|
De inrichtingsstatus van de private link-serviceverbinding. Geldige waarden zijn Bijwerken, Verwijderen, Mislukt, Geslaagd of Onvolledig
|
PrivateLinkServiceConnectionState
|
Beschrijft de huidige status van een bestaande Private Link Service-verbinding met het azure-privé-eindpunt.
|
PrivateLinkServiceConnectionStatus
|
Status van de private link-serviceverbinding. Geldige waarden zijn In behandeling, Goedgekeurd, Geweigerd of Verbroken.
|
ProvisioningState
|
De status van de laatste inrichtingsbewerking die is uitgevoerd op de zoekservice. Inrichten is een tussenliggende status die optreedt terwijl de servicecapaciteit wordt ingesteld. Nadat de capaciteit is ingesteld, wordt provisioningState gewijzigd in 'succeeded' of 'failed'. Clienttoepassingen kunnen de inrichtingsstatus peilen (het aanbevolen pollinginterval is van 30 seconden tot één minuut) met behulp van de bewerking Zoekservice ophalen om te zien wanneer een bewerking is voltooid. Als u de gratis service gebruikt, komt deze waarde meestal rechtstreeks terug als 'geslaagd' in de aanroep naar Zoekservice maken. Dit komt doordat de gratis service gebruikmaakt van capaciteit die al is ingesteld.
|
PublicNetworkAccess
|
Deze waarde kan worden ingesteld op 'ingeschakeld' om te voorkomen dat wijzigingen in bestaande klantresources en sjablonen fouten veroorzaken. Als deze optie is ingesteld op uitgeschakeld, is verkeer via de openbare interface niet toegestaan en zijn privé-eindpuntverbindingen de exclusieve toegangsmethode.
|
SearchEncryptionComplianceStatus
|
Beschrijft of de zoekservice al dan niet compatibel is met betrekking tot niet-door de klant versleutelde resources. Als een service meer dan één niet-door de klant versleutelde resource heeft en Afdwinging is ingeschakeld, wordt de service gemarkeerd als niet-compatibel.
|
SearchEncryptionWithCmk
|
Hierin wordt beschreven hoe een zoekservice het gebruik van een of meer niet door de klant versleutelde resources moet afdwingen.
|
SearchSemanticSearch
|
Hiermee stelt u opties in die de beschikbaarheid van semantisch zoeken bepalen. Deze configuratie is alleen mogelijk voor bepaalde zoek-SKU's op bepaalde locaties.
|
SearchService
|
Beschrijft een zoekservice en de huidige status.
|
SearchServiceStatus
|
De status van de zoekservice. Mogelijke waarden zijn: 'wordt uitgevoerd': de zoekservice wordt uitgevoerd en er worden geen inrichtingsbewerkingen uitgevoerd. 'inrichting': de zoekservice wordt ingericht of omhoog of omlaag geschaald. 'verwijderen': de zoekservice wordt verwijderd. 'gedegradeerd': de zoekservice is gedegradeerd. Dit kan gebeuren wanneer de onderliggende zoekeenheden niet in orde zijn. De zoekservice is waarschijnlijk operationeel, maar de prestaties kunnen traag zijn en sommige aanvragen kunnen worden verwijderd. 'disabled': de zoekservice is uitgeschakeld. In deze status weigert de service alle API-aanvragen. 'fout': de zoekservice heeft een foutstatus. Als uw service de status gedegradeerd, uitgeschakeld of fout heeft, onderzoekt Microsoft het onderliggende probleem actief. Toegewezen services in deze statussen worden nog steeds in rekening gebracht op basis van het aantal ingerichte zoekeenheden.
|
SharedPrivateLinkResource
|
Beschrijft een gedeelde Private Link resource die wordt beheerd door de zoekservice.
|
SharedPrivateLinkResourceProperties
|
Beschrijft de eigenschappen van een bestaande gedeelde Private Link resource die wordt beheerd door de zoekservice.
|
SharedPrivateLinkResourceProvisioningState
|
De inrichtingsstatus van de gedeelde Private Link-resource. Geldige waarden zijn Bijwerken, Verwijderen, Mislukt, Geslaagd of Onvolledig.
|
SharedPrivateLinkResourceStatus
|
Status van de gedeelde Private Link-resource. Geldige waarden zijn In behandeling, Goedgekeurd, Geweigerd of Verbroken.
|
Sku
|
Hiermee definieert u de SKU van een zoekservice, waarmee de factureringssnelheid en capaciteitslimieten worden bepaald.
|
SkuName
|
De SKU van de zoekservice. Geldige waarden zijn onder andere: 'gratis': Gedeelde service. 'basic': toegewezen service met maximaal 3 replica's. 'standaard': toegewezen service met maximaal 12 partities en 12 replica's. 'standard2': vergelijkbaar met standard, maar met meer capaciteit per zoekeenheid. 'standard3': het grootste Standard-aanbod met maximaal 12 partities en 12 replica's (of maximaal 3 partities met meer indexen als u ook de eigenschap hostingMode instelt op 'highDensity'). 'storage_optimized_l1': ondersteunt 1 TB per partitie, maximaal 12 partities. 'storage_optimized_l2': ondersteunt 2 TB per partitie, maximaal 12 partities.'
|
AadAuthFailureMode
Beschrijft welk antwoord de gegevensvlak-API van een zoekservice verzendt voor aanvragen waarvoor de verificatie is mislukt.
Name |
Type |
Description |
http401WithBearerChallenge
|
string
|
Hiermee wordt aangegeven dat aanvragen waarvoor de verificatie is mislukt, moeten worden weergegeven met de HTTP-statuscode 401 (Niet geautoriseerd) en een Bearer-uitdaging moeten presenteren.
|
http403
|
string
|
Geeft aan dat aanvragen waarvoor de verificatie is mislukt, moeten worden weergegeven met de HTTP-statuscode 403 (Verboden).
|
ApiKeyOnly
Geeft aan dat alleen de API-sleutel kan worden gebruikt voor verificatie.
CloudError
Bevat informatie over een API-fout.
Name |
Type |
Description |
error
|
CloudErrorBody
|
Beschrijft een bepaalde API-fout met een foutcode en een bericht.
|
CloudErrorBody
Beschrijft een bepaalde API-fout met een foutcode en een bericht.
Name |
Type |
Description |
code
|
string
|
Een foutcode die de foutvoorwaarde nauwkeuriger beschrijft dan een HTTP-statuscode. Kan worden gebruikt voor het programmatisch afhandelen van specifieke foutgevallen.
|
details
|
CloudErrorBody[]
|
Bevat geneste fouten die betrekking hebben op deze fout.
|
message
|
string
|
Een bericht met een gedetailleerde beschrijving van de fout en informatie over foutopsporing.
|
target
|
string
|
Het doel van de specifieke fout (bijvoorbeeld de naam van de eigenschap in fout).
|
DataPlaneAadOrApiKeyAuthOption
Geeft aan dat de API-sleutel of een toegangstoken van een Microsoft Entra ID tenant kan worden gebruikt voor verificatie.
Name |
Type |
Description |
aadAuthFailureMode
|
AadAuthFailureMode
|
Beschrijft welk antwoord de gegevensvlak-API van een zoekservice verzendt voor aanvragen waarvoor de verificatie is mislukt.
|
DataPlaneAuthOptions
Definieert de opties voor de wijze waarop de zoekservice een aanvraag voor een gegevensvlak verifieert. Dit kan niet worden ingesteld als 'disableLocalAuth' is ingesteld op true.
Name |
Type |
Description |
aadOrApiKey
|
DataPlaneAadOrApiKeyAuthOption
|
Geeft aan dat de API-sleutel of een toegangstoken van een Microsoft Entra ID tenant kan worden gebruikt voor verificatie.
|
apiKeyOnly
|
ApiKeyOnly
|
Geeft aan dat alleen de API-sleutel kan worden gebruikt voor verificatie.
|
EncryptionWithCmk
Beschrijft een beleid dat bepaalt hoe resources binnen de zoekservice moeten worden versleuteld met door de klant beheerde sleutels.
Name |
Type |
Description |
encryptionComplianceStatus
|
SearchEncryptionComplianceStatus
|
Beschrijft of de zoekservice al dan niet compatibel is met betrekking tot niet-door de klant versleutelde resources. Als een service meer dan één niet-door de klant versleutelde resource heeft en Afdwinging is ingeschakeld, wordt de service gemarkeerd als niet-compatibel.
|
enforcement
|
SearchEncryptionWithCmk
|
Hierin wordt beschreven hoe een zoekservice het gebruik van een of meer niet door de klant versleutelde resources moet afdwingen.
|
HostingMode
Alleen van toepassing op de standard3-SKU. U kunt deze eigenschap instellen om maximaal 3 high-densitypartities in te schakelen die maximaal 1000 indexen toestaan, wat veel hoger is dan het maximum aantal indexen dat is toegestaan voor een andere SKU. Voor de standard3-SKU is de waarde 'default' of 'highDensity'. Voor alle andere SKU's moet deze waarde 'standaard' zijn.
Name |
Type |
Description |
default
|
string
|
De limiet voor het aantal indexen wordt bepaald door de standaardlimieten voor de SKU.
|
highDensity
|
string
|
Alleen toepassing voor standard3 SKU, waarbij de zoekservice maximaal 1000 indexen kan hebben.
|
Identity
Identiteit voor de resource.
Name |
Type |
Description |
principalId
|
string
|
De principal-id van de door het systeem toegewezen identiteit van de zoekservice.
|
tenantId
|
string
|
De tenant-id van de door het systeem toegewezen identiteit van de zoekservice.
|
type
|
IdentityType
|
Het identiteitstype.
|
IdentityType
Het identiteitstype.
Name |
Type |
Description |
None
|
string
|
|
SystemAssigned
|
string
|
|
IpRule
De IP-beperkingsregel van de zoekservice.
Name |
Type |
Description |
value
|
string
|
De waarde die overeenkomt met één IPv4-adres (bijvoorbeeld 123.1.2.3) of een IP-bereik in CIDR-indeling (bijvoorbeeld 123.1.2.3/24) moet worden toegestaan.
|
NetworkRuleSet
Netwerkspecifieke regels die bepalen hoe de zoekservice kan worden bereikt.
Name |
Type |
Description |
ipRules
|
IpRule[]
|
Een lijst met IP-beperkingsregels die worden gebruikt voor een IP-firewall. IP-adressen die niet overeenkomen met de regels, worden geblokkeerd door de firewall. Deze regels worden alleen toegepast wanneer de 'publicNetworkAccess' van de zoekservice is ingeschakeld.
|
PrivateEndpoint
De resource van het privé-eindpunt van de Microsoft.Network-provider.
Name |
Type |
Description |
id
|
string
|
De resource-id van de privé-eindpuntresource van de Microsoft.Network-provider.
|
PrivateEndpointConnection
Beschrijft een bestaande privé-eindpuntverbinding met de zoekservice.
Name |
Type |
Description |
id
|
string
|
Volledig gekwalificeerde resource-id voor de resource. Bijvoorbeeld - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
De naam van de resource
|
properties
|
PrivateEndpointConnectionProperties
|
Beschrijft de eigenschappen van een bestaande privé-eindpuntverbinding met de zoekservice.
|
type
|
string
|
Het type resource. Bijvoorbeeld 'Microsoft.Compute/virtualMachines' of 'Microsoft.Storage/storageAccounts'
|
PrivateEndpointConnectionProperties
Beschrijft de eigenschappen van een bestaande privé-eindpuntverbinding met de zoekservice.
Name |
Type |
Description |
groupId
|
string
|
De groeps-id van de provider van de resource waarvoor de private link-serviceverbinding is bedoeld.
|
privateEndpoint
|
PrivateEndpoint
|
De resource van het privé-eindpunt van de Microsoft.Network-provider.
|
privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
Beschrijft de huidige status van een bestaande Private Link Service-verbinding met het azure-privé-eindpunt.
|
provisioningState
|
PrivateLinkServiceConnectionProvisioningState
|
De inrichtingsstatus van de private link-serviceverbinding. Geldige waarden zijn Bijwerken, Verwijderen, Mislukt, Geslaagd of Onvolledig
|
PrivateLinkServiceConnectionProvisioningState
De inrichtingsstatus van de private link-serviceverbinding. Geldige waarden zijn Bijwerken, Verwijderen, Mislukt, Geslaagd of Onvolledig
Name |
Type |
Description |
Canceled
|
string
|
De inrichtingsaanvraag voor de privékoppelingsserviceverbindingsresource is geannuleerd
|
Deleting
|
string
|
De private link-serviceverbinding wordt verwijderd.
|
Failed
|
string
|
De private link-serviceverbinding kan niet worden ingericht of verwijderd.
|
Incomplete
|
string
|
De inrichtingsaanvraag voor de verbindingsresource van de Private Link-service is geaccepteerd, maar het proces voor het maken is nog niet gestart.
|
Succeeded
|
string
|
De private link-serviceverbinding is ingericht en is gereed voor goedkeuring.
|
Updating
|
string
|
De private link-serviceverbinding wordt samen met andere resources gemaakt om deze volledig functioneel te maken.
|
PrivateLinkServiceConnectionState
Beschrijft de huidige status van een bestaande Private Link Service-verbinding met het azure-privé-eindpunt.
Name |
Type |
Default value |
Description |
actionsRequired
|
string
|
None
|
Een beschrijving van eventuele extra acties die nodig kunnen zijn.
|
description
|
string
|
|
De beschrijving voor de verbindingsstatus van de Private Link-service.
|
status
|
PrivateLinkServiceConnectionStatus
|
|
Status van de private link-serviceverbinding. Geldige waarden zijn In behandeling, Goedgekeurd, Geweigerd of Verbroken.
|
PrivateLinkServiceConnectionStatus
Status van de private link-serviceverbinding. Geldige waarden zijn In behandeling, Goedgekeurd, Geweigerd of Verbroken.
Name |
Type |
Description |
Approved
|
string
|
De privé-eindpuntverbinding is goedgekeurd en is klaar voor gebruik.
|
Disconnected
|
string
|
De privé-eindpuntverbinding is verwijderd uit de service.
|
Pending
|
string
|
De privé-eindpuntverbinding is gemaakt en wacht op goedkeuring.
|
Rejected
|
string
|
De privé-eindpuntverbinding is geweigerd en kan niet worden gebruikt.
|
ProvisioningState
De status van de laatste inrichtingsbewerking die is uitgevoerd op de zoekservice. Inrichten is een tussenliggende status die optreedt terwijl de servicecapaciteit wordt ingesteld. Nadat de capaciteit is ingesteld, wordt provisioningState gewijzigd in 'succeeded' of 'failed'. Clienttoepassingen kunnen de inrichtingsstatus peilen (het aanbevolen pollinginterval is van 30 seconden tot één minuut) met behulp van de bewerking Zoekservice ophalen om te zien wanneer een bewerking is voltooid. Als u de gratis service gebruikt, komt deze waarde meestal rechtstreeks terug als 'geslaagd' in de aanroep naar Zoekservice maken. Dit komt doordat de gratis service gebruikmaakt van capaciteit die al is ingesteld.
Name |
Type |
Description |
failed
|
string
|
De laatste inrichtingsbewerking is mislukt.
|
provisioning
|
string
|
De zoekservice wordt ingericht of omhoog of omlaag geschaald.
|
succeeded
|
string
|
De laatste inrichtingsbewerking is voltooid.
|
PublicNetworkAccess
Deze waarde kan worden ingesteld op 'ingeschakeld' om te voorkomen dat wijzigingen in bestaande klantresources en sjablonen fouten veroorzaken. Als deze optie is ingesteld op uitgeschakeld, is verkeer via de openbare interface niet toegestaan en zijn privé-eindpuntverbindingen de exclusieve toegangsmethode.
Name |
Type |
Description |
disabled
|
string
|
|
enabled
|
string
|
|
SearchEncryptionComplianceStatus
Beschrijft of de zoekservice al dan niet compatibel is met betrekking tot niet-door de klant versleutelde resources. Als een service meer dan één niet-door de klant versleutelde resource heeft en Afdwinging is ingeschakeld, wordt de service gemarkeerd als niet-compatibel.
Name |
Type |
Description |
Compliant
|
string
|
Geeft aan dat de zoekservice compatibel is, omdat het aantal niet door de klant versleutelde resources nul is of afdwingen is uitgeschakeld.
|
NonCompliant
|
string
|
Geeft aan dat de zoekservice meer dan één niet-door de klant versleutelde resources heeft.
|
SearchEncryptionWithCmk
Hierin wordt beschreven hoe een zoekservice het gebruik van een of meer niet door de klant versleutelde resources moet afdwingen.
Name |
Type |
Description |
Disabled
|
string
|
Er wordt geen afdwinging uitgevoerd en de zoekservice kan niet-door de klant versleutelde resources hebben.
|
Enabled
|
string
|
Search-service wordt gemarkeerd als niet-compatibel als er een of meer niet-door de klant versleutelde resources zijn.
|
Unspecified
|
string
|
Afdwingingsbeleid is niet expliciet opgegeven, waarbij het gedrag hetzelfde is als wanneer het is ingesteld op Uitgeschakeld.
|
SearchSemanticSearch
Hiermee stelt u opties in die de beschikbaarheid van semantisch zoeken bepalen. Deze configuratie is alleen mogelijk voor bepaalde zoek-SKU's op bepaalde locaties.
Name |
Type |
Description |
disabled
|
string
|
Geeft aan dat semantische classificatie is uitgeschakeld voor de zoekservice.
|
free
|
string
|
Schakelt semantische rangschikking in voor een zoekservice en geeft aan dat deze moet worden gebruikt binnen de limieten van de gratis laag. Dit zou het aantal semantische classificatieaanvragen beperken en wordt zonder extra kosten aangeboden. Dit is de standaardinstelling voor nieuw ingerichte zoekservices.
|
standard
|
string
|
Maakt semantische rangschikking op een zoekservice mogelijk als factureerbare functie, met een hogere doorvoer en een hogere hoeveelheid semantische classificatieaanvragen.
|
SearchService
Beschrijft een zoekservice en de huidige status.
Name |
Type |
Default value |
Description |
id
|
string
|
|
Volledig gekwalificeerde resource-id voor de resource. Bijvoorbeeld - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
identity
|
Identity
|
|
De identiteit van de resource.
|
location
|
string
|
|
De geografische locatie waar de resource zich bevindt
|
name
|
string
|
|
De naam van de resource
|
properties.authOptions
|
DataPlaneAuthOptions
|
|
Definieert de opties voor de wijze waarop de gegevensvlak-API van een zoekservice aanvragen verifieert. Dit kan niet worden ingesteld als 'disableLocalAuth' is ingesteld op true.
|
properties.disableLocalAuth
|
boolean
|
|
Als deze optie is ingesteld op true, mogen aanroepen naar de zoekservice geen API-sleutels gebruiken voor verificatie. Dit kan niet worden ingesteld op true als 'dataPlaneAuthOptions' is gedefinieerd.
|
properties.encryptionWithCmk
|
EncryptionWithCmk
|
|
Hiermee geeft u elk beleid met betrekking tot het versleutelen van resources (zoals indexen) met behulp van klantmanagersleutels binnen een zoekservice.
|
properties.hostingMode
|
HostingMode
|
default
|
Alleen van toepassing op de standard3-SKU. U kunt deze eigenschap instellen om maximaal 3 high-densitypartities in te schakelen die maximaal 1000 indexen toestaan, wat veel hoger is dan het maximum aantal indexen dat is toegestaan voor een andere SKU. Voor de standard3-SKU is de waarde 'default' of 'highDensity'. Voor alle andere SKU's moet deze waarde 'standaard' zijn.
|
properties.networkRuleSet
|
NetworkRuleSet
|
|
Netwerkspecifieke regels die bepalen hoe de zoekservice kan worden bereikt.
|
properties.partitionCount
|
integer
|
1
|
Het aantal partities in de zoekservice; indien opgegeven, kan dit 1, 2, 3, 4, 6 of 12 zijn. Waarden groter dan 1 zijn alleen geldig voor standaard-SKU's. Voor 'standard3'-services waarbij hostingMode is ingesteld op 'highDensity', liggen de toegestane waarden tussen 1 en 3.
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
|
De lijst met privé-eindpuntverbindingen met de zoekservice.
|
properties.provisioningState
|
ProvisioningState
|
|
De status van de laatste inrichtingsbewerking die is uitgevoerd op de zoekservice. Inrichten is een tussenliggende status die optreedt terwijl de servicecapaciteit wordt ingesteld. Nadat de capaciteit is ingesteld, wordt provisioningState gewijzigd in 'succeeded' of 'failed'. Clienttoepassingen kunnen de inrichtingsstatus peilen (het aanbevolen pollinginterval is van 30 seconden tot één minuut) met behulp van de bewerking Zoekservice ophalen om te zien wanneer een bewerking is voltooid. Als u de gratis service gebruikt, komt deze waarde meestal rechtstreeks terug als 'geslaagd' in de aanroep naar Zoekservice maken. Dit komt doordat de gratis service gebruikmaakt van capaciteit die al is ingesteld.
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
enabled
|
Deze waarde kan worden ingesteld op 'ingeschakeld' om te voorkomen dat wijzigingen in bestaande klantresources en sjablonen fouten veroorzaken. Als deze optie is ingesteld op uitgeschakeld, is verkeer via de openbare interface niet toegestaan en zijn privé-eindpuntverbindingen de exclusieve toegangsmethode.
|
properties.replicaCount
|
integer
|
1
|
Het aantal replica's in de zoekservice. Indien opgegeven, moet dit een waarde zijn tussen 1 en 12 voor standaard-SKU's of tussen 1 en 3 voor de Basis-SKU.
|
properties.semanticSearch
|
SearchSemanticSearch
|
|
Hiermee stelt u opties in die de beschikbaarheid van semantisch zoeken bepalen. Deze configuratie is alleen mogelijk voor bepaalde zoek-SKU's op bepaalde locaties.
|
properties.sharedPrivateLinkResources
|
SharedPrivateLinkResource[]
|
|
De lijst met gedeelde privékoppelingsresources die worden beheerd door de zoekservice.
|
properties.status
|
SearchServiceStatus
|
|
De status van de zoekservice. Mogelijke waarden zijn: 'wordt uitgevoerd': de zoekservice wordt uitgevoerd en er worden geen inrichtingsbewerkingen uitgevoerd. 'inrichting': de zoekservice wordt ingericht of omhoog of omlaag geschaald. 'verwijderen': de zoekservice wordt verwijderd. 'gedegradeerd': de zoekservice is gedegradeerd. Dit kan gebeuren wanneer de onderliggende zoekeenheden niet in orde zijn. De zoekservice is waarschijnlijk operationeel, maar de prestaties kunnen traag zijn en sommige aanvragen kunnen worden verwijderd. 'disabled': de zoekservice is uitgeschakeld. In deze status weigert de service alle API-aanvragen. 'fout': de zoekservice heeft een foutstatus. Als uw service de status gedegradeerd, uitgeschakeld of fout heeft, onderzoekt Microsoft het onderliggende probleem actief. Toegewezen services in deze statussen worden nog steeds in rekening gebracht op basis van het aantal ingerichte zoekeenheden.
|
properties.statusDetails
|
string
|
|
De details van de status van de zoekservice.
|
sku
|
Sku
|
|
De SKU van de zoekservice, die de factureringssnelheid en capaciteitslimieten bepaalt. Deze eigenschap is vereist bij het maken van een nieuwe zoekservice.
|
tags
|
object
|
|
Resourcetags.
|
type
|
string
|
|
Het type resource. Bijvoorbeeld 'Microsoft.Compute/virtualMachines' of 'Microsoft.Storage/storageAccounts'
|
SearchServiceStatus
De status van de zoekservice. Mogelijke waarden zijn: 'wordt uitgevoerd': de zoekservice wordt uitgevoerd en er worden geen inrichtingsbewerkingen uitgevoerd. 'inrichting': de zoekservice wordt ingericht of omhoog of omlaag geschaald. 'verwijderen': de zoekservice wordt verwijderd. 'gedegradeerd': de zoekservice is gedegradeerd. Dit kan gebeuren wanneer de onderliggende zoekeenheden niet in orde zijn. De zoekservice is waarschijnlijk operationeel, maar de prestaties kunnen traag zijn en sommige aanvragen kunnen worden verwijderd. 'disabled': de zoekservice is uitgeschakeld. In deze status weigert de service alle API-aanvragen. 'fout': de zoekservice heeft een foutstatus. Als uw service de status gedegradeerd, uitgeschakeld of fout heeft, onderzoekt Microsoft het onderliggende probleem actief. Toegewezen services in deze statussen worden nog steeds in rekening gebracht op basis van het aantal ingerichte zoekeenheden.
Name |
Type |
Description |
degraded
|
string
|
De zoekservice is gedegradeerd omdat onderliggende zoekeenheden niet in orde zijn.
|
deleting
|
string
|
De zoekservice wordt verwijderd.
|
disabled
|
string
|
De zoekservice is uitgeschakeld en alle API-aanvragen worden geweigerd.
|
error
|
string
|
De zoekservice heeft een foutstatus, wat aangeeft dat het niet kan worden ingericht of verwijderd.
|
provisioning
|
string
|
De zoekservice wordt ingericht of omhoog of omlaag geschaald.
|
running
|
string
|
De zoekservice wordt uitgevoerd en er worden geen inrichtingsbewerkingen uitgevoerd.
|
SharedPrivateLinkResource
Beschrijft een gedeelde Private Link resource die wordt beheerd door de zoekservice.
Name |
Type |
Description |
id
|
string
|
Volledig gekwalificeerde resource-id voor de resource. Bijvoorbeeld - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
De naam van de resource
|
properties
|
SharedPrivateLinkResourceProperties
|
Beschrijft de eigenschappen van een gedeelde Private Link resource die wordt beheerd door de zoekservice.
|
type
|
string
|
Het type resource. Bijvoorbeeld 'Microsoft.Compute/virtualMachines' of 'Microsoft.Storage/storageAccounts'
|
SharedPrivateLinkResourceProperties
Beschrijft de eigenschappen van een bestaande gedeelde Private Link resource die wordt beheerd door de zoekservice.
Name |
Type |
Description |
groupId
|
string
|
De groeps-id van de provider van de resource waarvoor de gedeelde Private Link-resource is bedoeld.
|
privateLinkResourceId
|
string
|
De resource-id van de resource waarvoor de gedeelde Private Link-resource is bedoeld.
|
provisioningState
|
SharedPrivateLinkResourceProvisioningState
|
De inrichtingsstatus van de gedeelde Private Link-resource. Geldige waarden zijn Bijwerken, Verwijderen, Mislukt, Geslaagd of Onvolledig.
|
requestMessage
|
string
|
Het aanvraagbericht voor het aanvragen van goedkeuring van de gedeelde Private Link-resource.
|
resourceRegion
|
string
|
Optioneel. Kan worden gebruikt om de Azure Resource Manager locatie op te geven van de resource waarnaar een gedeelde privékoppeling moet worden gemaakt. Dit is alleen vereist voor resources waarvan de DNS-configuratie regionaal is (zoals Azure Kubernetes Service).
|
status
|
SharedPrivateLinkResourceStatus
|
Status van de gedeelde Private Link-resource. Geldige waarden zijn In behandeling, Goedgekeurd, Geweigerd of Verbroken.
|
SharedPrivateLinkResourceProvisioningState
De inrichtingsstatus van de gedeelde Private Link-resource. Geldige waarden zijn Bijwerken, Verwijderen, Mislukt, Geslaagd of Onvolledig.
Name |
Type |
Description |
Deleting
|
string
|
|
Failed
|
string
|
|
Incomplete
|
string
|
|
Succeeded
|
string
|
|
Updating
|
string
|
|
SharedPrivateLinkResourceStatus
Status van de gedeelde Private Link-resource. Geldige waarden zijn In behandeling, Goedgekeurd, Geweigerd of Verbroken.
Name |
Type |
Description |
Approved
|
string
|
|
Disconnected
|
string
|
|
Pending
|
string
|
|
Rejected
|
string
|
|
Sku
Hiermee definieert u de SKU van een zoekservice, waarmee de factureringssnelheid en capaciteitslimieten worden bepaald.
Name |
Type |
Description |
name
|
SkuName
|
De SKU van de zoekservice. Geldige waarden zijn onder andere: 'gratis': Gedeelde service. 'basic': toegewezen service met maximaal 3 replica's. 'standaard': toegewezen service met maximaal 12 partities en 12 replica's. 'standard2': vergelijkbaar met standard, maar met meer capaciteit per zoekeenheid. 'standard3': het grootste Standard-aanbod met maximaal 12 partities en 12 replica's (of maximaal 3 partities met meer indexen als u ook de eigenschap hostingMode instelt op 'highDensity'). 'storage_optimized_l1': ondersteunt 1 TB per partitie, maximaal 12 partities. 'storage_optimized_l2': ondersteunt 2 TB per partitie, maximaal 12 partities.'
|
SkuName
De SKU van de zoekservice. Geldige waarden zijn onder andere: 'gratis': Gedeelde service. 'basic': toegewezen service met maximaal 3 replica's. 'standaard': toegewezen service met maximaal 12 partities en 12 replica's. 'standard2': vergelijkbaar met standard, maar met meer capaciteit per zoekeenheid. 'standard3': het grootste Standard-aanbod met maximaal 12 partities en 12 replica's (of maximaal 3 partities met meer indexen als u ook de eigenschap hostingMode instelt op 'highDensity'). 'storage_optimized_l1': ondersteunt 1 TB per partitie, maximaal 12 partities. 'storage_optimized_l2': ondersteunt 2 TB per partitie, maximaal 12 partities.'
Name |
Type |
Description |
basic
|
string
|
Factureerbare laag voor een toegewezen service met maximaal 3 replica's.
|
free
|
string
|
Gratis laag, zonder SLA-garanties en een subset van de functies die worden aangeboden op factureerbare lagen.
|
standard
|
string
|
Factureerbare laag voor een toegewezen service met maximaal 12 partities en 12 replica's.
|
standard2
|
string
|
Vergelijkbaar met 'standaard', maar met meer capaciteit per zoekeenheid.
|
standard3
|
string
|
De grootste Standard-aanbieding met maximaal 12 partities en 12 replica's (of maximaal 3 partities met meer indexen als u ook de eigenschap hostingMode instelt op 'highDensity').
|
storage_optimized_l1
|
string
|
Factureerbare laag voor een toegewezen service die ondersteuning biedt voor 1 TB per partitie, maximaal 12 partities.
|
storage_optimized_l2
|
string
|
Factureerbare laag voor een toegewezen service die ondersteuning biedt voor 2 TB per partitie, maximaal 12 partities.
|