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
| Create an account and project | Azure AI Account Owner |
28
-
|**Standard Setup Only:** Assign RBAC for required resources (Cosmos DB, Search, Storage, etc.) | Role Based Access Control Administrator |
28
+
|[standard setup](#choose-your-setup) Only: Assign RBAC for required resources (Cosmos DB, Search, Storage, etc.) | Role Based Access Control Administrator |
29
29
| Create and edit agents | Azure AI User |
30
30
31
31
## Set up your agent environment
32
-
To get started, you need an account and a project.
33
-
Agents are scoped at the project level, which ensures data isolation—agents within the same project share access to the same resources.
32
+
To get started, you need an Azure AI Foundry resource and a Foundry project.
33
+
Agents are created within a specific project, and each project acts as an isolated workspace. This means:
34
+
* All agents in the same project share access to the same file storage, thread storage (conversation history), and search indexes.
35
+
* Data is isolated between projects. Agents in one project cannot access resources from another.
36
+
Projects are currently the unit of sharing and isolation in Foundry. See the [what is AI foundry](../../ai-foundry/what-is-azure-ai-foundry.md) article for more information on Foundry projects.
34
37
35
38
### Prerequisites
36
39
37
40
* An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services).
38
41
* Ensure that the individual creating the account and project has the **Azure AI Account Owner** role at the subscription scope
39
-
* If configuring **Standard Setup**, the same individual must also have permissions to assign roles to required resources (Cosmos DB, Search, Storage).
40
-
* The built-in role needed is **Role Based Access Control Administrator**.
42
+
* If configuring a [standard setup](#choose-your-setup), the same individual must also have permissions to assign roles to required resources (Cosmos DB, Azure AI Search, Azure Blob Storage). For more information on RBAC roles, specific to Azure AI Foundry Agent Service, see [Azure AI Foundry Agent Service RBAC roles](../concepts/rbac-azure-ai-foundry.md).
43
+
* The built-in role needed is **Role Based Access Administrator**.
41
44
* Alternatively, having the **Owner** role at the subscription level also satisfies this requirement.
42
45
* The key permission needed is: `Microsoft.Authorization/roleAssignments/write`
43
46
@@ -76,6 +79,12 @@ If you want support for Private Network Isolation see [network-secured setup](ho
76
79
| Deploy a standard agent setup that uses **Managed Identity** for authentication. <br>An account and project are created. <br> A GPT-4o model is deployed. <br> Azure resources for storing customer data - **Azure Storage**, **Azure Cosmos DB**, and **Azure AI Search** - are automatically created if existing resources are't provided. <br> These resources are connected to your project to store files, threads, and vector data. <br> A Microsoft-managed Key Vault is used by default.</li></ul> <br> [](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure-ai-foundry%2Ffoundry-samples%2Frefs%2Fheads%2Fmain%2Fsamples%2Fmicrosoft%2Finfrastructure-setup%2F41-standard-agent-setup%2Fazuredeploy.json)| :::image type="content" source="./media\quickstart\standard-agent-setup.png" alt-text="An architecture diagram for standard agent setup." lightbox="./media\quickstart\standard-agent-setup.png"::: |
77
80
78
81
### [Optional] Model selection in autodeploy template
82
+
83
+
> [!IMPORTANT]
84
+
> **Don't change the modelFormat parameter.**
85
+
>
86
+
> The templates only support deployment of Azure OpenAI models. See which Azure OpenAI models are supported in the [model support](./concepts/model-region-support.md) article.
87
+
79
88
You can customize the model used by your agent by editing the model parameters in the autodeploy template. To deploy a different model, you need to update at least the `modelName` and `modelVersion` parameters.
80
89
81
90
By default, the deployment template is configured with the following values:
@@ -88,12 +97,6 @@ By default, the deployment template is configured with the following values:
88
97
| modelSkuName | GlobalStandard |
89
98
| modelLocation | eastus |
90
99
91
-
> [!IMPORTANT]
92
-
> **Don't change the modelFormat parameter.**
93
-
>
94
-
> The templates only support deployment of Azure OpenAI models. See which Azure OpenAI models are supported in the [Azure AI Foundry Agent Service model support](concepts\model-region-support.md) documentation.
Copy file name to clipboardExpand all lines: articles/ai-foundry/agents/how-to/tools/openapi-spec-samples.md
+11-17Lines changed: 11 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Find code samples to use OpenAPI tools with agents.
5
5
author: aahill
6
6
ms.author: aahi
7
7
manager: nitinme
8
-
ms.date: 04/09/2025
8
+
ms.date: 06/18/2025
9
9
ms.service: azure-ai-agent-service
10
10
ms.topic: how-to
11
11
ms.custom:
@@ -33,8 +33,8 @@ Use this article to find step-by-step instructions and code samples for using Op
33
33
34
34
:::image type="content" source="../../media\tools\open-api-details.png" alt-text="A screenshot showing the openAPI tool details in the Azure AI Foundry portal." lightbox="../../media\tools\open-api-details.png":::
35
35
36
-
1. Select **Next** and select your authentication method. Choose `connection` for `API key`.
37
-
1. If you choose `connection`, you need to select the custom keys connection you have created before.
36
+
1. Select **Next** and select your authentication method.
37
+
1. If you choose `connection`, you need to select the custom connection you have created before.
38
38
1. If you choose `managed identity`, you need to input the audience to get your token. An example of an audience would be `https://cognitiveservices.azure.com/` to connect to Azure AI Services. Make sure you have already set up authentication and role assignment (as described in the [section](./openapi-spec.md#authenticating-with-managed-identity-microsoft-entra-id) above).
39
39
40
40
1. Copy and paste your OpenAPI specification in the text box.
@@ -70,18 +70,14 @@ with AIProjectClient(
70
70
) as project_client:
71
71
```
72
72
73
-
## Countries Tool Setup
74
-
Similarly, the OpenAPI specification for the countries service is loaded from `countries.json`. An anonymous authentication object (`OpenApiAnonymousAuthDetails`) is created, as this specific API doesn't require authentication in this example.
73
+
## Tool setup
74
+
Similarly, the OpenAPI specification is loaded from `weather.json`. An anonymous authentication object (`OpenApiAnonymousAuthDetails`) is created, as this specific API doesn't require authentication in this example. You can find an example OpenAPI spec on [GitHub](https://github.com/azure-ai-foundry/foundry-samples/blob/main/samples/microsoft/python/getting-started-agents/openapi/weather_openapi.json).
75
75
76
76
```python
77
-
# Load the OpenAPI specification for the countries service from a local JSON file
77
+
# Load the OpenAPI specification for the weather service from a local JSON file
78
78
withopen(os.path.join(os.path.dirname(__file__), "weather.json"), "r") as f:
79
79
openapi_weather = jsonref.loads(f.read())
80
80
81
-
# Load the OpenAPI specification for the countries service from a local JSON file
82
-
withopen(os.path.join(os.path.dirname(__file__), "countries.json"), "r") as f:
83
-
openapi_countries = jsonref.loads(f.read())
84
-
85
81
# Create Auth object for the OpenApiTool (note: using anonymous auth here; connection or managed identity requires additional setup)
86
82
auth = OpenApiAnonymousAuthDetails()
87
83
# for connection setup
@@ -93,10 +89,6 @@ Similarly, the OpenAPI specification for the countries service is loaded from `c
93
89
openapi_tool = OpenApiTool(
94
90
name="get_weather", spec=openapi_weather, description="Retrieve weather information for a location", auth=auth
95
91
)
96
-
# Add the countries API definition to the same tool object
97
-
openapi_tool.add_definition(
98
-
name="get_countries", spec=openapi_countries, description="Retrieve a list of countries", auth=auth
99
-
)
100
92
```
101
93
102
94
## Agent Creation
@@ -125,7 +117,7 @@ Create the thread and add the initial user message.
125
117
message = project_client.agents.messages.create(
126
118
thread_id=thread.id,
127
119
role="user",
128
-
content="What's the weather in Seattle and What is the name and population of the country that uses currency with abbreviation THB?",
120
+
content="What's the weather in Seattle?",
129
121
)
130
122
print(f"Created message, ID: {message.id}")
131
123
```
@@ -201,6 +193,8 @@ const client = new AgentsClient(projectEndpoint, new DefaultAzureCredential());
201
193
202
194
## Read in the OpenAPI spec
203
195
196
+
You can find an example OpenAPI spec on [GitHub](https://github.com/azure-ai-foundry/foundry-samples/blob/main/samples/microsoft/python/getting-started-agents/openapi/weather_openapi.json).
First, retrieve configuration details and create a `PersistentAgentsClient`, then define the `OpenApiToolDefinition` using the OpenAPI specification.
280
+
First, retrieve configuration details and create a `PersistentAgentsClient`, then define the `OpenApiToolDefinition` using the OpenAPI specification. You can find an example OpenAPI spec on [GitHub](https://github.com/azure-ai-foundry/foundry-samples/blob/main/samples/microsoft/python/getting-started-agents/openapi/weather_openapi.json).
287
281
288
282
```csharp
289
283
usingAzure;
@@ -392,7 +386,7 @@ Follow the [REST API Quickstart](../../quickstart.md?pivots=rest-api#api-call-in
392
386
393
387
## Create the OpenAPI Spec tool definition, agent, and thread
0 commit comments