汇报给定资源组中的现有搜索服务。
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}?api-version=2024-03-01-preview
URI 参数
名称 |
在 |
必需 |
类型 |
说明 |
resourceGroupName
|
path |
True
|
string
|
当前订阅中的资源组的名称。 可以从 Azure 资源管理器 API 或门户获取此值。
|
searchServiceName
|
path |
True
|
string
|
要更新的 Azure AI 搜索服务的名称。
|
subscriptionId
|
path |
True
|
string
|
Microsoft Azure 订阅的唯一标识符。 可以从 Azure 资源管理器 API 或门户获取此值。
|
api-version
|
query |
True
|
string
|
要用于每个请求的 API 版本。
|
名称 |
必需 |
类型 |
说明 |
x-ms-client-request-id
|
|
string
uuid
|
客户端生成的用于标识此请求的 GUID 值。 如果指定,则会将其包含在响应信息中,作为跟踪请求的一种方式。
|
请求正文
名称 |
类型 |
说明 |
identity
|
Identity
|
有关搜索服务标识的详细信息。 null 值表示搜索服务未分配标识。
|
location
|
string
|
资源的地理位置。 这必须是支持和注册的 Azure 地理区域之一, (例如,美国西部、美国东部、东南亚等) 。 创建新资源时需要此属性。
|
properties.authOptions
|
DataPlaneAuthOptions
|
定义搜索服务的数据平面 API 如何对请求进行身份验证的选项。 如果“disableLocalAuth”设置为 true,则无法设置此值。
|
properties.disableLocalAuth
|
boolean
|
如果设置为 true,则不允许对搜索服务的调用利用 API 密钥进行身份验证。 如果定义了“dataPlaneAuthOptions”,则不能将其设置为 true。
|
properties.disabledDataExfiltrationOptions
|
SearchDisabledDataExfiltrationOption[]
|
搜索服务明确禁止的数据外泄方案列表。 目前,唯一支持的值是“All”,用于禁用所有可能的数据导出方案,并计划在未来进行更精细的控制。
|
properties.encryptionWithCmk
|
EncryptionWithCmk
|
指定有关使用搜索服务中客户经理密钥) 资源 ((例如索引)加密的任何策略。
|
properties.hostingMode
|
HostingMode
|
仅适用于 standard3 SKU。 可以将此属性设置为启用最多 3 个高密度分区,允许最多 1000 个索引,这远远高于任何其他 SKU 允许的最大索引数。 对于 standard3 SKU,该值为“default”或“highDensity”。 对于所有其他 SKU,此值必须为“default”。
|
properties.networkRuleSet
|
NetworkRuleSet
|
确定如何访问 Azure AI 搜索服务的网络特定规则。
|
properties.partitionCount
|
integer
|
搜索服务中的分区数;如果指定,它可以是 1、2、3、4、6 或 12。 大于 1 的值仅对标准 SKU 有效。 对于 hostingMode 设置为“highDensity”的“standard3”服务,允许的值介于 1 和 3 之间。
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
此值可以设置为“已启用”,以避免对现有客户资源和模板进行中断性变更。 如果设置为“disabled”,则不允许通过公共接口的流量,专用终结点连接将是独占访问方法。
|
properties.replicaCount
|
integer
|
搜索服务中的副本数。 如果指定,则对于标准 SKU,该值必须是介于 1 到 12(非独占)之间,对于基本 SKU,该值必须是介于 1 到 3(非独占)之间的值。
|
properties.semanticSearch
|
SearchSemanticSearch
|
设置控制语义搜索可用性的选项。 此配置仅适用于某些位置中的某些 Azure AI 搜索 SKU。
|
sku
|
Sku
|
搜索服务的 SKU,用于确定价格层和容量限制。 创建新的搜索服务时,此属性是必需的。
|
tags
|
object
|
用于帮助对Azure 门户中的资源进行分类的标记。
|
响应
名称 |
类型 |
说明 |
200 OK
|
SearchService
|
已成功更新现有服务定义。 如果更改了副本或分区数,则缩放操作将以异步方式发生。 可以通过 Get Service 请求的 provisioningState 属性检查缩放操作的状态。
|
Other Status Codes
|
CloudError
|
HTTP 400 (错误请求) :给定的服务定义无效,或者您尝试更改不可变的属性。 有关详细信息,请参阅响应中的错误代码和消息。 HTTP 404 (找不到) :找不到订阅或资源组。 HTTP 409 (冲突) :禁用指定的订阅。
|
安全性
azure_auth
指定 Microsoft 标识平台上支持的隐式授权流。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 |
说明 |
user_impersonation
|
模拟用户帐户
|
示例
SearchUpdateService
示例请求
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"properties": {
"replicaCount": 2
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {"replicaCount": 2},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateService.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateService.json
func ExampleServicesClient_Update_searchUpdateService() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
ReplicaCount: to.Ptr[int32](2),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](2),
// 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 Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateService.json
*/
async function searchUpdateService() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
replicaCount: 2,
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateService.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(new AzureLocation("placeholder"))
{
ReplicaCount = 2,
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag",
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 2,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
SearchUpdateServiceAuthOptions
示例请求
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"properties": {
"replicaCount": 2,
"authOptions": {
"aadOrApiKey": {
"aadAuthFailureMode": "http401WithBearerChallenge"
}
}
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_auth_options.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {
"authOptions": {"aadOrApiKey": {"aadAuthFailureMode": "http401WithBearerChallenge"}},
"replicaCount": 2,
},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceAuthOptions.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceAuthOptions.json
func ExampleServicesClient_Update_searchUpdateServiceAuthOptions() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
AuthOptions: &armsearch.DataPlaneAuthOptions{
AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{
AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge),
},
},
ReplicaCount: to.Ptr[int32](2),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{
// AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge),
// },
// },
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](2),
// 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 Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceAuthOptions.json
*/
async function searchUpdateServiceAuthOptions() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
authOptions: {
aadOrApiKey: { aadAuthFailureMode: "http401WithBearerChallenge" },
},
replicaCount: 2,
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceAuthOptions.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(new AzureLocation("placeholder"))
{
ReplicaCount = 2,
AuthOptions = new SearchAadAuthDataPlaneAuthOptions()
{
AadAuthFailureMode = SearchAadAuthFailureMode.Http401WithBearerChallenge,
},
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag",
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 2,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"authOptions": {
"aadOrApiKey": {
"aadAuthFailureMode": "http401WithBearerChallenge"
}
},
"disabledDataExfiltrationOptions": []
}
}
SearchUpdateServiceDisableLocalAuth
示例请求
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"properties": {
"replicaCount": 2,
"disableLocalAuth": true
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_disable_local_auth.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {"disableLocalAuth": True, "replicaCount": 2},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json
func ExampleServicesClient_Update_searchUpdateServiceDisableLocalAuth() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
DisableLocalAuth: to.Ptr(true),
ReplicaCount: to.Ptr[int32](2),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// DisableLocalAuth: to.Ptr(true),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](2),
// 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 Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json
*/
async function searchUpdateServiceDisableLocalAuth() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
disableLocalAuth: true,
replicaCount: 2,
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(new AzureLocation("placeholder"))
{
ReplicaCount = 2,
IsLocalAuthDisabled = true,
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag",
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 2,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": true,
"authOptions": null,
"disabledDataExfiltrationOptions": []
}
}
SearchUpdateServiceToAllowAccessFromPrivateEndpoints
示例请求
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"publicNetworkAccess": "disabled"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_to_allow_access_from_private_endpoints.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={"properties": {"partitionCount": 1, "publicNetworkAccess": "disabled", "replicaCount": 1}},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json
func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPrivateEndpoints() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
PartitionCount: to.Ptr[int32](1),
PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled),
ReplicaCount: to.Ptr[int32](1),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled),
// ReplicaCount: to.Ptr[int32](1),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusRunning),
// StatusDetails: to.Ptr(""),
// },
// SKU: &armsearch.SKU{
// Name: to.Ptr(armsearch.SKUNameBasic),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json
*/
async function searchUpdateServiceToAllowAccessFromPrivateEndpoints() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
partitionCount: 1,
publicNetworkAccess: "disabled",
replicaCount: 1,
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(new AzureLocation("placeholder"))
{
ReplicaCount = 1,
PartitionCount = 1,
PublicInternetAccess = SearchServicePublicInternetAccess.Disabled,
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "basic"
},
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"status": "running",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "succeeded",
"publicNetworkAccess": "disabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
SearchUpdateServiceToAllowAccessFromPublicCustomIPs
示例请求
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [
{
"value": "123.4.5.6"
},
{
"value": "123.4.6.0/18"
}
]
}
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_to_allow_access_from_public_custom_ips.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {
"networkRuleSet": {"ipRules": [{"value": "123.4.5.6"}, {"value": "123.4.6.0/18"}]},
"partitionCount": 1,
"publicNetworkAccess": "enabled",
"replicaCount": 3,
}
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json
func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCustomIPs() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
NetworkRuleSet: &armsearch.NetworkRuleSet{
IPRules: []*armsearch.IPRule{
{
Value: to.Ptr("123.4.5.6"),
},
{
Value: to.Ptr("123.4.6.0/18"),
}},
},
PartitionCount: to.Ptr[int32](1),
PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
ReplicaCount: to.Ptr[int32](3),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// IPRules: []*armsearch.IPRule{
// {
// Value: to.Ptr("10.2.3.4"),
// }},
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](3),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusRunning),
// StatusDetails: to.Ptr(""),
// },
// 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 Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json
*/
async function searchUpdateServiceToAllowAccessFromPublicCustomIPs() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
networkRuleSet: {
ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }],
},
partitionCount: 1,
publicNetworkAccess: "enabled",
replicaCount: 3,
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(new AzureLocation("placeholder"))
{
ReplicaCount = 3,
PartitionCount = 1,
PublicInternetAccess = SearchServicePublicInternetAccess.Enabled,
NetworkRuleSet = new SearchServiceNetworkRuleSet()
{
IPRules =
{
new SearchServiceIPRule()
{
Value = "123.4.5.6",
},new SearchServiceIPRule()
{
Value = "123.4.6.0/18",
}
},
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "running",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "succeeded",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [
{
"value": "10.2.3.4"
}
]
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass
示例请求
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [
{
"value": "123.4.5.6"
},
{
"value": "123.4.6.0/18"
}
],
"bypass": "AzurePortal"
}
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_to_allow_access_from_public_custom_ips_and_bypass.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {
"networkRuleSet": {
"bypass": "AzurePortal",
"ipRules": [{"value": "123.4.5.6"}, {"value": "123.4.6.0/18"}],
},
"partitionCount": 1,
"publicNetworkAccess": "enabled",
"replicaCount": 3,
}
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json
func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
NetworkRuleSet: &armsearch.NetworkRuleSet{
Bypass: to.Ptr(armsearch.SearchBypassAzurePortal),
IPRules: []*armsearch.IPRule{
{
Value: to.Ptr("123.4.5.6"),
},
{
Value: to.Ptr("123.4.6.0/18"),
}},
},
PartitionCount: to.Ptr[int32](1),
PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
ReplicaCount: to.Ptr[int32](3),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassAzurePortal),
// IPRules: []*armsearch.IPRule{
// {
// Value: to.Ptr("10.2.3.4"),
// }},
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](3),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusRunning),
// StatusDetails: to.Ptr(""),
// },
// 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 Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json
*/
async function searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
networkRuleSet: {
bypass: "AzurePortal",
ipRules: [{ value: "123.4.5.6" }, { value: "123.4.6.0/18" }],
},
partitionCount: 1,
publicNetworkAccess: "enabled",
replicaCount: 3,
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(new AzureLocation("placeholder"))
{
ReplicaCount = 3,
PartitionCount = 1,
PublicInternetAccess = SearchServicePublicInternetAccess.Enabled,
NetworkRuleSet = new SearchServiceNetworkRuleSet()
{
IPRules =
{
new SearchServiceIPRule()
{
Value = "123.4.5.6",
},new SearchServiceIPRule()
{
Value = "123.4.6.0/18",
}
},
Bypass = SearchBypass.AzurePortal,
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "running",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "succeeded",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [
{
"value": "10.2.3.4"
}
],
"bypass": "AzurePortal"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
SearchUpdateServiceToRemoveIdentity
示例请求
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"sku": {
"name": "standard"
},
"identity": {
"type": "None"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_to_remove_identity.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={"identity": {"type": "None"}, "sku": {"name": "standard"}},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json
func ExampleServicesClient_Update_searchUpdateServiceToRemoveIdentity() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Identity: &armsearch.Identity{
Type: to.Ptr(armsearch.IdentityTypeNone),
},
SKU: &armsearch.SKU{
Name: to.Ptr(armsearch.SKUNameStandard),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](3),
// SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{
// },
// Status: to.Ptr(armsearch.SearchServiceStatusRunning),
// 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 Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json
*/
async function searchUpdateServiceToRemoveIdentity() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
identity: { type: "None" },
sku: { name: "standard" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(new AzureLocation("placeholder"))
{
SearchSkuName = SearchServiceSkuName.Standard,
Identity = new ManagedServiceIdentity("None"),
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 3,
"partitionCount": 1,
"status": "running",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "succeeded",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
SearchUpdateServiceWithCmkEnforcement
示例请求
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"properties": {
"replicaCount": 2,
"encryptionWithCmk": {
"enforcement": "Enabled"
}
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_with_cmk_enforcement.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {"encryptionWithCmk": {"enforcement": "Enabled"}, "replicaCount": 2},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json
func ExampleServicesClient_Update_searchUpdateServiceWithCmkEnforcement() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
EncryptionWithCmk: &armsearch.EncryptionWithCmk{
Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled),
},
ReplicaCount: to.Ptr[int32](2),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](2),
// 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 Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json
*/
async function searchUpdateServiceWithCmkEnforcement() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
encryptionWithCmk: { enforcement: "Enabled" },
replicaCount: 2,
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(new AzureLocation("placeholder"))
{
ReplicaCount = 2,
EncryptionWithCmk = new SearchEncryptionWithCmk()
{
Enforcement = SearchEncryptionWithCmkEnforcement.Enabled,
},
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag",
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 2,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Enabled",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": []
}
}
SearchUpdateServiceWithDataExfiltration
示例请求
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"properties": {
"replicaCount": 2,
"disabledDataExfiltrationOptions": [
"All"
]
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_with_data_exfiltration.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {"disabledDataExfiltrationOptions": ["All"], "replicaCount": 2},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithDataExfiltration.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithDataExfiltration.json
func ExampleServicesClient_Update_searchUpdateServiceWithDataExfiltration() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)},
ReplicaCount: to.Ptr[int32](2),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)},
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](2),
// 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 Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithDataExfiltration.json
*/
async function searchUpdateServiceWithDataExfiltration() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
disabledDataExfiltrationOptions: ["All"],
replicaCount: 2,
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithDataExfiltration.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(new AzureLocation("placeholder"))
{
ReplicaCount = 2,
DisabledDataExfiltrationOptions =
{
SearchDisabledDataExfiltrationOption.All
},
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag",
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 2,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": [
"All"
]
}
}
SearchUpdateServiceWithSemanticSearch
示例请求
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice?api-version=2024-03-01-preview
{
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"properties": {
"replicaCount": 2,
"semanticSearch": "standard"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python search_update_service_with_semantic_search.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.services.update(
resource_group_name="rg1",
search_service_name="mysearchservice",
service={
"properties": {"replicaCount": 2, "semanticSearch": "standard"},
"tags": {"app-name": "My e-commerce app", "new-tag": "Adding a new tag"},
},
)
print(response)
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json
func ExampleServicesClient_Update_searchUpdateServiceWithSemanticSearch() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{
Properties: &armsearch.ServiceProperties{
ReplicaCount: to.Ptr[int32](2),
SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchStandard),
},
Tags: map[string]*string{
"app-name": to.Ptr("My e-commerce app"),
"new-tag": to.Ptr("Adding a new tag"),
},
}, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Service = armsearch.Service{
// Name: to.Ptr("mysearchservice"),
// Type: to.Ptr("Microsoft.Search/searchServices"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "app-name": to.Ptr("My e-commerce app"),
// "new-tag": to.Ptr("Adding a new tag"),
// },
// Properties: &armsearch.ServiceProperties{
// AuthOptions: &armsearch.DataPlaneAuthOptions{
// APIKeyOnly: map[string]any{
// },
// },
// DisableLocalAuth: to.Ptr(false),
// DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{
// },
// EncryptionWithCmk: &armsearch.EncryptionWithCmk{
// EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant),
// Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified),
// },
// HostingMode: to.Ptr(armsearch.HostingModeDefault),
// NetworkRuleSet: &armsearch.NetworkRuleSet{
// Bypass: to.Ptr(armsearch.SearchBypassNone),
// IPRules: []*armsearch.IPRule{
// },
// },
// PartitionCount: to.Ptr[int32](1),
// PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{
// },
// ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled),
// ReplicaCount: to.Ptr[int32](2),
// SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchStandard),
// 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 Updates an existing search service in the given resource group.
*
* @summary Updates an existing search service in the given resource group.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json
*/
async function searchUpdateServiceWithSemanticSearch() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const service = {
replicaCount: 2,
semanticSearch: "standard",
tags: { appName: "My e-commerce app", newTag: "Adding a new tag" },
};
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.services.update(resourceGroupName, searchServiceName, service);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json
// this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SearchServiceResource created on azure
// for more information of creating SearchServiceResource, please refer to the document of SearchServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName);
SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId);
// invoke the operation
SearchServicePatch patch = new SearchServicePatch(new AzureLocation("placeholder"))
{
ReplicaCount = 2,
SemanticSearch = SearchSemanticSearch.Standard,
Tags =
{
["app-name"] = "My e-commerce app",
["new-tag"] = "Adding a new tag",
},
};
SearchServiceResource result = await searchService.UpdateAsync(patch);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SearchServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice",
"name": "mysearchservice",
"location": "westus",
"type": "Microsoft.Search/searchServices",
"tags": {
"app-name": "My e-commerce app",
"new-tag": "Adding a new tag"
},
"sku": {
"name": "standard"
},
"properties": {
"replicaCount": 2,
"partitionCount": 1,
"status": "provisioning",
"statusDetails": "",
"hostingMode": "default",
"provisioningState": "provisioning",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": [],
"bypass": "None"
},
"privateEndpointConnections": [],
"sharedPrivateLinkResources": [],
"encryptionWithCmk": {
"enforcement": "Unspecified",
"encryptionComplianceStatus": "Compliant"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
},
"disabledDataExfiltrationOptions": [],
"semanticSearch": "standard"
}
}
定义
AadAuthFailureMode
描述搜索服务的数据平面 API 将为身份验证失败的请求发送的响应。
名称 |
类型 |
说明 |
http401WithBearerChallenge
|
string
|
指示身份验证失败的请求应显示 HTTP 状态代码 401 (未授权) 并呈现持有者质询。
|
http403
|
string
|
指示身份验证失败的请求应显示 HTTP 状态代码 403 (禁止) 。
|
ApiKeyOnly
指示只能使用 API 密钥进行身份验证。
CloudError
包含有关 API 错误的信息。
名称 |
类型 |
说明 |
error
|
CloudErrorBody
|
使用错误代码和消息描述特定的 API 错误。
|
message
|
string
|
有关错误提示错误 (详细信息/调试信息的简短说明,请参阅“error.message”属性) 。
|
CloudErrorBody
描述具有错误代码和消息的特定 API 错误。
名称 |
类型 |
说明 |
code
|
string
|
一个错误代码,它比 HTTP 状态代码更准确地描述错误条件。 可用于以编程方式处理特定错误情况。
|
details
|
CloudErrorBody[]
|
包含与此错误相关的嵌套错误。
|
message
|
string
|
一条消息,详细说明错误并提供调试信息。
|
target
|
string
|
特定错误的目标 (例如,错误) 中的属性的名称。
|
DataPlaneAadOrApiKeyAuthOption
指示 API 密钥或来自Microsoft Entra ID租户的访问令牌可用于身份验证。
DataPlaneAuthOptions
定义搜索服务如何对数据平面请求进行身份验证的选项。 如果“disableLocalAuth”设置为 true,则无法设置此值。
EncryptionWithCmk
描述一个策略,该策略确定如何使用客户管理的密钥加密搜索服务中的资源。
HostingMode
仅适用于 standard3 SKU。 可以将此属性设置为启用最多 3 个高密度分区,允许最多 1000 个索引,这远远高于任何其他 SKU 允许的最大索引数。 对于 standard3 SKU,该值为“default”或“highDensity”。 对于所有其他 SKU,此值必须为“default”。
名称 |
类型 |
说明 |
default
|
string
|
索引数限制由 SKU 的默认限制决定。
|
highDensity
|
string
|
仅适用于标准 3 SKU,其中搜索服务最多可以有 1000 个索引。
|
Identity
有关搜索服务标识的详细信息。 null 值表示搜索服务未分配标识。
名称 |
类型 |
说明 |
principalId
|
string
|
搜索服务的系统分配标识的主体 ID。
|
tenantId
|
string
|
搜索服务的系统分配标识的租户 ID。
|
type
|
IdentityType
|
用于资源的标识类型。 类型“SystemAssigned, UserAssigned”包含系统创建的一个标识,以及用户分配的一组标识。 类型“None”将删除服务中的所有标识。
|
userAssignedIdentities
|
<string,
UserAssignedManagedIdentity>
|
与资源关联的用户标识列表。 用户标识字典密钥引用将是采用以下格式的 ARM 资源 ID:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。
|
IdentityType
用于资源的标识类型。 类型“SystemAssigned, UserAssigned”包含系统创建的一个标识,以及用户分配的一组标识。 类型“None”将删除服务中的所有标识。
名称 |
类型 |
说明 |
None
|
string
|
指示需要删除与搜索服务关联的任何标识。
|
SystemAssigned
|
string
|
指示将为搜索服务启用系统分配的标识。
|
SystemAssigned, UserAssigned
|
string
|
指示将为搜索服务启用系统分配的标识,同时分配一个或多个用户分配的标识。
|
UserAssigned
|
string
|
指示将向搜索服务分配一个或多个用户分配的标识。
|
IpRule
Azure AI 搜索服务的 IP 限制规则。
名称 |
类型 |
说明 |
value
|
string
|
与单个 IPv4 地址对应的值 (例如 123.1.2.3) 或 CIDR 格式的 IP 范围 (例如 123.1.2.3/24) 。
|
NetworkRuleSet
确定如何访问 Azure AI 搜索服务的网络特定规则。
名称 |
类型 |
说明 |
bypass
|
SearchBypass
|
可以绕过“ipRules”部分中定义的规则的入站流量的可能来源。
|
ipRules
|
IpRule[]
|
定义入站网络 (允许访问搜索服务终结点) 的 IP 限制规则列表。 同时,防火墙会阻止所有其他公共 IP 网络。 仅当搜索服务的“publicNetworkAccess”处于“启用”状态时,才应用这些限制规则:否则,即使使用任何公共 IP 规则,也不允许通过公共接口的流量,专用终结点连接将是独占访问方法。
|
PrivateEndpoint
Microsoft.Network 提供程序提供的专用终结点资源。
名称 |
类型 |
说明 |
id
|
string
|
Microsoft.Network 提供程序提供的专用终结点资源的资源 ID。
|
PrivateEndpointConnection
介绍与 Azure AI 搜索服务的现有专用终结点连接。
名称 |
类型 |
说明 |
id
|
string
|
资源的完全限定的资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
资源的名称
|
properties
|
PrivateEndpointConnectionProperties
|
介绍与 Azure AI 搜索服务的现有专用终结点连接的属性。
|
type
|
string
|
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”
|
PrivateEndpointConnectionProperties
描述与搜索服务的现有专用终结点连接的属性。
PrivateLinkServiceConnectionProvisioningState
专用链接服务连接的预配状态。 有效值为 Updateing、删除、Failed、Succeeded、Incomplete 或 Canceled。
名称 |
类型 |
说明 |
Canceled
|
string
|
已取消专用链接服务连接资源的预配请求。
|
Deleting
|
string
|
正在删除专用链接服务连接。
|
Failed
|
string
|
无法预配或删除专用链接服务连接。
|
Incomplete
|
string
|
已接受专用链接服务连接资源的预配请求,但创建过程尚未开始。
|
Succeeded
|
string
|
专用链接服务连接已完成预配,并已准备好审批。
|
Updating
|
string
|
专用链接服务连接正与其他资源一起创建,以便其完全正常运行。
|
PrivateLinkServiceConnectionState
描述与专用终结点的现有Azure 专用链接服务连接的当前状态。
名称 |
类型 |
默认值 |
说明 |
actionsRequired
|
string
|
None
|
描述可能需要执行的任何额外操作。
|
description
|
string
|
|
专用链接服务连接状态的说明。
|
status
|
PrivateLinkServiceConnectionStatus
|
|
专用链接服务连接的状态。 有效值为 Pending、Approved、Rejected 或 Disconnected。
|
PrivateLinkServiceConnectionStatus
专用链接服务连接的状态。 有效值为 Pending、Approved、Rejected 或 Disconnected。
名称 |
类型 |
说明 |
Approved
|
string
|
专用终结点连接已获批准,可供使用。
|
Disconnected
|
string
|
专用终结点连接已从服务中删除。
|
Pending
|
string
|
专用终结点连接已创建,正在等待审批。
|
Rejected
|
string
|
专用终结点连接已被拒绝,无法使用。
|
ProvisioningState
对搜索服务执行的最后一个预配操作的状态。 “正在设置”是一种中间状态,在建立服务容量时出现。 设置容量后,provisioningState 将更改为“succeeded”或“failed”。 客户端应用程序可以使用获取搜索服务操作查看操作完成时间, (建议的轮询间隔为 30 秒到一分钟) 轮询预配状态。 如果使用免费服务,则此值往往在调用创建搜索服务时直接以“成功”的形式返回。 这是因为免费服务使用了已设置的容量。
名称 |
类型 |
说明 |
failed
|
string
|
上次预配操作失败。
|
provisioning
|
string
|
正在预配或纵向扩展或缩减搜索服务。
|
succeeded
|
string
|
上一个预配操作已成功完成。
|
PublicNetworkAccess
此值可以设置为“已启用”,以避免对现有客户资源和模板进行中断性变更。 如果设置为“disabled”,则不允许通过公共接口的流量,专用终结点连接将是独占访问方法。
名称 |
类型 |
说明 |
disabled
|
string
|
无法从源自公共 Internet 的流量访问搜索服务。 仅允许通过批准的专用终结点连接进行访问。
|
enabled
|
string
|
可以从源自公共 Internet 的流量访问搜索服务。
|
SearchBypass
可以绕过“ipRules”部分中定义的规则的入站流量的可能来源。
名称 |
类型 |
说明 |
AzurePortal
|
string
|
指示源自Azure 门户的请求可以绕过“ipRules”节中定义的规则。
|
None
|
string
|
指示任何源都不能绕过“ipRules”节中定义的规则。 这是默认值。
|
SearchDisabledDataExfiltrationOption
搜索服务明确禁止的数据外泄方案列表。 目前,唯一支持的值是“All”,用于禁用所有可能的数据导出方案,并计划在未来进行更精细的控制。
名称 |
类型 |
说明 |
All
|
string
|
指示已禁用所有数据外泄方案。
|
SearchEncryptionComplianceStatus
返回与非 CMK 加密对象相关的搜索服务符合性状态。 如果一个服务有多个未加密对象,并且启用了强制实施,则服务将标记为不符合。
名称 |
类型 |
说明 |
Compliant
|
string
|
指示搜索服务符合要求,因为非 CMK 加密对象数为零或已禁用强制。
|
NonCompliant
|
string
|
指示搜索服务具有多个非 CMK 加密对象。
|
SearchEncryptionWithCmk
介绍搜索服务在找到未使用客户管理的密钥加密的对象时,应如何强制实施合规性。
名称 |
类型 |
说明 |
Disabled
|
string
|
不会强制执行客户管理的密钥加密。 仅使用内置的服务托管加密。
|
Enabled
|
string
|
如果一个或多个对象未使用客户管理的密钥加密,则搜索服务将被标记为不合规。
|
Unspecified
|
string
|
未显式指定强制策略,其行为与设置为“Disabled”时的行为相同。
|
SearchSemanticSearch
设置控制语义搜索可用性的选项。 此配置仅适用于某些位置中的某些 Azure AI 搜索 SKU。
名称 |
类型 |
说明 |
disabled
|
string
|
指示为搜索服务禁用语义重新调用程序。 这是默认值。
|
free
|
string
|
在搜索服务上启用语义重排器,并指示它将在免费计划的限制内使用。 免费计划将限制语义排名请求的数量,并且免费提供。 这是新预配的搜索服务的默认值。
|
standard
|
string
|
在搜索服务上启用语义重新检索器作为可计费功能,具有更高的吞吐量和语义上重新调用的查询量。
|
SearchService
介绍 Azure AI 搜索服务及其当前状态。
名称 |
类型 |
默认值 |
说明 |
id
|
string
|
|
资源的完全限定的资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
identity
|
Identity
|
|
资源的标识。
|
location
|
string
|
|
资源所在的地理位置
|
name
|
string
|
|
资源的名称
|
properties.authOptions
|
DataPlaneAuthOptions
|
|
定义搜索服务的数据平面 API 如何对请求进行身份验证的选项。 如果“disableLocalAuth”设置为 true,则无法设置此值。
|
properties.disableLocalAuth
|
boolean
|
|
如果设置为 true,则不允许对搜索服务的调用利用 API 密钥进行身份验证。 如果定义了“dataPlaneAuthOptions”,则不能将其设置为 true。
|
properties.disabledDataExfiltrationOptions
|
SearchDisabledDataExfiltrationOption[]
|
|
搜索服务明确禁止的数据外泄方案列表。 目前,唯一支持的值是“All”,用于禁用所有可能的数据导出方案,并计划在未来进行更精细的控制。
|
properties.eTag
|
string
|
|
一个系统生成的属性,表示服务的 etag,可在更新期间进行乐观并发控制。
|
properties.encryptionWithCmk
|
EncryptionWithCmk
|
|
指定有关使用搜索服务中客户经理密钥) 资源 ((例如索引)加密的任何策略。
|
properties.hostingMode
|
HostingMode
|
default
|
仅适用于 standard3 SKU。 可以将此属性设置为启用最多 3 个高密度分区,允许最多 1000 个索引,这远远高于任何其他 SKU 允许的最大索引数。 对于 standard3 SKU,该值为“default”或“highDensity”。 对于所有其他 SKU,此值必须为“default”。
|
properties.networkRuleSet
|
NetworkRuleSet
|
|
确定如何访问 Azure AI 搜索服务的网络特定规则。
|
properties.partitionCount
|
integer
|
1
|
搜索服务中的分区数;如果指定,它可以是 1、2、3、4、6 或 12。 大于 1 的值仅对标准 SKU 有效。 对于 hostingMode 设置为“highDensity”的“standard3”服务,允许的值介于 1 和 3 之间。
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
|
与 Azure AI 搜索服务的专用终结点连接列表。
|
properties.provisioningState
|
ProvisioningState
|
|
对搜索服务执行的最后一个预配操作的状态。 “正在设置”是一种中间状态,在建立服务容量时出现。 设置容量后,provisioningState 将更改为“succeeded”或“failed”。 客户端应用程序可以使用获取搜索服务操作查看操作完成时间, (建议的轮询间隔为 30 秒到一分钟) 轮询预配状态。 如果使用免费服务,则此值往往在调用创建搜索服务时直接以“成功”的形式返回。 这是因为免费服务使用了已设置的容量。
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
enabled
|
此值可以设置为“已启用”,以避免对现有客户资源和模板进行中断性变更。 如果设置为“disabled”,则不允许通过公共接口的流量,专用终结点连接将是独占访问方法。
|
properties.replicaCount
|
integer
|
1
|
搜索服务中的副本数。 如果指定,则对于标准 SKU,该值必须是介于 1 到 12(非独占)之间,对于基本 SKU,该值必须是介于 1 到 3(非独占)之间的值。
|
properties.semanticSearch
|
SearchSemanticSearch
|
|
设置控制语义搜索可用性的选项。 此配置仅适用于某些位置中的某些 Azure AI 搜索 SKU。
|
properties.sharedPrivateLinkResources
|
SharedPrivateLinkResource[]
|
|
Azure AI 搜索服务管理的共享专用链接资源列表。
|
properties.status
|
SearchServiceStatus
|
|
搜索服务的状态。 可能的值包括:“running”:搜索服务正在运行,并且没有预配操作正在进行中。 “预配”:正在预配或纵向扩展或缩减搜索服务。 “正在删除”:正在删除搜索服务。 “已降级”:搜索服务已降级。 当基础搜索单元不正常时,可能会发生这种情况。 搜索服务最有可能正常运行,但性能可能很慢,某些请求可能会被删除。 “disabled”:搜索服务已禁用。 在此状态下,服务将拒绝所有 API 请求。 “error”:搜索服务处于错误状态。 “已停止”:搜索服务位于已禁用的订阅中。 如果服务处于降级、禁用或错误状态,则意味着 Azure AI 搜索团队正在积极调查根本问题。 这些状态下的专用服务仍根据预配的搜索单位数收费。
|
properties.statusDetails
|
string
|
|
搜索服务状态的详细信息。
|
sku
|
Sku
|
|
搜索服务的 SKU,用于确定价格层和容量限制。 创建新的搜索服务时,此属性是必需的。
|
tags
|
object
|
|
资源标记。
|
type
|
string
|
|
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”
|
SearchServiceStatus
搜索服务的状态。 可能的值包括:“running”:搜索服务正在运行,并且没有预配操作正在进行中。 “预配”:正在预配或纵向扩展或缩减搜索服务。 “正在删除”:正在删除搜索服务。 “已降级”:搜索服务已降级。 当基础搜索单元不正常时,可能会发生这种情况。 搜索服务最有可能正常运行,但性能可能很慢,某些请求可能会被删除。 “disabled”:搜索服务已禁用。 在此状态下,服务将拒绝所有 API 请求。 “error”:搜索服务处于错误状态。 “已停止”:搜索服务位于已禁用的订阅中。 如果服务处于降级、禁用或错误状态,则意味着 Azure AI 搜索团队正在积极调查根本问题。 这些状态下的专用服务仍根据预配的搜索单位数收费。
名称 |
类型 |
说明 |
degraded
|
string
|
由于基础搜索单元不正常,因此搜索服务已降级。
|
deleting
|
string
|
正在删除搜索服务。
|
disabled
|
string
|
搜索服务处于禁用状态,所有 API 请求都将被拒绝。
|
error
|
string
|
搜索服务处于错误状态,表示预配失败或要删除。
|
provisioning
|
string
|
正在预配或纵向扩展或缩减搜索服务。
|
running
|
string
|
搜索服务正在运行,并且未执行任何预配操作。
|
stopped
|
string
|
搜索服务位于已禁用的订阅中。
|
SearchServiceUpdate
用于更新 Azure AI 搜索服务的参数。
名称 |
类型 |
默认值 |
说明 |
id
|
string
|
|
资源的完全限定的资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
identity
|
Identity
|
|
有关搜索服务标识的详细信息。 null 值指示搜索服务未分配标识。
|
location
|
string
|
|
资源的地理位置。 这必须是支持和注册的 Azure 地理区域之一, (例如,美国西部、美国东部、东南亚等) 。 创建新资源时需要此属性。
|
name
|
string
|
|
资源的名称
|
properties.authOptions
|
DataPlaneAuthOptions
|
|
定义搜索服务的数据平面 API 如何对请求进行身份验证的选项。 如果“disableLocalAuth”设置为 true,则无法设置此值。
|
properties.disableLocalAuth
|
boolean
|
|
如果设置为 true,则不允许对搜索服务的调用使用 API 密钥进行身份验证。 如果定义了“dataPlaneAuthOptions”,则不能将其设置为 true。
|
properties.disabledDataExfiltrationOptions
|
SearchDisabledDataExfiltrationOption[]
|
|
搜索服务明确禁止的数据外泄方案列表。 目前,唯一支持的值是“All”,用于禁用所有可能的数据导出方案,并计划在未来进行更精细的控制。
|
properties.eTag
|
string
|
|
系统生成的属性,表示服务的 etag,可用于在更新期间进行乐观并发控制。
|
properties.encryptionWithCmk
|
EncryptionWithCmk
|
|
指定有关资源加密的任何策略, (如索引) 使用搜索服务中的客户经理密钥。
|
properties.hostingMode
|
HostingMode
|
default
|
仅适用于 standard3 SKU。 可以将此属性设置为启用最多 3 个高密度分区,这些分区最多允许 1000 个索引,这远远高于任何其他 SKU 允许的最大索引数。 对于 standard3 SKU,该值为“default”或“highDensity”。 对于所有其他 SKU,此值必须为“default”。
|
properties.networkRuleSet
|
NetworkRuleSet
|
|
确定如何访问 Azure AI 搜索服务的网络特定规则。
|
properties.partitionCount
|
integer
|
1
|
搜索服务中的分区数;如果指定,它可以是 1、2、3、4、6 或 12。 大于 1 的值仅对标准 SKU 有效。 对于 hostingMode 设置为“highDensity”的“standard3”服务,允许的值介于 1 和 3 之间。
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
|
与 Azure AI 搜索服务的专用终结点连接列表。
|
properties.provisioningState
|
ProvisioningState
|
|
对搜索服务执行的最后一个预配操作的状态。 “正在设置”是一种中间状态,在建立服务容量时出现。 设置容量后,provisioningState 将更改为“成功”或“失败”。 客户端应用程序可以使用“获取搜索服务”操作查看操作完成时间, (建议的轮询间隔为 30 秒到 1 分钟) 轮询预配状态。 如果使用的是免费服务,则此值往往在调用 Create search service 时直接以“成功”的形式返回。 这是因为免费服务使用了已设置的容量。
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
enabled
|
此值可以设置为“enabled”,以避免对现有客户资源和模板进行中断性变更。 如果设置为“disabled”,则不允许通过公共接口的流量,专用终结点连接将是独占访问方法。
|
properties.replicaCount
|
integer
|
1
|
搜索服务中的副本数。 如果指定,则对于标准 SKU,该值必须介于 1 到 12(含 1 和 12)之间,对于基本 SKU,该值必须是介于 1 到 3(含 1 到 3)之间的值。
|
properties.semanticSearch
|
SearchSemanticSearch
|
|
设置控制语义搜索可用性的选项。 此配置仅适用于特定位置中的某些 Azure AI 搜索 SKU。
|
properties.sharedPrivateLinkResources
|
SharedPrivateLinkResource[]
|
|
由 Azure AI 搜索服务管理的共享专用链接资源的列表。
|
properties.status
|
SearchServiceStatus
|
|
搜索服务的状态。 可能的值包括:“running”:搜索服务正在运行,并且没有预配操作正在进行中。 “预配”:正在预配或纵向扩展或缩减搜索服务。 “正在删除”:正在删除搜索服务。 “已降级”:搜索服务已降级。 当基础搜索单元不正常时,可能会发生这种情况。 搜索服务很可能正常运行,但性能可能较慢,并且某些请求可能会被删除。 “disabled”:搜索服务已禁用。 在此状态下,服务将拒绝所有 API 请求。 “error”:搜索服务处于错误状态。 “stopped”:搜索服务位于已禁用的订阅中。 如果服务处于降级、禁用或错误状态,则意味着 Azure AI 搜索团队正在积极调查根本问题。 这些状态下的专用服务仍根据预配的搜索单位数收费。
|
properties.statusDetails
|
string
|
|
搜索服务状态的详细信息。
|
sku
|
Sku
|
|
搜索服务的 SKU,用于确定价格层和容量限制。 创建新的搜索服务时需要此属性。
|
tags
|
object
|
|
用于帮助对Azure 门户中的资源进行分类的标记。
|
type
|
string
|
|
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”
|
SharedPrivateLinkResource
介绍由 Azure AI 搜索服务管理的共享专用链接资源。
名称 |
类型 |
说明 |
id
|
string
|
资源的完全限定的资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
资源的名称
|
properties
|
SharedPrivateLinkResourceProperties
|
介绍由 Azure AI 搜索服务管理的共享专用链接资源的属性。
|
type
|
string
|
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”
|
SharedPrivateLinkResourceProperties
介绍由 Azure AI 搜索服务管理的现有共享专用链接资源的属性。
名称 |
类型 |
说明 |
groupId
|
string
|
共享专用链接资源所属的资源提供程序中的组 ID。
|
privateLinkResourceId
|
string
|
共享专用链接资源所针对的资源的资源 ID。
|
provisioningState
|
SharedPrivateLinkResourceProvisioningState
|
共享专用链接资源的预配状态。 有效值为 Updateing、删除、Failed、Succeeded 或 Incomplete。
|
requestMessage
|
string
|
请求批准共享专用链接资源的消息。
|
resourceRegion
|
string
|
可选。 可用于指定要为其创建共享专用链接的资源的 Azure 资源管理器位置。 只有 DNS 配置为区域 ((例如Azure Kubernetes 服务) )的资源才需要这样做。
|
status
|
SharedPrivateLinkResourceStatus
|
共享专用链接资源的状态。 有效值为 Pending、Approved、Rejected 或 Disconnected。
|
SharedPrivateLinkResourceProvisioningState
共享专用链接资源的预配状态。 有效值为 Updateing、删除、Failed、Succeeded 或 Incomplete。
名称 |
类型 |
说明 |
Deleting
|
string
|
共享专用链接资源正在被删除。
|
Failed
|
string
|
共享专用链接资源无法预配或删除。
|
Incomplete
|
string
|
已接受对共享专用链接资源的预配请求,但尚未开始创建过程。
|
Succeeded
|
string
|
共享专用链接资源已完成预配,可供审批。
|
Updating
|
string
|
共享专用链接资源正与其他资源一起创建,以便其完全正常运行。
|
SharedPrivateLinkResourceStatus
共享专用链接资源的状态。 有效值为 Pending、Approved、Rejected 或 Disconnected。
名称 |
类型 |
说明 |
Approved
|
string
|
共享专用链接资源已获批准,可供使用。
|
Disconnected
|
string
|
共享专用链接资源已从服务中删除。
|
Pending
|
string
|
共享专用链接资源已创建,正在等待审批。
|
Rejected
|
string
|
共享专用链接资源已被拒绝,无法使用。
|
Sku
定义搜索服务的 SKU,用于确定计费速率和容量限制。
名称 |
类型 |
说明 |
name
|
SkuName
|
搜索服务的 SKU。 有效值包括:“free”:共享服务。 “basic”:最多包含 3 个副本的专用服务。 “standard”:包含最多 12 个分区和 12 个副本的专用服务。 “standard2”:类似于标准,但每个搜索单位的容量更多。 “standard3”:最大标准产品/服务最多包含 12 个分区和 12 个副本 (或最多 3 个具有更多索引的分区(如果还将 hostingMode 属性设置为“highDensity”) )。 “storage_optimized_l1”:支持每个分区 1TB,最多支持 12 个分区。 “storage_optimized_l2”:支持每个分区 2TB,最多 12 个分区。
|
SkuName
搜索服务的 SKU。 有效值包括:“free”:共享服务。 “basic”:最多包含 3 个副本的专用服务。 “standard”:具有最多 12 个分区和 12 个副本的专用服务。 “standard2”:类似于标准,但每个搜索单元的容量更大。 “standard3”:最大标准产品/服务最多包含 12 个分区和 12 个副本, (最多 3 个分区,如果同时将 hostingMode 属性设置为“highDensity”) 。 “storage_optimized_l1”:支持每个分区 1TB,最多支持 12 个分区。 “storage_optimized_l2”:支持每个分区 2TB,最多支持 12 个分区。
名称 |
类型 |
说明 |
basic
|
string
|
最多包含 3 个副本的专用服务的计费层。
|
free
|
string
|
免费层,没有 SLA 保证,在可计费层上提供的功能子集。
|
standard
|
string
|
具有最多 12 个分区和 12 个副本的专用服务的计费层。
|
standard2
|
string
|
类似于“标准”,但每个搜索单元的容量更大。
|
standard3
|
string
|
最大的标准产品/服务最多包含 12 个分区和 12 个副本, (最多 3 个分区,如果同时将 hostingMode 属性设置为“highDensity”) 。
|
storage_optimized_l1
|
string
|
专用服务的计费层,每个分区支持 1TB,最多支持 12 个分区。
|
storage_optimized_l2
|
string
|
专用服务的计费层,每个分区支持 2TB,最多支持 12 个分区。
|
UserAssignedManagedIdentity
分配给搜索服务的用户分配的托管标识的详细信息。
名称 |
类型 |
说明 |
clientId
|
string
|
用户分配的标识的客户端 ID。
|
principalId
|
string
|
用户分配标识的主体 ID。
|