@fabric-harness/azure
v1.2.2
Published
Azure Container Apps / Container Instances / AKS adapter for Fabric Harness.
Maintainers
Readme
@fabric-harness/azure
Azure and Foundry integration helpers for Fabric Harness.
Current surface:
AzureOpenAIModelProvider— Azure OpenAI chat/completions adapter.createAzureBlobArtifactStore()— Blob-backed artifact storage helper.createAzureKeyVaultSecretResolver()— Key Vault secret resolver for scoped commands.FoundryAgentServiceClient/foundryAgentTool()— invoke Azure AI Foundry Agent Service from Fabric agents.AzureArmClienttools for Container Apps jobs, AKS Run Command, and ACI exec-session creation.aksSandbox()(subpath:@fabric-harness/azure/aks-sandbox) — fullSandboxEnvruntime backed by an AKS pod. Pulls cluster credentials via ARMlistClusterUserCredentialand delegates tokubernetesSandboxfrom@fabric-harness/connectors/k8s.
Install
npm install @fabric-harness/azure @fabric-harness/sdk
# Optional: required only when using aksSandbox
npm install @kubernetes/client-nodeAKS sandbox (full SandboxEnv)
Run an entire agent inside an AKS pod — exec/readFile/writeFile/mkdir/rm all work over the pod.
import { init } from '@fabric-harness/sdk';
import { createAzureArmClient } from '@fabric-harness/azure';
import { aksSandbox } from '@fabric-harness/azure/aks-sandbox';
const arm = createAzureArmClient({
subscriptionId: process.env.AZURE_SUBSCRIPTION_ID!,
token: process.env.AZURE_ACCESS_TOKEN!,
});
const sandbox = await aksSandbox({
arm,
resourceGroup: 'my-rg',
clusterName: 'my-aks',
// Either attach to an existing pod:
podName: 'agent-pod',
// Or create an ephemeral pod from an image (auto-deleted on cleanup):
// image: 'alpine:latest',
});
const fabric = await init({ sandbox });Foundry Agent Service as a tool
import { createFoundryAgentServiceClient, foundryAgentTool } from '@fabric-harness/azure';
const foundry = createFoundryAgentServiceClient({
projectEndpoint: process.env.AZURE_FOUNDRY_PROJECT_ENDPOINT!,
agentId: process.env.AZURE_FOUNDRY_AGENT_ID!,
token: process.env.AZURE_TOKEN!,
});
const agent = await init({ tools: [foundryAgentTool(foundry)] });Azure control-plane tools
import { createAzureArmClient, azureContainerAppsJobTool, azureAksRunCommandTool } from '@fabric-harness/azure';
const arm = createAzureArmClient({ subscriptionId: process.env.AZURE_SUBSCRIPTION_ID!, token: process.env.AZURE_TOKEN! });
const tools = [azureContainerAppsJobTool(arm), azureAksRunCommandTool(arm)];Build targets
fh build --target aks and fh build --target aca emit the deployment scaffolding for AKS (k8s manifests with health probes) and Azure Container Apps (azd project + Bicep with scale-to-zero) respectively. See Azure deployment.
Keep Azure credentials in environment variables, managed identity token providers, or secret stores. Do not put tokens in prompts or payloads.
License
Apache-2.0
