Skip to content

Commit e69df42

Browse files
committed
AI Services keyless billing
1 parent b120980 commit e69df42

File tree

2 files changed

+82
-16
lines changed

2 files changed

+82
-16
lines changed

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

Lines changed: 80 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,110 @@ 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+
## Billing through a keyless connection to Azure AI multi-service
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 a 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+
+ It can be either a system managed identity (identity=null) or a user managed identity.
46+
+ The managed identity must have **Cognitive Services User** permissions on the Azure AI multiservice account.
47+
+ The `@odata.type` is always `#Microsoft.Azure.Search.AIServicesByIdentity`.
48+
+ the `subdomainUrl` is the endpoint of your Azure AI multi-service account and 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.
49+
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.
51+
52+
### Example: system-assigned managed identity
53+
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+
```
3773

38-
## Add the resource key to a skillset
74+
### Example: user-assigned managed identity
3975

40-
You can use the Azure portal, REST API, or an Azure SDK to add the key to a skillset.
76+
Identity is set to the resource ID of the user-assigned managed identity.
77+
78+
```http
79+
POST https://[service-name].search.windows.net/skillsets/[skillset-name]?api-version=2024-11-01-Preview 
80+
81+
{ 
82+
    "name": "my skillset name", 
83+
    "skills":  
84+
    [ 
85+
      // skills definition goes here
86+
    ], 
87+
    "cognitiveServices": { 
88+
        "@odata.type": "#Microsoft.Azure.Search.AIServicesByIdentity", 
89+
        "description": "", 
90+
        "subdomainUrl": “https://[subdomain-name].cognitiveservices.azure.com", 
91+
      "identity": null
92+
    } 
93+
}
94+
```
95+
96+
## Billing through an Azure AI multi-service resources key
97+
98+
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.
4199

42100
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.
43101

44102
### [**Azure portal**](#tab/portal)
45103

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

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.
106+
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.
107+
108+
1. Get the resource key from the **Resources** > **Keys and endpoint** page.
49109

50-
+ For a new or existing skillset, provide the key in skillset definition.
110+
1. Add the key to a skillset definition:
111+
112+
+ 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.
113+
114+
+ For a new or existing skillset, provide the key in skillset definition.
51115

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

@@ -187,9 +251,11 @@ Enrichments are billable operations. If you no longer need to call Azure AI serv
187251
188252
## How the key is used
189253
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.
254+
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.
255+
256+
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."
191257
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."
258+
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.
193259
194260
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.
195261

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)