Skip to content

Commit 8ee0d7c

Browse files
Merge pull request #299051 from ggailey777/ai-concepts
[Functions] new AI concepts article + scenario diagram updates
2 parents 77dbbd4 + ed365b5 commit 8ee0d7c

19 files changed

+163
-10
lines changed

articles/azure-functions/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
href: functions-overview.md
77
- name: Scenarios
88
href: functions-scenarios.md
9+
- name: AI-enabled functions
10+
href: functions-create-ai-enabled-apps.md
911
- name: Getting started
1012
href: functions-get-started.md
1113
- name: Durable Functions
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
---
2+
title: Use AI tools and models in Azure Functions
3+
description: Describes the ways in which Azure Functions supports the use of AI in your function code executions, including LLMs, RAG, agentic workflows, and other AI-related frameworks.
4+
ms.topic: conceptual
5+
ms.date: 04/29/2025
6+
ai-usage: ai-assisted
7+
ms.custom:
8+
- build-2025
9+
ms.collection:
10+
- ce-skilling-ai-copilot
11+
zone_pivot_groups: programming-languages-set-functions
12+
#Customer intent: As a developer, I want to learn how I can leverage AI models, tools, and other resourtcers so that my function executions can take full advantage of all of the AI-related resources available to an Azure service.
13+
---
14+
15+
# Use AI tools and models in Azure Functions
16+
17+
Azure Functions provides serverless compute resources that integrate with AI and Azure services to streamline the process of building cloud-hosted intelligent applications. This article provides a survey of the breadth of AI-related scenarios, integrations, and other AI resources that you can use in your function apps.
18+
19+
Some of the inherent benefits of using Azure Functions as a compute resource for your AI-integrated tasks include:
20+
21+
+ **Rapid, event-driven scaling**: you have compute resources available when you need it. With certain plans, your app scales back to zero when it's not needed. For more information, see [Event-driven scaling in Azure Functions](event-driven-scaling.md).
22+
+ **Built-in support for Azure OpenAI**: the [OpenAI binding extension] greatly simplifies the process of interacting with Azure OpenAI for working with agents, assistants, and retrieval-augmented generation (RAG) workflows.
23+
+ **Broad language and library support**: Functions lets you interact with AI using your [choice of programming language](./supported-languages.md), plus you're able to use a broad variety of [AI frameworks and libraries](#ai-tools-and-frameworks).
24+
+ **Orchestration capabilities**: while function executions are inherently stateless, the [Durable Functions extension](./durable/durable-functions-overview.md) lets you create the kind of complex workflows required by your AI agents.
25+
26+
This article is language-specific, so make sure you choose your programming language at the [top of the page](#top).
27+
28+
## Core AI integration scenarios
29+
30+
The combination of built-in bindings and broad support for external libraries provides you with a wide range of potential scenarios for augmenting your apps and solutions with the power of AI. These are some key AI integration scenarios supported by Functions.
31+
32+
### Retrieval-augmented generation
33+
34+
Because Functions is able to handle multiple events from various data sources simultaneously, it's an effective solution for real-time AI scenarios, like RAG systems that require fast data retrieval and processing. Rapid event-driven scaling reduces the latency experienced by your customers, even in high-demand situations.
35+
36+
Here are some reference samples for RAG-based scenarios:
37+
38+
::: zone pivot="programming-language-csharp"
39+
**[RAG with Azure AI Search](https://github.com/Azure-Samples/azure-functions-openai-aisearch-dotnet)**
40+
::: zone-end
41+
::: zone pivot="programming-language-python"
42+
**[RAG with Azure AI Search](https://github.com/Azure-Samples/azure-functions-openai-aisearch-python)**
43+
::: zone-end
44+
::: zone pivot="programming-language-java,programming-language-typescript,programming-language-powershell"
45+
**[RAG with Azure AI Search](https://github.com/Azure/azure-functions-openai-extension/tree/main/samples/rag-aisearch)**
46+
::: zone-end
47+
::: zone pivot="programming-language-javascript"
48+
**[RAG with Azure AI Search](https://github.com/Azure-Samples/azure-functions-openai-aisearch-node)**
49+
::: zone-end
50+
> For RAG, you can use SDKs, including but not limited to Azure Open AI and Azure SDKs to build out your scenarios. This reference sample uses the [OpenAI binding extension] to highlight OpenAI RAG with Azure AI Search.
51+
52+
::: zone pivot="programming-language-csharp"
53+
**[Custom chat bot](https://github.com/Azure-Samples/function-dotnet-ai-openai-chatgpt/)**
54+
::: zone-end
55+
::: zone pivot="programming-language-python"
56+
**[Custom chat bot](https://github.com/Azure-Samples/function-python-ai-openai-chatgpt)**
57+
::: zone-end
58+
::: zone pivot="programming-language-java,programming-language-typescript,programming-language-powershell"
59+
**[Custom chat bot](https://github.com/Azure/azure-functions-openai-extension/tree/main/samples/chat)**
60+
::: zone-end
61+
::: zone pivot="programming-language-javascript"
62+
**[Custom chat bot](https://github.com/Azure-Samples/function-javascript-ai-openai-chatgpt)**
63+
::: zone-end
64+
::: zone pivot="programming-language-csharp,programming-language-javascript,programming-language-python"
65+
> Shows you how to create a friendly chat bot that issues simple prompts, receives text completions, and sends messages, all in a stateful session using the [OpenAI binding extension].
66+
::: zone-end
67+
68+
### Assistant function calling
69+
70+
Assistant function calling gives your AI assistant or agent the ability to invoke specific functions or APIs dynamically based on the context of a conversation or task. These behaviors enable assistants to interact with external systems, retrieve data, and perform other actions.
71+
72+
Functions is ideal for implementing assistant function calling in agentic workflows. In addition to scaling efficiently to handle demand, [binding extensions](./functions-triggers-bindings.md) simplify the process of using Functions to connect assistants with remote Azure services. If there's no binding for your data source or you need full control over SDK behaviors, you can always manage your own client SDK connections in your app.
73+
74+
::: zone pivot="programming-language-java,programming-language-typescript,programming-language-powershell"
75+
Here are some reference samples for assistant function calling scenarios:
76+
::: zone-end
77+
::: zone pivot="programming-language-csharp"
78+
**[Assistants function calling (OpenAI bindings)](https://github.com/Azure-Samples/azure-functions-assistants-openai-dotnet)**
79+
::: zone-end
80+
::: zone pivot="programming-language-python"
81+
**[Assistants function calling (OpenAI bindings)](https://github.com/Azure-Samples/azure-functions-assistants-python)**
82+
::: zone-end
83+
::: zone pivot="programming-language-csharp,programming-language-python"
84+
> Uses the [OpenAI binding extension] to enable calling custom functions with the assistant skill trigger.
85+
::: zone-end
86+
::: zone pivot="programming-language-csharp"
87+
**[Agents function calling (Azure AI SDKs)](https://github.com/Azure-Samples/azure-functions-ai-services-agent-dotnet)**
88+
::: zone-end
89+
::: zone pivot="programming-language-python"
90+
**[Agents function calling (Azure AI SDKs)](https://github.com/Azure-Samples/azure-functions-ai-services-agent-python)**
91+
::: zone-end
92+
::: zone pivot="programming-language-javascript"
93+
**[Agents function calling (Azure AI SDKs)](https://github.com/Azure-Samples/azure-functions-ai-services-agent-javascript)**
94+
::: zone-end
95+
::: zone pivot="programming-language-csharp,programming-language-python,programming-language-javascript"
96+
> Uses function calling features for agents in Azure AI SDKs to implement custom functions calling.
97+
::: zone-end
98+
### Remote MCP servers
99+
100+
The Model Context Protocol (MCP) provides a standardized way for AI models to communicate with external systems to determine their capabilities and how they can best be used by AI assistants and agents. An MCP server enables an AI model (client) to more efficiently make these determinations.
101+
102+
Functions provides an MCP binding extension that simplifies the process of creating custom MCP servers in Azure.
103+
104+
::: zone pivot="programming-language-java,programming-language-javascript,programming-language-powershell"
105+
Here's an example of such a custom MCP server project:
106+
::: zone-end
107+
::: zone pivot="programming-language-csharp"
108+
**[Remote MCP servers](https://github.com/Azure-Samples/remote-mcp-functions-dotnet)**
109+
::: zone-end
110+
::: zone pivot="programming-language-python"
111+
**[Remote MCP servers](https://github.com/Azure-Samples/remote-mcp-functions-python)**
112+
::: zone-end
113+
::: zone pivot="programming-language-typescript"
114+
**[Remote MCP servers](https://github.com/Azure-Samples/remote-mcp-functions-typescript)**
115+
::: zone-end
116+
::: zone pivot="programming-language-csharp,programming-language-python,programming-language-typescript"
117+
> Provides an MCP server template along with several function tool endpoints, which can be run locally and also deployed to Azure.
118+
::: zone-end
119+
### Agentic workflows
120+
121+
While it's common for AI-driven processes to autonomously determine how to interact with models and other AI assets, there are many cases where a higher level of predicability is required or where the required steps are well-defined. These directed agentic workflows are composed of an orchestration of separate tasks or interactions that agents are required to follow.
122+
123+
The [Durable Functions extension](durable/durable-functions-overview.md) helps you take advantage of the strengths of Functions to create multi-step, long-running operations with built-in fault tolerance. These workflows are perfect for your directed agentic workflows. For example, a trip planning solution might first gather requirements from the user, search for plan options, obtain user approval, and finally make required bookings. In this scenario, you can build an agent for each step and then coordinate their actions as a workflow using Durable Functions.
124+
125+
For more workflow scenario ideas, see [Application patterns](durable/durable-functions-overview.md#application-patterns) in Durable Functions.
126+
127+
## AI tools and frameworks
128+
129+
Because Functions lets you build apps in your preferred language and using your favorite libraries, there's a wide range of flexibility in what AI libraries and frameworks you can use in your AI-enabled function apps.
130+
131+
Here are some of the key Microsoft AI frameworks of which you should be aware:
132+
133+
| Framework/library | Description |
134+
| ----- | ----- |
135+
| [Azure AI Services SDKs](/azure/developer/ai/azure-ai-for-developers) | By working directly with client SDKs, you can use the full breadth of Azure AI services functionality directly in your function code. |
136+
| [OpenAI binding extension] | Easily integrate the power of Azure OpenAI in your functions and let Functions manage the service integration. |
137+
| [Semantic Kernel](/semantic-kernel/overview) | Enables you to easily build AI agents and models. |
138+
139+
Functions also enables your apps to reference third-party libraries and frameworks, which means that you can also use all of your favorite AI tools and libraries in your AI-enabled functions.
140+
141+
## Related articles
142+
143+
+ [Azure Functions scenarios](functions-scenarios.md)
144+
+ [Tutorial: Add Azure OpenAI text completion hints to your functions in Visual Studio Code](functions-add-openai-text-completion.md)
145+
146+
[OpenAI binding extension]: functions-bindings-openai.md
147+
148+
149+
150+

articles/azure-functions/functions-scenarios.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.custom:
88
- devx-track-python
99
ms.collection:
1010
- ce-skilling-ai-copilot
11-
ms.date: 12/19/2024
11+
ms.date: 04/29/2025
1212
zone_pivot_groups: programming-languages-set-functions
1313
---
1414

@@ -26,8 +26,7 @@ There are several ways to use functions to process files into or out of a blob s
2626

2727
For example, in a retail solution, a partner system can submit product catalog information as files into blob storage. You can use a blob triggered function to validate, transform, and process the files into the main system as they're uploaded.
2828

29-
[ ![Diagram of a file upload process using Azure Functions.](./media/functions-scenarios/process-file-uploads.png) ](./media/functions-scenarios/process-file-uploads-expanded.png#lightbox)
30-
29+
:::image type="content" source="media/functions-scenarios/process-file-uploads.png" alt-text="Diagram of a file upload process using Azure Functions." lightbox="media/functions-scenarios/process-file-uploads-expanded.png":::
3130

3231
The following tutorials use a Blob trigger (Event Grid based) to process files in a blob container:
3332

@@ -86,7 +85,7 @@ So much telemetry is generated and collected from cloud applications, IoT device
8685

8786
Your functions can also use low-latency event triggers, like Event Grid, and real-time outputs like SignalR to process data in near-real-time.
8887

89-
[ ![Diagram of a real-time stream process using Azure Functions.](./media/functions-scenarios/real-time-stream-processing.png) ](./media/functions-scenarios/real-time-stream-processing-expanded.png#lightbox)
88+
:::image type="content" source="media/functions-scenarios/real-time-stream-processing.png" alt-text="Diagram of a real-time stream process using Azure Functions." lightbox="media/functions-scenarios/real-time-stream-processing-expanded.png":::
9089

9190
::: zone pivot="programming-language-csharp"
9291

@@ -149,7 +148,7 @@ Functions can connect to an OpenAI resources to enable text and chat completions
149148

150149
A function might also call a TensorFlow model or Azure AI services to process and classify a stream of images.
151150

152-
[ ![Diagram of a machine learning and AI process using Azure Functions.](./media/functions-scenarios/machine-learning-and-ai.png) ](./media/functions-scenarios/machine-learning-and-ai-expanded.png#lightbox)
151+
:::image type="content" source="media/functions-scenarios/machine-learning-and-ai.png" alt-text="Diagram of a machine learning and AI process using Azure Functions." lightbox="media/functions-scenarios/machine-learning-and-ai-expanded.png":::
153152

154153
::: zone pivot="programming-language-csharp"
155154
+ Tutorial: [Text completion using Azure OpenAI](functions-add-openai-text-completion.md?pivots=programming-language-csharp)
@@ -198,6 +197,8 @@ A function might also call a TensorFlow model or Azure AI services to process an
198197
+ Sample: [Leverage semantic search](https://github.com/Azure/azure-functions-openai-extension/tree/main/samples/rag-aisearch/powershell)
199198
::: zone-end
200199

200+
For more information, see [Use AI tools and models in Azure Functions](functions-create-ai-enabled-apps.md).
201+
201202
## Run scheduled tasks
202203

203204
Functions enables you to run your code based on a [cron schedule](./functions-bindings-timer.md#usage) that you define.
@@ -206,7 +207,7 @@ Check out how to [Create a function in the Azure portal that runs on a schedule]
206207

207208
A financial services customer database, for example, might be analyzed for duplicate entries every 15 minutes to avoid multiple communications going out to the same customer.
208209

209-
[ ![Diagram of a scheduled task where a function cleans a database every 15 minutes deduplicating entries based on business logic.](./media/functions-scenarios/scheduled-task.png) ](./media/functions-scenarios/scheduled-task-expanded.png#lightbox)
210+
:::image type="content" source="media/functions-scenarios/scheduled-task.png" alt-text="Diagram of a scheduled task where a function cleans a database every 15 minutes deduplicating entries based on business logic." lightbox="media/functions-scenarios/scheduled-task-expanded.png":::
210211

211212
::: zone pivot="programming-language-csharp"
212213

@@ -249,7 +250,7 @@ An HTTP triggered function defines an HTTP endpoint. These endpoints run functio
249250

250251
You can also use an HTTP triggered function endpoint as a webhook integration, such as GitHub webhooks. In this way, you can create functions that process data from GitHub events. To learn more, see [Monitor GitHub events by using a webhook with Azure Functions](/training/modules/monitor-github-events-with-a-function-triggered-by-a-webhook/).
251252

252-
[ ![Diagram of processing an HTTP request using Azure Functions.](./media/functions-scenarios/scalable-web-api.png) ](./media/functions-scenarios/scalable-web-api-expanded.png#lightbox)
253+
:::image type="content" source="media/functions-scenarios/scalable-web-api.png" alt-text="Diagram of processing an HTTP request using Azure Functions." lightbox="media/functions-scenarios/scalable-web-api-expanded.png":::
253254

254255
For examples, see the following:
255256
::: zone pivot="programming-language-csharp"
@@ -315,7 +316,7 @@ public static async Task<IActionResult> Run(
315316

316317
Functions is often the compute component in a serverless workflow topology, such as a Logic Apps workflow. You can also create long-running orchestrations using the Durable Functions extension. For more information, see [Durable Functions overview](./durable/durable-functions-overview.md).
317318

318-
[ ![A combination diagram of a series of specific serverless workflows using Azure Functions.](./media/functions-scenarios/build-a-serverless-workflow.png) ](./media/functions-scenarios/build-a-serverless-workflow-expanded.png#lightbox)
319+
:::image type="content" source="media/functions-scenarios/build-a-serverless-workflow.png" alt-text="A combination diagram of a series of specific serverless workflows using Azure Functions." lightbox="media/functions-scenarios/build-a-serverless-workflow-expanded.png":::
319320

320321
::: zone pivot="programming-language-csharp"
321322
+ Tutorial: [Create a function to integrate with Azure Logic Apps](./functions-twitter-email.md)
@@ -350,7 +351,7 @@ Functions is often the compute component in a serverless workflow topology, such
350351

351352
There are processes where you might need to log, audit, or perform some other operation when stored data changes. Functions triggers provide a good way to get notified of data changes to initial such an operation.
352353

353-
[ ![Diagram of a function being used to respond to database changes.](./media/functions-scenarios/respond-to-database-changes.png) ](./media/functions-scenarios/respond-to-database-changes-expanded.png#lightbox)
354+
:::image type="content" source="media/functions-scenarios/respond-to-database-changes.png" alt-text="Diagram of a function being used to respond to database changes." lightbox="media/functions-scenarios/respond-to-database-changes-expanded.png":::
354355

355356
::: zone pivot="programming-language-csharp,programming-language-javascript,programming-language-python"
356357
Consider these examples:
@@ -378,7 +379,7 @@ You can use Functions with Azure messaging services to create advanced event-dri
378379

379380
For example, you can use triggers on Azure Storage queues as a way to chain together a series of function executions. Or use service bus queues and triggers for an online ordering system.
380381

381-
[ ![Diagram of Azure Functions in a reliable message system.](./media/functions-scenarios/create-reliable-message-systems.png) ](./media/functions-scenarios/create-reliable-message-systems-expanded.png#lightbox)
382+
:::image type="content" source="media/functions-scenarios/create-reliable-message-systems.png" alt-text="Diagram of Azure Functions in a reliable message system." lightbox="media/functions-scenarios/create-reliable-message-systems-expanded.png":::
382383

383384
These articles show how to write output to a storage queue:
384385

183 KB
Loading
-8.52 KB
Loading
-28.3 KB
Loading
-19.6 KB
Loading
-17.3 KB
Loading
-26.8 KB
Loading
-20.3 KB
Loading

0 commit comments

Comments
 (0)