You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/search-indexer-how-to-access-private-sql.md
+28-41Lines changed: 28 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Although you can call the Management REST API directly, it's easier to use the A
25
25
26
26
+[Azure CLI](/cli/azure/install-azure-cli)
27
27
28
-
+ Azure Cognitive Search, Basic tier or higher. If you're using [AI enrichment](cognitive-search-concept-intro.md) and skillsets, the tier must be Standard 2 (S2) or higher. See [Service limits](search-limits-quotas-capacity.md#shared-private-link-resource-limits) for details.
28
+
+ Azure Cognitive Search, Basic or higher. If you're using [AI enrichment](cognitive-search-concept-intro.md) and skillsets, use Standard 2 (S2) or higher. See [Service limits](search-limits-quotas-capacity.md#shared-private-link-resource-limits) for details.
29
29
30
30
+ Azure SQL Managed Instance, configured to run in a virtual network, with a private endpoint created through Azure Private Link.
31
31
@@ -99,7 +99,7 @@ For more information about connection properties, see [Create an Azure SQL Manag
99
99
100
100
Provide the same shared private link name that you specified in the JSON body.
101
101
102
-
Provide a path to the create-pe.json file if you've navigated away from the file location. You can type `dir` at the command line to confirm the file is in the current directory.
102
+
Provide a path to the *create-pe.json* file if you've navigated away from the file location. You can type `dir` at the command line to confirm the file is in the current directory.
103
103
104
104
1. Press Enter to run the command.
105
105
@@ -127,9 +127,11 @@ On the Azure Cognitive Search side, you can confirm request approval by revisiti
127
127
128
128
You can now configure an indexer and its data source to use an outbound private connection to your managed instance.
129
129
130
-
You can use the portalfor this step, or any client that you would normally use for indexer setup. This article uses the REST APIs to make it easier to see all of the properties. Recall that REST API calls for indexers and data sources use the [Search REST APIs](/rest/api/searchservice/), not the [Management REST APIs](/rest/api/searchmanagement/). The syntax and API versions are different.
130
+
You could use the [**Import data**](search-get-started-portal.md) wizard for this step, but the indexer that's generated won't be valid for this scenario. You'll need to modify the indexer JSON property as described in this step to make it compliant for this scenario. You'll then need to [reset and rerun the indexer](search-howto-run-reset-indexers.md) to fully test the pipeline using the updated indexer.
131
131
132
-
1.[Create the data source definition](search-howto-connecting-azure-sql-database-to-azure-search-using-indexers.md) as you would normally for Azure SQL. There are no properties in any of these definitions that vary when using a shared private endpoint.
132
+
This article assumes Postman or equivalent tool, and uses the REST APIs to make it easier to see all of the properties. Recall that REST API calls for indexers and data sources use the [Search REST APIs](/rest/api/searchservice/), not the [Management REST APIs](/rest/api/searchmanagement/) used to create the shared private link. The syntax and API versions are different between the two REST APIs.
133
+
134
+
1.[Create the data source definition](search-howto-connecting-azure-sql-database-to-azure-search-using-indexers.md) as you would normally for Azure SQL. Although the format of the connection string is different, the data source type and other properties are valid for SQL Managed Instance.
133
135
134
136
Provide the connection string that you copied earlier.
135
137
@@ -141,7 +143,9 @@ You can use the portal for this step, or any client that you would normally use
141
143
"name" : "my-sql-datasource",
142
144
"description" : "A database for testing Azure Cognitive Search indexes.",
143
145
"type" : "azuresql",
144
-
"credentials" : { "connectionString" : "Server=tcp:contoso.public.0000000000.database.windows.net,1433; Persist Security Info=false; User ID=<your user name>; Password=<your password>;MultipleActiveResultsSets=False; Encrypt=True;Connection Timeout=30;" },
146
+
"credentials" : {
147
+
"connectionString" : "Server=tcp:contoso.public.0000000000.database.windows.net,1433; Persist Security Info=false; User ID=<your user name>; Password=<your password>;MultipleActiveResultsSets=False; Encrypt=True;Connection Timeout=30;"
148
+
},
145
149
"container" : {
146
150
"name" : "Name of table or view to index",
147
151
"query" : null (not supported in the Azure SQL indexer)
@@ -153,6 +157,9 @@ You can use the portal for this step, or any client that you would normally use
153
157
}
154
158
```
155
159
160
+
> [!NOTE]
161
+
> If you're familiar with data source definitions in Cognitive Search, you'll notice that data source properties don't vary when using a shared private link. That's because the private connection is detected and handled internally.
162
+
156
163
1. [Create the indexer definition](search-howto-create-indexers.md), setting the indexer execution environment to "private".
157
164
158
165
[Indexer execution](search-indexer-securing-resources.md#indexer-execution-environment) occurs in either a private environment that's specific to the search service, or a multi-tenant environment that's used internally to offload expensive skillset processing for multiple customers. **When connecting over a private endpoint, indexer execution must be private.**
@@ -174,55 +181,35 @@ You can use the portal for this step, or any client that you would normally use
174
181
}
175
182
```
176
183
177
-
After the indexer is created successfully, it should connect over the private endpoint connection. You can monitor the status of the indexer by using the [Indexer Status API](/rest/api/searchservice/get-indexer-status).
184
+
1. Run the indexer. If the indexer execution succeeds and the search index is populated, the shared private link is working.
185
+
186
+
You can monitor the status of the indexer in Azure portal or by using the [Indexer Status API](/rest/api/searchservice/get-indexer-status).
187
+
188
+
You can use [**Search explorer**](search-explorer.md) in Azure portal to check the contents of the index.
178
189
179
190
## 8 - Test the shared private link
180
191
181
-
Choose a tool that can invoke an outbound request from an indexer. An easy choice is using the [**Import data**](search-get-started-portal.md) wizard in Azure portal, but you can also try the Postman and REST APIs for more precision.
192
+
If you ran the indexer in the previous step and successfully indexed content from your managed instance, then the test was successful. However, if the indexer fails or there's no content in the index, you can modify your objects and repeat testing by choosing any client that can invoke an outbound request from an indexer.
182
193
183
-
Assuming that your search service isn't also configured for a private connection, the REST client connection to Search can be over the public internet.
194
+
An easy choice is [running an indexer](search-howto-run-reset-indexers.md) in Azure portal, but you can also try Postman and REST APIs for more precision. Assuming that your search service isn't also configured for a private connection, the REST client connection to Search can be over the public internet.
184
195
185
-
1. In the data source definition, set the connection string to the managed instance. The format of the connection string doesn't change for shared private link. The search service invokes the shared private link internally.
196
+
Here are some reminders for testing:
186
197
187
-
```http
188
-
POST https://myservice.search.windows.net/datasources?api-version=2020-06-30
189
-
Content-Type: application/json
190
-
api-key: admin-key
191
-
{
192
-
"name": "my-sql-datasource",
193
-
"type": "azuresql",
194
-
"subtype": null,
195
-
"credentials": {
196
-
"connectionString": "..."
197
-
}
198
-
```
198
+
+ If you use Postman or another web testing tool, use the [Management REST API](/rest/api/searchmanagement/) and a [preview API version](/rest/api/searchmanagement/management-api-versions) to create the shared private link. Use the [Search REST API](/rest/api/searchservice/) and a [stable API version](/rest/api/searchservice/search-service-api-versions) to create and invoke indexers and data sources.
199
199
200
-
1. In the indexer definition, remember to set the execution environment in the indexer definition:
200
+
+ You can use the Import data wizard to create an indexer, data source, and index. However, the generated indexer won't have the correct execution environment setting.
201
201
202
-
```http
203
-
POST https://myservice.search.windows.net/indexers?api-version=2020-06-30
204
-
Content-Type: application/json
205
-
api-key: admin-key
206
-
{
207
-
"name": "indexer",
208
-
"dataSourceName": "my-sql-datasource",
209
-
"targetIndexName": "my-index",
210
-
"parameters": {
211
-
"configuration": {
212
-
"executionEnvironment": "private"
213
-
}
214
-
},
215
-
"fieldMappings": []
216
-
}
217
-
}
218
-
```
202
+
+ You can edit data source and indexer JSON in Azure portal to change properties, including the execution environment and the connection string.
219
203
220
-
1. Run the indexer. If the indexer execution succeeds and the search index is populated, the shared private link is working.
204
+
+ You can reset and rerun the indexer in Azure portal. Reset is important for this scenario because it forces a full reprocessing of all documents.
205
+
206
+
+ You can use Search explorer to check the contents of the index.
221
207
222
208
## See also
223
209
224
210
+ [Make outbound connections through a private endpoint](search-indexer-howto-access-private.md)
225
211
+ [Indexer connections to Azure SQL Managed Instance through a public endpoint](search-howto-connecting-azure-sql-mi-to-azure-search-using-indexers.md)
226
212
+ [Index data from Azure SQL](search-howto-connecting-azure-sql-database-to-azure-search-using-indexers.md)
0 commit comments