Skip to content

Commit a51f5fb

Browse files
Merge pull request #1284 from HeidiSteen/heidist-hnsw
[azure search] AI Services keyless billing
2 parents 2d87bbc + 6eda9ad commit a51f5fb

File tree

4 files changed

+90
-19
lines changed

4 files changed

+90
-19
lines changed

articles/search/cognitive-search-attach-cognitive-services.md

Lines changed: 86 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,115 @@ ms.service: azure-ai-search
88
ms.custom:
99
- ignite-2023
1010
ms.topic: how-to
11-
ms.date: 10/21/2024
11+
ms.date: 11/19/2024
1212
---
1313

1414
# Attach an Azure AI multi-service resource to a skillset in Azure AI Search
1515

1616
When configuring an optional [AI enrichment pipeline](cognitive-search-concept-intro.md) in Azure AI Search, you can enrich a small number of documents free of charge, limited to 20 transactions daily per index. For larger and more frequent workloads, you should attach a billable [**Azure AI multi-service resource**](/azure/ai-services/multi-service-resource?pivots=azportal).
1717

18-
A multi-service account provides a collection of Azure AI services, rather than individual services. The account has an associated [resource key](/azure/ai-services/authentication#authenticate-with-a-multi-service-resource-key). This key is specified in an Azure AI Search [**skillset**](/rest/api/searchservice/skillsets/create) and allows Microsoft to charge you for using these services:
18+
A multi-service account provides a collection of Azure AI services, rather than individual services. Providing an account in an Azure AI Search [**skillset**](/rest/api/searchservice/skillsets/create) allows Microsoft to charge you for using these services:
1919

2020
+ [Azure AI Vision](/azure/ai-services/computer-vision/overview) for image analysis, optical character recognition (OCR), and multimodal text and image embedding.
2121
+ [Azure AI Language](/azure/ai-services/language-service/overview) for language detection, entity recognition, sentiment analysis, and key phrase extraction
2222
+ [Azure AI Speech](/azure/ai-services/speech-service/overview) for speech to text and text to speech
2323
+ [Azure AI Translator](/azure/ai-services/translator/translator-overview) for machine text translation
2424

25-
The key is used for billing, not connections. You must provide a key in the skillset even if you're using other mechanisms, such as role assignments and managed identities, on the connection.
25+
You must provide connection information to the Azure AI multi-resource in the skillset. Azure AI Search doesn't use the connection for skillset workloads, but it does use the connection to access the billing meters on the resource. As such, your Azure AI services account is used for billing, not skills processing. Azure AI Search uses separate dedicated resources for skills processing.
26+
27+
You can use a key on the connection, or implement a keyless approach that's currently in preview.
2628

2729
> [!TIP]
2830
> Azure provides infrastructure for you to monitor billing and budgets. For more information about monitoring Azure AI services, see [Plan and manage costs for Azure AI services](/azure/ai-services/plan-manage-costs).
2931
30-
## Get the resource key for an Azure AI multi-service account
32+
## Bill through a keyless connection
3133

32-
1. Sign in to the [Azure portal](https://portal.azure.com).
34+
[!INCLUDE [Feature preview](./includes/previews/preview-generic.md)]
3335

34-
1. Create an [Azure AI multi-service resource](/azure/ai-services/multi-service-resource?pivots=azportal) in the [same region](#same-region-requirement) as your search service.
36+
Using the Azure portal or newer preview REST APIs and beta SDK packages, you can attach an Azure AI multi-service resource using a managed identity and permissions. The advantage of this approach is that billing is keyless and has no dependency on regions.
3537

36-
1. Get the resource key from the **Resources** > **Keys and endpoint** page.
38+
1. [Configure Azure AI Search to use a managed identity](search-howto-managed-identities-data-sources.md).
39+
40+
1. On your Azure AI multi-service resource, [assign the identity to the **Cognitive Services User** role](/azure/role-based-access-control/role-assignments-portal).
41+
42+
1. Using the Azure portal, or the [Skillset 2024-11-01-preview REST API](/rest/api/searchservice/skillsets/create-or-update?view=rest-searchservice-2024-11-01-preview&preserve-view=true), or an Azure SDK beta package that provides the syntax, configure a skillset to use an identity:
43+
44+
+ The managed identity used on the connection belongs to the search service.
45+
+ The identity can be system managed or user assigned.
46+
+ The identity must have **Cognitive Services User** permissions on the Azure AI resource.
47+
+ `@odata.type` is always `#Microsoft.Azure.Search.AIServicesByIdentity`.
48+
+ `subdomainUrl` is the endpoint of your Azure AI multi-service resource. It can be in [any region that's jointly supported](search-region-support.md#azure-public-regions) by Azure AI Search and Azure AI services.
3749

38-
## Add the resource key to a skillset
50+
As with keys, the details you provide about the Azure AI Services resource are used for billing, not connections. All API requests made by Azure AI Search to Azure AI services for built-in skills processing continue to be internal and managed by Microsoft.
3951

40-
You can use the Azure portal, REST API, or an Azure SDK to add the key to a skillset.
52+
### Example: system-assigned managed identity
4153

42-
If you leave the property unspecified, your search service attempts to use the free enrichments available to your indexer on a daily basis. Execution of billable skills stops at 20 transactions per indexer invocation and a "Time Out" message appears in indexer execution history.
54+
Identity is set to null.
55+
56+
```http
57+
POST https://[service-name].search.windows.net/skillsets/[skillset-name]?api-version=2024-11-01-Preview 
58+
59+
{ 
60+
    "name": "my skillset name", 
61+
    "skills":  
62+
    [ 
63+
      // skills definition goes here
64+
    ], 
65+
    "cognitiveServices": { 
66+
        "@odata.type": "#Microsoft.Azure.Search.AIServicesByIdentity", 
67+
        "description": "", 
68+
        "subdomainUrl": “https://[subdomain-name].cognitiveservices.azure.com", 
69+
      "identity": null
70+
    } 
71+
}
72+
```
73+
74+
### Example: user-assigned managed identity
75+
76+
Identity is set to the resource ID of the user-assigned managed identity. To find an existing user-assigned managed identity, see [Manage user-assigned managed identities](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities).
77+
78+
For a user-assigned managed identity, set the `@odata.type` and the `userAssignedIdentity` properties.
79+
80+
```http
81+
POST https://[service-name].search.windows.net/skillsets/[skillset-name]?api-version=2024-11-01-Preview 
82+
83+
{ 
84+
    "name": "my skillset name", 
85+
    "skills":  
86+
    [ 
87+
      // skills definition goes here
88+
    ], 
89+
    "cognitiveServices": { 
90+
        "@odata.type": "#Microsoft.Azure.Search.AIServicesByIdentity", 
91+
        "description": "", 
92+
        "subdomainUrl": “https://[subdomain-name].cognitiveservices.azure.com", 
93+
        "identity": {  
94+
            "@odata.type":  "#Microsoft.Azure.Search.DataUserAssignedIdentity",  
95+
            "userAssignedIdentity": ""/subscriptions/{subscription-ID}/resourceGroups/{resource-group-name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{user-assigned-managed-identity-name}"" 
96+
    }
97+
}
98+
}
99+
```
100+
101+
## Bill through a resource key
102+
103+
Azure AI Search can also charge for transaction using the Azure AI multi-service resource key. This approach is the default and is generally available. You can use the Azure portal, REST API, or an Azure SDK to add the key to a skillset.
104+
105+
You only need to add the key, not the subdomain or endpoint. If you leave the `cognitiveServices` property unspecified, your search service attempts to use the free enrichments available to your indexer on a daily basis. Execution of billable skills stops at 20 transactions per indexer invocation and a "Time Out" message appears in indexer execution history.
43106

44107
### [**Azure portal**](#tab/portal)
45108

46-
Add the key to a skillset definition:
109+
1. Sign in to the [Azure portal](https://portal.azure.com).
47110

48-
+ If using an [Import data wizard](search-import-data-portal.md), create or select the Azure AI account. The wizard adds the resource key to your skillset definition.
111+
1. Create an [Azure AI multi-service resource](/azure/ai-services/multi-service-resource?pivots=azportal) in the [same region](#same-region-requirement) as your search service.
112+
113+
1. Get the resource key from the **Resources** > **Keys and endpoint** page.
49114

50-
+ For a new or existing skillset, provide the key in skillset definition.
115+
1. Add the key to a skillset definition:
116+
117+
+ If using an [Import data wizard](search-import-data-portal.md), create or select the Azure AI account. The wizard adds the resource key to your skillset definition.
118+
119+
+ For a new or existing skillset, provide the key in skillset definition.
51120

52121
:::image type="content" source="media/cognitive-search-attach-cognitive-services/attach-existing2.png" alt-text="Screenshot of the key page." border="true":::
53122

@@ -187,9 +256,11 @@ Enrichments are billable operations. If you no longer need to call Azure AI serv
187256
188257
## How the key is used
189258
190-
Key-based billing applies when API calls to Azure AI services resources exceed 20 API calls per indexer, per day. You can [reset the indexer](search-howto-run-reset-indexers.md) to reset the API count.
259+
Billing goes into effect when API calls to Azure AI services resources exceed 20 API calls per indexer, per day. You can [reset the indexer](search-howto-run-reset-indexers.md) to reset the API count.
260+
261+
Keyless and key-based connections are used for billing, but not for enrichment operations' connections. For connections, a search service [connects over the internal network](search-security-overview.md#internal-traffic) to an Azure AI services resource that's located in the [same physical region](search-region-support.md). Most regions that offer Azure AI Search also offer other Azure AI services such as Language. If you attempt AI enrichment in a region that doesn't have both services, you'll see this message: "Provided key isn't a valid CognitiveServices type key for the region of your search service."
191262
192-
The key is used for billing, but not for enrichment operations' connections. For connections, a search service [connects over the internal network](search-security-overview.md#internal-traffic) to an Azure AI services resource that's located in the [same physical region](search-region-support.md). Most regions that offer Azure AI Search also offer other Azure AI services such as Language. If you attempt AI enrichment in a region that doesn't have both services, you'll see this message: "Provided key isn't a valid CognitiveServices type key for the region of your search service."
263+
Indexers can be configured to run in a [private execution environment](search-howto-run-reset-indexers.md#indexer-execution) for dedicated processing using just the search nodes of your own search service. Even if you're using private execution environment, Azure AI Search still uses its internally provisioned Azure AI multiservice resource to perform all skill enrichments.
193264
194265
Currently, billing for [built-in skills](cognitive-search-predefined-skills.md) requires a public connection from Azure AI Search to another Azure AI service. Disabling public network access breaks billing. If disabling public networks is a requirement, you can configure a [Custom Web API skill](cognitive-search-custom-skill-interface.md) implemented with an [Azure Function](cognitive-search-create-custom-skill-example.md) that supports [private endpoints](/azure/azure-functions/functions-create-vnet) and add the [Azure AI services resource to the same VNET](/azure/ai-services/cognitive-services-virtual-networks). In this way, you can call Azure AI services resource directly from the custom skill using private endpoints.
195266

articles/search/search-api-preview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Preview features are removed from this list if they're retired or transition to
2727
|---------|------------------|-------------|---------------|
2828
| [**Query rewrite in the semantic reranker**](semantic-how-to-query-rewrite.md) | Relevance (scoring) | You can set options on a semantic query to rewrite the query input into a revised or expanded query that generates more relevant results from the L2 ranker. | [Search Documents (preview)](/rest/api/searchservice/documents/search-post?view=rest-searchservice-2024-11-01-preview&preserve-view=true).|
2929
| [**Document Layout skill**](cognitive-search-skill-document-intelligence-layout.md) | Applied AI (skills) | A new skill used to analyze a document for structure and provide [structure-aware chunking](search-how-to-semantic-chunking.md). | [Create or Update Skillset (preview)](/rest/api/searchservice/skillsets/create-or-update?view=rest-searchservice-2024-11-01-preview&preserve-view=true). |
30-
| [**Managed identity for keyless billing to an Azure AI multiservice subdomain**](cognitive-search-attach-cognitive-services.md). | Applied AI (skills) | You can now use a managed identity and roles for a keyless connection to Azure AI services for built-in skills processing. This capability removes restrictions for having both search and AI services in the same region. | [Create or Update Skillset (preview)](/rest/api/searchservice/skillsets/create-or-update?view=rest-searchservice-2024-11-01-preview&preserve-view=true).|
30+
| [**eyless billing for Azure AI skills processing**](cognitive-search-attach-cognitive-services.md). | Applied AI (skills) | You can now use a managed identity and roles for a keyless connection to Azure AI services for built-in skills processing. This capability removes restrictions for having both search and AI services in the same region. | [Create or Update Skillset (preview)](/rest/api/searchservice/skillsets/create-or-update?view=rest-searchservice-2024-11-01-preview&preserve-view=true).|
3131
| [**Markdown parsing mode**](search-how-to-index-markdown-blobs.md) | Indexer data source | With this parsing mode, indexers can generate one-to-one or one-to-many search documents from Markdown files in Azure Storage. | [Create or Update Indexer (preview)](/rest/api/searchservice/indexers/create-or-update?view=rest-searchservice-2024-11-01-preview&preserve-view=true). |
3232
| [**Rescoring options for compressed vectors**](vector-search-how-to-quantization.md) | Relevance (scoring) | You can set options to rescore with original vectors instead of compressed vectors. Applies to HNSW and exhaustive KNN vector algorithms, using binary and scalar compression. | [Create or Update Index (preview)](/rest/api/searchservice/indexes/create-or-update?view=rest-searchservice-2024-09-01-preview&preserve-view=true).|
3333
| [**Lower the dimension requirements for MRL-trained text embedding models on Azure OpenAI**](vector-search-how-to-truncate-dimensions.md) | Index | Text-embedding-3-small and Text-embedding-3-large are trained using Matryoshka Representation Learning (MRL). This allows you to truncate the embedding vectors to fewer dimensions, and adjust the balance between vector index size usage and retrieval quality. A new `truncationDimension` provides the MRL behaviors as an extra parameter in a vector compression configuration. This can only be configured for new vector fields. | [Create or Update Index (preview)](/rest/api/searchservice/indexes/create-or-update?view=rest-searchservice-2024-09-01-preview&preserve-view=true). |

articles/search/tutorial-rag-build-solution-pipeline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: HeidiSteen
88
ms.author: heidist
99
ms.service: azure-ai-search
1010
ms.topic: tutorial
11-
ms.date: 10/04/2024
11+
ms.date: 11/19/2024
1212

1313
---
1414

@@ -155,7 +155,7 @@ Skills are the basis for integrated data chunking and vectorization. At a minimu
155155

156156
In this skillset, an extra skill is used to create structured data in the index. The [Entity Recognition skill](cognitive-search-skill-entity-recognition-v3.md) is used to identify locations, which can range from proper names to generic references, such as "ocean" or "mountain". Having structured data gives you more options for creating interesting queries and boosting relevance.
157157

158-
The AZURE_AI_MULTISERVICE_KEY is needed even if you're using role-based access control. Azure AI Search uses the key for billing purposes and it's required unless your workloads stay under the free limit.
158+
The AZURE_AI_MULTISERVICE_KEY is needed even if you're using role-based access control. Azure AI Search uses the key for billing purposes and it's required unless your workloads stay under the free limit. You can also a keyless connection if you're using the most recent preview API or beta packages. For more information, see [Attach an Azure AI multi-service resource to a skillset](cognitive-search-attach-cognitive-services.md).
159159

160160
```python
161161
from azure.search.documents.indexes.models import (

0 commit comments

Comments
 (0)