Skip to content

Commit 942ae2d

Browse files
committed
Modified examples in Manage REST to use PATCH
1 parent de12ab9 commit 942ae2d

File tree

1 file changed

+12
-40
lines changed

1 file changed

+12
-40
lines changed

articles/search/search-manage-rest.md

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ All of the Management REST APIs have examples. If a task isn't covered in this a
3636

3737
## Prerequisites
3838

39-
* An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-search/)
39+
* An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-search/).
4040

41-
* [Postman](https://www.postman.com/downloads/) or another REST client that sends HTTP requests
41+
* [Postman](https://www.postman.com/downloads/) or another REST client that sends HTTP requests.
4242

43-
* [Azure CLI](/cli/azure/install-azure-cli) used to set up a security principle for the client
43+
* [Azure CLI](/cli/azure/install-azure-cli) used to set up a security principle for the client. You must have owner or administrator permissions to create a security principle.
4444

4545
## Create a security principal
4646

@@ -201,19 +201,9 @@ To use Azure role-based access control (Azure RBAC) for data plane operations, s
201201
If you want to use Azure RBAC exclusively, [turn off API key authentication](search-security-rbac.md#disable-api-key-authentication) by following up with a second request, this time setting "disableLocalAuth" to "true".
202202

203203
```rest
204-
PUT https://management.azure.com/subscriptions/{{subscriptionId}}/resourcegroups/{{resource-group}}/providers/Microsoft.Search/searchServices/{{search-service-name}}?api-version=2021-04-01-preview
204+
PATCH https://management.azure.com/subscriptions/{{subscriptionId}}/resourcegroups/{{resource-group}}/providers/Microsoft.Search/searchServices/{{search-service-name}}?api-version=2021-04-01-preview
205205
{
206-
"location": "{{region}}",
207-
"tags": {
208-
"app-name": "My e-commerce app"
209-
},
210-
"sku": {
211-
"name": "standard"
212-
},
213206
"properties": {
214-
"replicaCount": 1,
215-
"partitionCount": 1,
216-
"hostingMode": "default",
217207
"disableLocalAuth": false,
218208
"authOptions": {
219209
"aadOrApiKey": {
@@ -233,16 +223,9 @@ If you're using [customer-managed encryption](search-security-manage-encryption-
233223
When you enable this policy, any REST calls that create objects containing sensitive data, such as the connection string within a data source, will fail if an encryption key isn't provided: `"Error creating Data Source: "CannotCreateNonEncryptedResource: The creation of non-encrypted DataSources is not allowed when encryption policy is enforced."`
234224

235225
```rest
236-
PUT https://management.azure.com/subscriptions/{{subscriptionId}}/resourcegroups/{{resource-group}}/providers/Microsoft.Search/searchServices/{{search-service-name}}?api-version=2021-04-01-preview
226+
PATCH https://management.azure.com/subscriptions/{{subscriptionId}}/resourcegroups/{{resource-group}}/providers/Microsoft.Search/searchServices/{{search-service-name}}?api-version=2021-04-01-preview
237227
{
238-
"location": "westus",
239-
"sku": {
240-
"name": "standard"
241-
},
242228
"properties": {
243-
"replicaCount": 1,
244-
"partitionCount": 1,
245-
"hostingMode": "default",
246229
"encryptionWithCmk": {
247230
"enforcement": "Enabled",
248231
"encryptionComplianceStatus": "Compliant"
@@ -258,16 +241,12 @@ PUT https://management.azure.com/subscriptions/{{subscriptionId}}/resourcegroups
258241
Although [semantic search isn't enabled](semantic-search-overview.md#enable-semantic-search) by default, you could lock down the feature at the service level.
259242

260243
```rest
261-
PUT https://management.azure.com/subscriptions/{{subscriptionId}}/resourcegroups/{{resource-group}}/providers/Microsoft.Search/searchServices/{{search-service-name}}?api-version=2021-04-01-Preview
262-
{
263-
"location": "{{region}}",
264-
"sku": {
265-
"name": "standard"
266-
},
267-
"properties": {
268-
"semanticSearch": "disabled"
269-
}
270-
}
244+
PATCH https://management.azure.com/subscriptions/{{subscriptionId}}/resourcegroups/{{resource-group}}/providers/Microsoft.Search/searchServices/{{search-service-name}}?api-version=2021-04-01-Preview
245+
{
246+
"properties": {
247+
"semanticSearch": "disabled"
248+
}
249+
}
271250
```
272251

273252
<a name="disable-external-access"></a>
@@ -277,16 +256,9 @@ PUT https://management.azure.com/subscriptions/{{subscriptionId}}/resourcegroups
277256
Azure Cognitive Search [writes to external data sources](search-indexer-securing-resources.md) when updating a knowledge store, saving debug session state, or caching enrichments. The following example disables these workloads at the service level.
278257

279258
```rest
280-
PUT https://management.azure.com/subscriptions/{{subscriptionId}}/resourcegroups/{{resource-group}}/providers/Microsoft.Search/searchServices/{{search-service-name}}?api-version=2021-04-01-preview
259+
PATCH https://management.azure.com/subscriptions/{{subscriptionId}}/resourcegroups/{{resource-group}}/providers/Microsoft.Search/searchServices/{{search-service-name}}?api-version=2021-04-01-preview
281260
{
282-
"location": "{{region}}",
283-
"sku": {
284-
"name": "standard"
285-
},
286261
"properties": {
287-
"replicaCount": 1,
288-
"partitionCount": 1,
289-
"hostingMode": "default",
290262
"disabledDataExfiltrationOptions": [
291263
"All"
292264
]

0 commit comments

Comments
 (0)