यह पोस्ट स्वचालित रूप से अनुवादित है। मूल के लिए, यहाँ क्लिक करें.
अगर आप अभी .NET के साथ AI agents build कर रहे हैं, तो आपने शायद एक बात notice की होगी: Azure पर उन्हें host करने के बहुत तरीके हैं। Container Apps, AKS, Functions, App Service, Foundry Agents, Foundry Hosted Agents — और ये सब तब तक reasonable लगते हैं जब तक आपको actually एक चुनना नहीं पड़ता। Microsoft ने हाल ही में Azure AI agent hosting का एक comprehensive guide publish किया है जो इसे clear करता है, और मैं इसे एक practical .NET developer perspective से break down करना चाहता हूँ।
एक नज़र में छह options
यहाँ बताया गया है कि मैं इस landscape को कैसे summarize करूँगा:
| Option | सबसे अच्छा | आप manage करते हैं |
|---|---|---|
| Container Apps | K8s complexity के बिना full container control | Observability, state, lifecycle |
| AKS | Enterprise compliance, multi-cluster, custom networking | सब कुछ (यही तो point है) |
| Azure Functions | Event-driven, short-running agent tasks | ज़्यादा नहीं — true serverless |
| App Service | Simple HTTP agents, predictable traffic | Deployment, scaling config |
| Foundry Agents | Code-optional agents via portal/SDK | लगभग कुछ नहीं |
| Foundry Hosted Agents | Custom framework agents with managed infra | केवल आपका agent code |
पहले चार general-purpose compute हैं — आप उन पर agents चला सकते हैं, लेकिन वे इसके लिए design नहीं किए गए। अंतिम दो agent-native हैं: वे conversations, tool calls, और agent lifecycles को first-class concepts के रूप में समझते हैं।
Foundry Hosted Agents — .NET agent developers के लिए sweet spot
यहाँ जो मेरा ध्यान खींचा। Foundry Hosted Agents बीच में sit करते हैं: आपको अपना code चलाने की flexibility मिलती है (Semantic Kernel, Agent Framework, LangGraph — जो भी) लेकिन platform infrastructure, observability, और conversation management handle करता है।
मुख्य piece है Hosting Adapter — एक thin abstraction layer जो आपके agent framework को Foundry platform से bridge करता है। Microsoft Agent Framework के लिए, यह इस तरह दिखता है:
from azure.ai.agentserver.agentframework import from_agent_framework
agent = ChatAgent(
chat_client=AzureAIAgentClient(...),
instructions="You are a helpful assistant.",
tools=[get_local_time],
)
if __name__ == "__main__":
from_agent_framework(agent).run()
यही आपकी पूरी hosting story है। Adapter protocol translation, server-sent events के ज़रिये streaming, conversation history, और OpenTelemetry tracing handle करता है — सब automatically। कोई custom middleware नहीं, कोई manual plumbing नहीं।
Deploy करना genuinely simple है
मैंने पहले Container Apps पर agents deploy किए हैं और यह काम करता है, लेकिन आप state management और observability के लिए काफी glue code लिखते हैं। Hosted Agents और azd के साथ, deployment है:
# AI agent extension install करें
azd ext install azure.ai.agents
# Template से init करें
azd ai agent init
# Build, push, deploy — हो गया
azd up
वह single azd up आपका container build करता है, उसे ACR में push करता है, Foundry project provision करता है, model endpoints deploy करता है, और आपका agent start करता है। पाँच steps एक command में।
Built-in conversation management
यही production में सबसे ज़्यादा समय बचाता है। अपना conversation state store बनाने की बजाय, Hosted Agents इसे natively handle करते हैं:
# एक persistent conversation बनाएं
conversation = openai_client.conversations.create()
# पहला turn
response1 = openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent_reference": {"name": "MyAgent", "type": "agent_reference"}},
input="Remember: my favorite number is 42.",
)
# दूसरा turn — context preserve होता है
response2 = openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent_reference": {"name": "MyAgent", "type": "agent_reference"}},
input="Multiply my favorite number by 10.",
)
कोई Redis नहीं। कोई Cosmos DB session store नहीं। Message serialization के लिए कोई custom middleware नहीं। Platform बस इसे handle कर लेता है।
मेरा decision framework
सभी छह options को देखने के बाद, यह मेरा quick mental model है:
- क्या आपको zero infrastructure चाहिए? → Foundry Agents (portal/SDK, no containers)
- क्या आपके पास custom agent code है लेकिन managed hosting चाहिए? → Foundry Hosted Agents
- क्या आपको event-driven, short-lived agent tasks चाहिए? → Azure Functions
- क्या आपको K8s के बिना maximum container control चाहिए? → Container Apps
- क्या आपको strict compliance और multi-cluster चाहिए? → AKS
- क्या आपके पास predictable traffic वाला simple HTTP agent है? → App Service
Semantic Kernel या Microsoft Agent Framework के साथ build करने वाले ज़्यादातर .NET developers के लिए, Hosted Agents likely सही starting point है। आपको scale-to-zero, built-in OpenTelemetry, conversation management, और framework flexibility मिलती है — Kubernetes manage किए बिना या अपनी observability stack wire up किए बिना।
निष्कर्ष
Azure पर agent hosting landscape तेज़ी से mature हो रहा है। अगर आप आज एक नया AI agent project शुरू कर रहे हैं, तो habit से Container Apps या AKS पर जाने से पहले Foundry Hosted Agents को seriously consider करें। Managed infrastructure real time बचाती है, और hosting adapter pattern आपको अपना framework choice रखने देता है।
Microsoft का पूरा guide और working examples के लिए Foundry Samples repo देखें।
