azure_ai_foundry_core
Core types, authentication, and HTTP client for the Azure AI Foundry Rust SDK.
This crate provides the foundational building blocks used by all other azure_ai_foundry_* crates.
Features
- FoundryClient — HTTP client with builder pattern (
get,post,delete,post_multipart,get_bytes) - FoundryCredential — Authentication via API key or Microsoft Entra ID
- FoundryError — Typed error handling with
thiserror - Retry logic — Automatic retries with exponential backoff for transient errors
- Tracing — Full instrumentation with
tracingspans - Security — HTTPS validation, error sanitization, token refresh hardening
Installation
[]
= "0.8"
= { = "1", = ["full"] }
Usage
API Key Authentication
use FoundryClient;
use FoundryCredential;
async
Microsoft Entra ID Authentication
use FoundryClient;
use FoundryCredential;
async
Environment Variables
The SDK automatically checks these environment variables:
# Falls back to Entra ID if not set
use FoundryClient;
use FoundryCredential;
#
Modules
| Module | Description |
|---|---|
auth |
FoundryCredential for API key and Entra ID authentication |
client |
FoundryClient builder and HTTP client |
error |
FoundryError type with typed error variants |
models |
Common types shared across crates |
Related Crates
azure_ai_foundry_models— Chat completions and embeddingsazure_ai_foundry_agents— Agent Service (agents, threads, runs, files, vector stores)azure_ai_foundry_tools— Vision and Document Intelligence
License
This project is licensed under the MIT License.