Prompty.Foundry 2.0.0-alpha.10

This is a prerelease version of Prompty.Foundry.
dotnet add package Prompty.Foundry --version 2.0.0-alpha.10
                    
NuGet\Install-Package Prompty.Foundry -Version 2.0.0-alpha.10
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Prompty.Foundry" Version="2.0.0-alpha.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Prompty.Foundry" Version="2.0.0-alpha.10" />
                    
Directory.Packages.props
<PackageReference Include="Prompty.Foundry" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Prompty.Foundry --version 2.0.0-alpha.10
                    
#r "nuget: Prompty.Foundry, 2.0.0-alpha.10"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Prompty.Foundry@2.0.0-alpha.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Prompty.Foundry&version=2.0.0-alpha.10&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Prompty.Foundry&version=2.0.0-alpha.10&prerelease
                    
Install as a Cake Tool

Prompty.Foundry

Microsoft Foundry (Azure OpenAI) provider for Prompty — executor and processor for Azure-hosted models with support for both API key and Entra ID (managed identity) authentication.

Note: provider: azure is a deprecated alias for provider: foundry. Both work, but new .prompty files should use foundry.

Installation

dotnet add package Prompty.Core
dotnet add package Prompty.Foundry

Quick Start

using Prompty.Core;
using Prompty.Foundry;

// One-time setup — registers renderers, parser, and Foundry provider
// (also registers the legacy "azure" alias automatically)
new PromptyBuilder()
    .AddFoundry();

// Run a .prompty file
var result = await Pipeline.InvokeAsync("chat.prompty", new Dictionary<string, object>
{
    ["question"] = "Explain quantum computing in simple terms"
});

.prompty Configuration

API Key Authentication

---
name: foundry-chat
model:
  id: gpt-4o-mini            # your deployment name
  provider: foundry
  apiType: chat
  connection:
    kind: key
    endpoint: ${env:AZURE_OPENAI_ENDPOINT}
    apiKey: ${env:AZURE_OPENAI_API_KEY}
  options:
    temperature: 0.7
---
system:
You are a helpful assistant.

user:
{{question}}
---
name: foundry-entra
model:
  id: gpt-4o-mini
  provider: foundry
  connection:
    kind: foundry
    endpoint: ${env:AZURE_OPENAI_ENDPOINT}
---
system:
You are a helpful assistant.

user:
{{question}}

With kind: foundry, the executor uses DefaultAzureCredential from Azure.Identity, which automatically resolves credentials from managed identity, Azure CLI, Visual Studio, and other sources — no API keys needed.

Authentication Methods

connection.kind Auth Method When to Use
key API key + endpoint Development, simple setups
foundry DefaultAzureCredential (Entra ID) Production, managed identity
reference Pre-registered AzureOpenAIClient Shared client across prompts

Connection Registry

// Pre-register an authenticated client
var client = new AzureOpenAIClient(
    new Uri(endpoint),
    new DefaultAzureCredential());
ConnectionRegistry.Register("my-foundry", client);
# Reference it in .prompty
model:
  connection:
    kind: reference
    name: my-foundry

Supported API Types

apiType Description
chat (default) Chat completions
embedding Text embeddings
image Image generation
responses Responses API

Dependencies

Documentation

Visit prompty.ai for full documentation.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-alpha.10 42 4/14/2026
2.0.0-alpha.9 49 4/13/2026
2.0.0-alpha.8 43 4/10/2026
2.0.0-alpha.7 46 4/9/2026
2.0.0-alpha.6 42 4/8/2026
2.0.0-alpha.2 44 4/8/2026
2.0.0-alpha.1 48 4/8/2026