mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
25696a72dc
* Replace Azure Foundry/Azure AI Foundry with Microsoft Foundry in samples Update all .cs, .md, and .yaml files in dotnet/samples/ to use 'Microsoft Foundry' instead of 'Azure Foundry' and 'Azure AI Foundry'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/Program.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/samples/02-agents/Agents/Agent_Step15_DeepResearch/Program.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/samples/05-end-to-end/A2AClientServer/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/samples/02-agents/Agents/Agent_Step15_DeepResearch/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/samples/03-workflows/Agents/FoundryAgent/Program.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIProject/Program.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix grammar: 'an Microsoft' -> 'a Microsoft', 'agents ids' -> 'agent IDs' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
99 lines
2.8 KiB
Markdown
99 lines
2.8 KiB
Markdown
# Summary
|
|
|
|
These samples showcases the ability to parse a declarative Foundry Workflow file (YAML)
|
|
to build a `Workflow` that may be executed using the same pattern as any code-based workflow.
|
|
|
|
## Configuration
|
|
|
|
These samples must be configured to create and use agents your
|
|
[Microsoft Foundry Project](https://learn.microsoft.com/azure/ai-foundry).
|
|
|
|
### Settings
|
|
|
|
We suggest using .NET [Secret Manager](https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets)
|
|
to avoid the risk of leaking secrets into the repository, branches and pull requests.
|
|
You can also use environment variables if you prefer.
|
|
|
|
The configuraton required by the samples is:
|
|
|
|
|Setting Name| Description|
|
|
|:--|:--|
|
|
|AZURE_AI_PROJECT_ENDPOINT| The endpoint URL of your Microsoft Foundry Project.|
|
|
|AZURE_AI_MODEL_DEPLOYMENT_NAME| The name of the model deployment to use
|
|
|AZURE_AI_BING_CONNECTION_ID| The name of the Bing Grounding connection configured in your Microsoft Foundry Project.|
|
|
|
|
To set your secrets with .NET Secret Manager:
|
|
|
|
1. From the root of the repository, navigate the console to the project folder:
|
|
|
|
```
|
|
cd dotnet/samples/03-workflows/Declarative/ExecuteWorkflow
|
|
```
|
|
|
|
2. Examine existing secret definitions:
|
|
|
|
```
|
|
dotnet user-secrets list
|
|
```
|
|
|
|
3. If needed, perform first time initialization:
|
|
|
|
```
|
|
dotnet user-secrets init
|
|
```
|
|
|
|
4. Define setting that identifies your Microsoft Foundry Project (endpoint):
|
|
|
|
```
|
|
dotnet user-secrets set "AZURE_AI_PROJECT_ENDPOINT" "https://..."
|
|
```
|
|
|
|
5. Define setting that identifies your Microsoft Foundry Model Deployment (endpoint):
|
|
|
|
```
|
|
dotnet user-secrets set "AZURE_AI_MODEL_DEPLOYMENT_NAME" "gpt-5"
|
|
```
|
|
|
|
6. Define setting that identifies your Bing Grounding connection:
|
|
|
|
```
|
|
dotnet user-secrets set "AZURE_AI_BING_CONNECTION_ID" "mybinggrounding"
|
|
```
|
|
|
|
You may alternatively set your secrets as an environment variable (PowerShell):
|
|
|
|
```pwsh
|
|
$env:AZURE_AI_PROJECT_ENDPOINT="https://..."
|
|
$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-5"
|
|
$env:AZURE_AI_BING_CONNECTION_ID="mybinggrounding"
|
|
```
|
|
|
|
### Authorization
|
|
|
|
Use [_Azure CLI_](https://learn.microsoft.com/cli/azure/authenticate-azure-cli) to authorize access to your Microsoft Foundry Project:
|
|
|
|
```
|
|
az login
|
|
az account get-access-token
|
|
```
|
|
|
|
## Execution
|
|
|
|
The samples may be executed within _Visual Studio_ or _VS Code_.
|
|
|
|
To run the sampes from the command line:
|
|
|
|
1. From the root of the repository, navigate the console to the project folder:
|
|
|
|
```sh
|
|
cd dotnet/samples/03-workflows/Declarative/Marketing
|
|
dotnet run Marketing
|
|
```
|
|
|
|
2. Run the demo and optionally provided input:
|
|
|
|
```sh
|
|
dotnet run "An eco-friendly stainless steel water bottle that keeps drinks cold for 24 hours."
|
|
dotnet run c:/myworkflows/Marketing.yaml
|
|
```
|
|
> The sample will allow for interactive input in the absence of an input argument. |