Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies only to:
Foundry (classic) portal. This article isn't available for the new Foundry portal. Learn more about the new portal.
Note
Links in this article might open content in the new Microsoft Foundry documentation instead of the Foundry (classic) documentation you're viewing now.
Important
Azure OpenAI On Your Data retired on October 14, 2026, and is no longer supported by Microsoft.
For a Foundry IQ (Azure AI Search)-backed application, follow Migrate Azure OpenAI On Your Data to Foundry IQ. This sample reuses your existing index and demonstrates application changes for retrieval, answers, and citations. Migration isn't automatic. See also the notebook source on GitHub.
The sample's auto retrieval and answer synthesis (answerSynthesis) use 2026-08-01-preview. Review its prerequisites and access-control requirements and the Foundry IQ preview terms. Preview features aren't recommended for production. For generally available alternatives, use minimal, extractive knowledge base retrieval with 2026-10-01 or classic RAG, with application-managed answer generation. These paths aren't feature-equivalent replacements.
Before retirement, Azure OpenAI On Your Data supported the following models:
- GPT‑4o (versions 2024‑05‑13, 2024‑08‑06, and 2024‑11‑20)
- GPT-4o-mini (version 2024-07-18)
For corpus Q&A, call a Foundry IQ knowledge base directly. Add Foundry Agent Service for additional tools, actions, or workflows. See Choose the migration path. For the agent-based path, see Connect agents to Foundry IQ knowledge bases.
Use this article to learn how to configure networking and access when using Azure OpenAI On Your Data with Microsoft Entra ID role-based access control, virtual networks, and private endpoints.
Data ingestion architecture
When you use Azure OpenAI On Your Data to ingest data from Azure blob storage, local files or URLs into Foundry IQ (Azure AI Search), the following process is used to process the data.
- Steps 1 and 2 are only used for file upload.
- Downloading URLs to your blob storage is not illustrated in this diagram. After web pages are downloaded from the internet and uploaded to blob storage, steps 3 onward are the same.
- One indexer, one index, and one data source in the Foundry IQ resource is created using prebuilt skills and integrated vectorization.
- Foundry IQ handles the extraction, chunking, and vectorization of chunked documents through integrated vectorization. If a scheduling interval is specified, the indexer will run accordingly.
For the managed identities used in service calls, only system assigned managed identities are supported. User assigned managed identities aren't supported.
Inference architecture
When you send API calls to chat with an Azure OpenAI model on your data, the service needs to retrieve the index fields during inference to perform fields mapping. Therefore the service requires the Azure OpenAI identity to have the Search Service Contributor role for the Foundry IQ service even during inference.
If an embedding dependency is provided in the inference request, Azure OpenAI will vectorize the rewritten query, and both query and vector are sent to Foundry IQ for vector search.
Document-level access control
Note
Document-level access control is supported for Foundry IQ only.
Azure OpenAI On Your Data lets you restrict the documents that can be used in responses for different users with Foundry IQ security filters. When you enable document level access, Foundry IQ will trim the search results based on user Microsoft Entra group membership specified in the filter. You can only enable document-level access on existing Foundry IQ indexes. To enable document-level access:
To register your application and create users and groups, follow the steps in the Foundry IQ documentation.
Index your documents with their permitted groups. Be sure that your new security fields have the schema:
{"name": "group_ids", "type": "Collection(Edm.String)", "filterable": true }group_idsis the default field name. If you use a different field name likemy_group_ids, you can map the field in index field mapping.Make sure each sensitive document in the index has this security field value set to the permitted groups of the document.
In the Microsoft Foundry portal, add your data source. In the index field mapping section, you can map zero or one value to the permitted groups field, as long as the schema is compatible. If the permitted groups field isn't mapped, document level access is disabled.
Foundry portal
Once the Foundry IQ index is connected, your responses in the studio have document access based on the Microsoft Entra permissions of the logged in user.
API
When using the API, pass the filter parameter in each API request. For example:
Important
Use API keys with caution. Don't include the API key directly in your code, and never post it publicly. If you use an API key, store it securely in Azure Key Vault. For more information about using API keys securely in your apps, see API keys with Azure Key Vault.
For more information about AI services security, see Authenticate requests to Azure AI services.
For more information about security, see Authenticate requests.
{
"messages": [
{
"role": "user",
"content": "who is my manager?"
}
],
"data_sources": [
{
"type": "azure_search",
"parameters": {
"endpoint": "<AZURE_AI_SEARCH_ENDPOINT>",
"key": "<AZURE_AI_SEARCH_API_KEY>",
"index_name": "<AZURE_AI_SEARCH_INDEX>",
"filter": "my_group_ids/any(g:search.in(g, 'group_id1, group_id2'))"
}
}
]
}
my_group_idsis the field name that you selected for Permitted groups during fields mapping.group_id1, group_id2are groups attributed to the logged in user. The client application can retrieve and cache users' groups using the Microsoft Graph API.
Resource configuration
Use the following sections to configure your resources for optimal secure usage. Even if you plan to only secure part of your resources, you still need to follow all the steps.
This article describes network settings related to disabling public network for Azure OpenAI resources, Foundry IQ resources, and storage accounts. Using selected networks with IP rules is not supported, because the services' IP addresses are dynamic.
Create resource group
Create a resource group, so you can organize all the relevant resources. The resources in the resource group include but are not limited to:
- One Virtual network
- Three key services: one Azure OpenAI, one Foundry IQ, one Storage Account
- Three Private endpoints, each is linked to one key service
- Three Network interfaces, each is associated with one private endpoint
- One Virtual network gateway, for the access from on-premises client machines
- One Web App with virtual network integrated
- One Private DNS zone, so the Web App finds the IP of your Azure OpenAI
Create virtual network
The virtual network has three subnets.
- The first subnet is used for the virtual network gateway.
- The second subnet is used for the private endpoints for the three key services.
- The third subnet is empty, and used for Web App outbound virtual network integration.
Configure Azure OpenAI
Enabled custom subdomain
The custom subdomain is required for Microsoft Entra ID based authentication, and private DNS zone. If the Azure OpenAI resource is created using ARM template, the custom subdomain must be specified explicitly.
Enable managed identity
To allow your Foundry IQ and Storage Account to recognize your Azure OpenAI in Foundry Models via Microsoft Entra ID authentication, you need to assign a managed identity for your Azure OpenAI in Foundry Models. The easiest way is to toggle on system assigned managed identity on Azure portal.
To set the managed identities via the management API, see the management API reference documentation.
"identity": {
"principalId": "<YOUR-PRINCIPAL-ID>",
"tenantId": "<YOUR-TENNANT-ID>",
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/<YOUR-SUBSCIRPTION-ID>/resourceGroups/my-resource-group",
"principalId": "<YOUR-PRINCIPAL-ID>",
"clientId": "<YOUR-CLIENT-ID>"
}
}
Enable trusted service
To allow your Foundry IQ to call your Azure OpenAI `embedding model, while Azure OpenAI has no public network access, you need to set up Azure OpenAI to bypass Foundry IQ as a trusted service based on managed identity. Azure OpenAI identifies the traffic from your Foundry IQ by verifying the claims in the JSON Web Token (JWT). Foundry IQ must use the system assigned managed identity authentication to call the embedding endpoint.
Set networkAcls.bypass as AzureServices from the management API. For more information, see Virtual networks article.
This step can be skipped only if you have a shared private link for your Foundry IQ resource.
Disable public network access
You can disable public network access of your Azure OpenAI resource in the Azure portal.
To allow access to your Azure OpenAI from your client machines, like using Foundry portal, you need to create private endpoint connections that connect to your Azure OpenAI resource.
Configure Foundry IQ
You can use basic pricing tier and higher for the Foundry IQ resource. It's not necessary, but if you use the S2 pricing tier, advanced options are available.
Enable managed identity
To allow your other resources to recognize the Foundry IQ using Microsoft Entra ID authentication, you need to assign a managed identity for your Foundry IQ. The easiest way is to toggle on the system assigned managed identity in the Azure portal.
Enable role-based access control
As Azure OpenAI uses managed identity to access Foundry IQ, you need to enable role-based access control in your Foundry IQ. To do it on Azure portal, select Both or Role-based access control in the Keys tab in the Azure portal.
For more information, see the Foundry IQ RBAC article.
Disable public network access
You can disable public network access of your Foundry IQ resource in the Azure portal.
To allow access to your Foundry IQ resource from your client machines, like using Foundry portal, you need to create private endpoint connections that connect to your Foundry IQ resource.
Enable trusted service
You can enable trusted service of your Foundry IQ resource from Azure portal.
Go to your Foundry IQ resource's network tab. With the public network access set to disabled, select Allow Azure services on the trusted services list to access this search service.
You can also use the REST API to enable trusted service. This example uses the Azure CLI and the jq tool.
rid=/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/providers/Microsoft.Search/searchServices/<YOUR-RESOURCE-NAME>
apiVersion=2024-03-01-Preview
#store the resource properties in a variable
az rest --uri "https://management.azure.com$rid?api-version=$apiVersion" > search.json
#replace bypass with AzureServices using jq
jq '.properties.networkRuleSet.bypass = "AzureServices"' search.json > search_updated.json
#apply the updated properties to the resource
az rest --uri "https://management.azure.com$rid?api-version=$apiVersion" \
--method PUT \
--body @search_updated.json
Create shared private link
Tip
If you are using a basic or standard pricing tier, or if it is your first time to set up all of your resources securely, you should skip this advanced topic.
This section is only applicable for S2 pricing tier Foundry IQ resource, because it requires private endpoint support for indexers with a skill set.
To create shared private link from your Foundry IQ resource connecting to your Azure OpenAI resource, see the search documentation. Select Resource type as Microsoft.CognitiveServices/accounts and Group ID as openai_account.
With shared the private link, step 8 of the data ingestion architecture diagram is changed from bypass trusted service to shared private link.
Configure Storage Account
Enable trusted service
To allow access to your Storage Account from Azure OpenAI and Foundry IQ, you need to set up Storage Account to bypass your Azure OpenAI and Foundry IQ as trusted services based on managed identity.
In the Azure portal, navigate to your storage account networking tab, choose "Selected networks", and then select Allow Azure services on the trusted services list to access this storage account and click Save.
Disable public network access
You can disable public network access of your Storage Account in the Azure portal.
To allow access to your Storage Account from your client machines, like using Foundry portal, you need to create private endpoint connections that connect to your blob storage.
Role assignments
So far you have already setup each resource work independently. Next you need to allow the services to authorize each other.
| Role | Assignee | Resource | Description |
|---|---|---|---|
Search Index Data Reader |
Azure OpenAI | Foundry IQ | Inference service queries the data from the index. |
Search Service Contributor |
Azure OpenAI | Foundry IQ | Inference service queries the index schema for auto fields mapping. Data ingestion service creates index, data sources, skill set, indexer, and queries the indexer status. |
Storage Blob Data Contributor |
Azure OpenAI | Storage Account | Reads from the input container, and writes the preprocessed result to the output container. |
Cognitive Services OpenAI Contributor |
Foundry IQ | Azure OpenAI, Microsoft Foundry Project | Allows the Foundry IQ resource access to the Azure OpenAI embedding endpoint. This role must be assigned on both the Azure OpenAI resource and the Microsoft Foundry project. |
Storage Blob Data Reader |
Foundry IQ | Storage Account | Reads document blobs and chunk blobs. |
Reader |
Foundry Project | Azure Storage Private Endpoints (Blob & File) | Read search indexes created in blob storage within a Foundry Project. |
Cognitive Services OpenAI User |
Web app | Azure OpenAI | Inference. |
In the above table, the Assignee means the system assigned managed identity of that resource.
The admin needs to have the Owner role on these resources to add role assignments.
See the Azure RBAC documentation for instructions on setting these roles in the Azure portal. You can use the available script on GitHub to add the role assignments programmatically.
To enable the developers to use these resources to build applications, the admin needs to add the developers' identity with the following role assignments to the resources.
| Role | Resource | Description |
|---|---|---|
Cognitive Services OpenAI Contributor |
Azure OpenAI | Call public ingestion API from Foundry portal. The Contributor role is not enough, because if you only have Contributor role, you cannot call data plane API via Microsoft Entra ID authentication, and Microsoft Entra ID authentication is required in the secure setup described in this article. |
Contributor |
Foundry IQ | List API-Keys to list indexes from Foundry portal. |
Contributor |
Storage Account | List Account SAS to upload files from Foundry portal. |
Contributor |
The resource group or Azure subscription where the developer need to deploy the web app to | Deploy web app to the developer's Azure subscription. |
Role Based Access Control Administrator |
Azure OpenAI | Permission to configure the necessary role assignment on the Azure OpenAI resource. Enables the web app to call Azure OpenAI. |
Configure gateway and client
To access the Azure OpenAI from your on-premises client machines, one of the approaches is to configure Azure VPN Gateway and Azure VPN Client.
Follow this guideline to create virtual network gateway for your virtual network.
Follow this guideline to add point-to-site configuration, and enable Microsoft Entra ID based authentication. Download the Azure VPN Client profile configuration package, unzip, and import the AzureVPN/azurevpnconfig.xml file to your Azure VPN client.
Configure your local machine hosts file to point your resources host names to the private IPs in your virtual network. The hosts file is located at C:\Windows\System32\drivers\etc for Windows, and at /etc/hosts on Linux. Example:
10.0.0.5 contoso.openai.azure.com
10.0.0.6 contoso.search.windows.net
10.0.0.7 contoso.blob.core.windows.net
Foundry portal
You should be able to use all Foundry portal features, including both ingestion and inference, from your on-premises client machines.
Web app
The web app communicates with your Azure OpenAI resource. Since your Azure OpenAI resource has public network disabled, the web app needs to be set up to use the private endpoint in your virtual network to access your Azure OpenAI resource.
The web app needs to resolve your Azure OpenAI host name to the private IP of the private endpoint for Azure OpenAI. So, you need to configure the private DNS zone for your virtual network first.
- Create private DNS zone in your resource group.
- Add a DNS record. The IP is the private IP of the private endpoint for your Azure OpenAI resource, and you can get the IP address from the network interface associated with the private endpoint for your Azure OpenAI.
- Link the private DNS zone to your virtual network so the web app integrated in this virtual network can use this private DNS zone.
When deploying the web app from Foundry portal, select the same location with the virtual network, and select a proper SKU, so it can support the virtual network integration feature.
After the web app is deployed, from the Azure portal networking tab, configure the web app outbound traffic virtual network integration, choose the third subnet that you reserved for web app.
Using the API
Make sure your sign-in credential has Cognitive Services OpenAI Contributor role on your Azure OpenAI resource, and run az login first.
Ingestion API
See the ingestion API reference article for details on the request and response objects used by the ingestion API.
Inference API
See the inference API reference article for details on the request and response objects used by the inference API.
Use Microsoft Defender for Cloud
You can now integrate Microsoft Defender for Cloud (preview) with your Azure resources to protect your applications. Microsoft Defender for Cloud protects your applications with threat protection for AI workloads , providing teams with evidence-based security alerts enriched with Microsoft threat intelligence signals and enables teams to strengthen their security posture with integrated security best-practice recommendations.
Use this form to apply for access.