[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-microsoft-azure-ai-vision-imageanalysis-py":3,"mdc-334x2a-key":42,"related-repo-microsoft-azure-ai-vision-imageanalysis-py":2157,"related-org-microsoft-azure-ai-vision-imageanalysis-py":2258},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":25,"repoUrl":26,"updatedAt":27,"license":28,"forks":29,"topics":30,"repo":37,"sourceUrl":40,"mdContent":41},"azure-ai-vision-imageanalysis-py","analyze images with Azure AI Vision","Azure AI Vision Image Analysis SDK for captions, tags, objects, OCR, people detection, and smart cropping. Use for computer vision and image understanding tasks.\nTriggers: \"image analysis\", \"computer vision\", \"OCR\", \"object detection\", \"ImageAnalysisClient\", \"image caption\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"microsoft","Microsoft","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fmicrosoft.png",[12,16,19,22],{"name":13,"slug":14,"type":15},"Azure","azure","tag",{"name":17,"slug":18,"type":15},"Images","images",{"name":20,"slug":21,"type":15},"Python","python",{"name":23,"slug":24,"type":15},"Computer Vision","computer-vision",2804,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills","2026-07-18T05:14:18.007737","MIT",315,[31,32,14,33,34,35,36],"agent-skills","agents","foundry","mcp","sdk","skills",{"repoUrl":26,"stars":25,"forks":29,"topics":38,"description":39},[31,32,14,33,34,35,36],"Skills, MCP servers, Custom Agents, Agents.md for SDKs to ground Coding Agents","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Ftree\u002FHEAD\u002F.github\u002Fplugins\u002Fazure-sdk-python\u002Fskills\u002Fazure-ai-vision-imageanalysis-py","---\nname: azure-ai-vision-imageanalysis-py\ndescription: |\n  Azure AI Vision Image Analysis SDK for captions, tags, objects, OCR, people detection, and smart cropping. Use for computer vision and image understanding tasks.\n  Triggers: \"image analysis\", \"computer vision\", \"OCR\", \"object detection\", \"ImageAnalysisClient\", \"image caption\".\nlicense: MIT\nmetadata:\n  author: Microsoft\n  version: \"1.0.0\"\n  package: azure-ai-vision-imageanalysis\n---\n\n# Azure AI Vision Image Analysis SDK for Python\n\nClient library for Azure AI Vision 4.0 image analysis including captions, tags, objects, OCR, and more.\n\n## Installation\n\n```bash\npip install azure-ai-vision-imageanalysis\n```\n\n## Environment Variables\n\n```bash\nVISION_ENDPOINT=https:\u002F\u002F\u003Cresource>.cognitiveservices.azure.com  # Required for all auth methods\nAZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production\nVISION_KEY=\u003Cyour-api-key>  # Only required for the legacy API-key auth path below\n```\n\n## Authentication & Lifecycle\n\n> **🔑 Two rules apply to every code sample below:**\n>\n> 1. **Prefer `DefaultAzureCredential`.** It works locally (Azure CLI \u002F VS Code \u002F Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account\u002FAPI keys — they bypass Entra audit and rotation.\n>    - Local dev: `DefaultAzureCredential` works as-is.\n>    - Production: set `AZURE_TOKEN_CREDENTIALS=prod` (or `AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>`) to constrain the credential chain to production-safe credentials.\n> 2. **Wrap every client in a context manager** so HTTP transports, sockets, and token caches are released deterministically:\n>    - Sync: `with \u003CClient>(...) as client:`\n>    - Async: `async with \u003CClient>(...) as client:` **and** `async with DefaultAzureCredential() as credential:` (from `azure.identity.aio`)\n>\n> Snippets may abbreviate this setup, but production code should always follow both rules.\n\n```python\nimport os\nfrom azure.identity import DefaultAzureCredential, ManagedIdentityCredential\nfrom azure.ai.vision.imageanalysis import ImageAnalysisClient\nfrom azure.ai.vision.imageanalysis.models import VisualFeatures\n\n# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>\ncredential = DefaultAzureCredential(require_envvar=True)\n# Or use a specific credential directly in production:\n# See https:\u002F\u002Flearn.microsoft.com\u002Fpython\u002Fapi\u002Foverview\u002Fazure\u002Fidentity-readme?view=azure-python#credential-classes\n# credential = ManagedIdentityCredential()\n\nwith ImageAnalysisClient(\n    endpoint=os.environ[\"VISION_ENDPOINT\"],\n    credential=credential,\n) as client:\n    result = client.analyze_from_url(\n        image_url=\"https:\u002F\u002Faka.ms\u002Fazsdk\u002Fimage-analysis\u002Fsample.jpg\",\n        visual_features=[VisualFeatures.CAPTION],\n    )\n```\n\n### Legacy: API Key (existing keyed deployments)\n\nNew code should use `DefaultAzureCredential` above. Use `AzureKeyCredential` only if you have an existing keyed deployment that hasn't been migrated to Entra ID yet — for example, regulated environments still completing their Entra rollout.\n\n```python\nimport os\nfrom azure.core.credentials import AzureKeyCredential\nfrom azure.ai.vision.imageanalysis import ImageAnalysisClient\nfrom azure.ai.vision.imageanalysis.models import VisualFeatures\n\nwith ImageAnalysisClient(\n    endpoint=os.environ[\"VISION_ENDPOINT\"],\n    credential=AzureKeyCredential(os.environ[\"VISION_KEY\"]),\n) as client:\n    result = client.analyze_from_url(\n        image_url=\"https:\u002F\u002Faka.ms\u002Fazsdk\u002Fimage-analysis\u002Fsample.jpg\",\n        visual_features=[VisualFeatures.CAPTION],\n    )\n```\n\n## Analyze Image from URL\n\n```python\nfrom azure.ai.vision.imageanalysis.models import VisualFeatures\n\nimage_url = \"https:\u002F\u002Fexample.com\u002Fimage.jpg\"\n\nresult = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[\n        VisualFeatures.CAPTION,\n        VisualFeatures.TAGS,\n        VisualFeatures.OBJECTS,\n        VisualFeatures.READ,\n        VisualFeatures.PEOPLE,\n        VisualFeatures.SMART_CROPS,\n        VisualFeatures.DENSE_CAPTIONS\n    ],\n    gender_neutral_caption=True,\n    language=\"en\"\n)\n```\n\n## Analyze Image from File\n\n```python\nwith open(\"image.jpg\", \"rb\") as f:\n    image_data = f.read()\n\nresult = client.analyze(\n    image_data=image_data,\n    visual_features=[VisualFeatures.CAPTION, VisualFeatures.TAGS]\n)\n```\n\n## Image Caption\n\n```python\nresult = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.CAPTION],\n    gender_neutral_caption=True\n)\n\nif result.caption:\n    print(f\"Caption: {result.caption.text}\")\n    print(f\"Confidence: {result.caption.confidence:.2f}\")\n```\n\n## Dense Captions (Multiple Regions)\n\n```python\nresult = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.DENSE_CAPTIONS]\n)\n\nif result.dense_captions:\n    for caption in result.dense_captions.list:\n        print(f\"Caption: {caption.text}\")\n        print(f\"  Confidence: {caption.confidence:.2f}\")\n        print(f\"  Bounding box: {caption.bounding_box}\")\n```\n\n## Tags\n\n```python\nresult = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.TAGS]\n)\n\nif result.tags:\n    for tag in result.tags.list:\n        print(f\"Tag: {tag.name} (confidence: {tag.confidence:.2f})\")\n```\n\n## Object Detection\n\n```python\nresult = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.OBJECTS]\n)\n\nif result.objects:\n    for obj in result.objects.list:\n        print(f\"Object: {obj.tags[0].name}\")\n        print(f\"  Confidence: {obj.tags[0].confidence:.2f}\")\n        box = obj.bounding_box\n        print(f\"  Bounding box: x={box.x}, y={box.y}, w={box.width}, h={box.height}\")\n```\n\n## OCR (Text Extraction)\n\n```python\nresult = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.READ]\n)\n\nif result.read:\n    for block in result.read.blocks:\n        for line in block.lines:\n            print(f\"Line: {line.text}\")\n            print(f\"  Bounding polygon: {line.bounding_polygon}\")\n            \n            # Word-level details\n            for word in line.words:\n                print(f\"  Word: {word.text} (confidence: {word.confidence:.2f})\")\n```\n\n## People Detection\n\n```python\nresult = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.PEOPLE]\n)\n\nif result.people:\n    for person in result.people.list:\n        print(f\"Person detected:\")\n        print(f\"  Confidence: {person.confidence:.2f}\")\n        box = person.bounding_box\n        print(f\"  Bounding box: x={box.x}, y={box.y}, w={box.width}, h={box.height}\")\n```\n\n## Smart Cropping\n\n```python\nresult = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.SMART_CROPS],\n    smart_crops_aspect_ratios=[0.9, 1.33, 1.78]  # Portrait, 4:3, 16:9\n)\n\nif result.smart_crops:\n    for crop in result.smart_crops.list:\n        print(f\"Aspect ratio: {crop.aspect_ratio}\")\n        box = crop.bounding_box\n        print(f\"  Crop region: x={box.x}, y={box.y}, w={box.width}, h={box.height}\")\n```\n\n## Async Client\n\n```python\nfrom azure.ai.vision.imageanalysis.aio import ImageAnalysisClient\nfrom azure.identity.aio import DefaultAzureCredential\n\nasync def analyze_image():\n    async with DefaultAzureCredential() as credential:\n        async with ImageAnalysisClient(\n            endpoint=endpoint,\n            credential=credential\n        ) as client:\n            result = await client.analyze_from_url(\n                image_url=image_url,\n                visual_features=[VisualFeatures.CAPTION]\n            )\n            print(result.caption.text)\n```\n\n## Visual Features\n\n| Feature | Description |\n|---------|-------------|\n| `CAPTION` | Single sentence describing the image |\n| `DENSE_CAPTIONS` | Captions for multiple regions |\n| `TAGS` | Content tags (objects, scenes, actions) |\n| `OBJECTS` | Object detection with bounding boxes |\n| `READ` | OCR text extraction |\n| `PEOPLE` | People detection with bounding boxes |\n| `SMART_CROPS` | Suggested crop regions for thumbnails |\n\n## Error Handling\n\n```python\nfrom azure.core.exceptions import HttpResponseError\n\ntry:\n    result = client.analyze_from_url(\n        image_url=image_url,\n        visual_features=[VisualFeatures.CAPTION]\n    )\nexcept HttpResponseError as e:\n    print(f\"Status code: {e.status_code}\")\n    print(f\"Reason: {e.reason}\")\n    print(f\"Message: {e.error.message}\")\n```\n\n## Image Requirements\n\n- Formats: JPEG, PNG, GIF, BMP, WEBP, ICO, TIFF, MPO\n- Max size: 20 MB\n- Dimensions: 50x50 to 16000x16000 pixels\n\n## Best Practices\n\n1. **Pick sync OR async and stay consistent.** Do not mix `azure.ai.vision.imageanalysis` sync clients with `azure.ai.vision.imageanalysis.aio` async clients in the same call path. Choose one mode per module.\n2. **Always use context managers for clients and async credentials.** Wrap every client in `with ImageAnalysisClient(...) as client:` (sync) or `async with ImageAnalysisClient(...) as client:` (async). For async `DefaultAzureCredential` from `azure.identity.aio`, also use `async with credential:` so tokens and transports are cleaned up.\n3. **Select only needed features** to optimize latency and cost\n4. **Use async client** for high-throughput scenarios\n5. **Handle HttpResponseError** for invalid images or auth issues\n6. **Enable gender_neutral_caption** for inclusive descriptions\n7. **Specify language** for localized captions\n8. **Use smart_crops_aspect_ratios** matching your thumbnail requirements\n9. **Cache results** when analyzing the same image multiple times\n\n## Reference Files\n\n| File | Contents |\n|------|----------|\n| [references\u002Fcapabilities.md](references\u002Fcapabilities.md) | Additional non-hero capabilities, operation-group coverage, and production checklists. |\n| [references\u002Fnon-hero-scenarios.md](references\u002Fnon-hero-scenarios.md) | Dedicated non-hero examples for secondary\u002Fadvanced scenarios. |\n",{"data":43,"body":47},{"name":4,"description":6,"license":28,"metadata":44},{"author":9,"version":45,"package":46},"1.0.0","azure-ai-vision-imageanalysis",{"type":48,"children":49},"root",[50,59,65,72,107,113,217,223,360,536,543,563,663,669,817,823,884,890,965,971,1054,1060,1127,1133,1224,1230,1345,1351,1441,1447,1538,1544,1662,1668,1815,1821,1913,1919,1937,1943,2090,2096,2151],{"type":51,"tag":52,"props":53,"children":55},"element","h1",{"id":54},"azure-ai-vision-image-analysis-sdk-for-python",[56],{"type":57,"value":58},"text","Azure AI Vision Image Analysis SDK for Python",{"type":51,"tag":60,"props":61,"children":62},"p",{},[63],{"type":57,"value":64},"Client library for Azure AI Vision 4.0 image analysis including captions, tags, objects, OCR, and more.",{"type":51,"tag":66,"props":67,"children":69},"h2",{"id":68},"installation",[70],{"type":57,"value":71},"Installation",{"type":51,"tag":73,"props":74,"children":79},"pre",{"className":75,"code":76,"language":77,"meta":78,"style":78},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pip install azure-ai-vision-imageanalysis\n","bash","",[80],{"type":51,"tag":81,"props":82,"children":83},"code",{"__ignoreMap":78},[84],{"type":51,"tag":85,"props":86,"children":89},"span",{"class":87,"line":88},"line",1,[90,96,102],{"type":51,"tag":85,"props":91,"children":93},{"style":92},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[94],{"type":57,"value":95},"pip",{"type":51,"tag":85,"props":97,"children":99},{"style":98},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[100],{"type":57,"value":101}," install",{"type":51,"tag":85,"props":103,"children":104},{"style":98},[105],{"type":57,"value":106}," azure-ai-vision-imageanalysis\n",{"type":51,"tag":66,"props":108,"children":110},{"id":109},"environment-variables",[111],{"type":57,"value":112},"Environment Variables",{"type":51,"tag":73,"props":114,"children":116},{"className":75,"code":115,"language":77,"meta":78,"style":78},"VISION_ENDPOINT=https:\u002F\u002F\u003Cresource>.cognitiveservices.azure.com  # Required for all auth methods\nAZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production\nVISION_KEY=\u003Cyour-api-key>  # Only required for the legacy API-key auth path below\n",[117],{"type":51,"tag":81,"props":118,"children":119},{"__ignoreMap":78},[120,166,189],{"type":51,"tag":85,"props":121,"children":122},{"class":87,"line":88},[123,129,135,140,145,150,155,160],{"type":51,"tag":85,"props":124,"children":126},{"style":125},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[127],{"type":57,"value":128},"VISION_ENDPOINT",{"type":51,"tag":85,"props":130,"children":132},{"style":131},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[133],{"type":57,"value":134},"=",{"type":51,"tag":85,"props":136,"children":137},{"style":98},[138],{"type":57,"value":139},"https:\u002F\u002F",{"type":51,"tag":85,"props":141,"children":142},{"style":131},[143],{"type":57,"value":144},"\u003C",{"type":51,"tag":85,"props":146,"children":147},{"style":98},[148],{"type":57,"value":149},"resource",{"type":51,"tag":85,"props":151,"children":152},{"style":131},[153],{"type":57,"value":154},">",{"type":51,"tag":85,"props":156,"children":157},{"style":98},[158],{"type":57,"value":159},".cognitiveservices.azure.com",{"type":51,"tag":85,"props":161,"children":163},{"style":162},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[164],{"type":57,"value":165},"  # Required for all auth methods\n",{"type":51,"tag":85,"props":167,"children":169},{"class":87,"line":168},2,[170,175,179,184],{"type":51,"tag":85,"props":171,"children":172},{"style":125},[173],{"type":57,"value":174},"AZURE_TOKEN_CREDENTIALS",{"type":51,"tag":85,"props":176,"children":177},{"style":131},[178],{"type":57,"value":134},{"type":51,"tag":85,"props":180,"children":181},{"style":98},[182],{"type":57,"value":183},"prod",{"type":51,"tag":85,"props":185,"children":186},{"style":162},[187],{"type":57,"value":188}," # Required only if DefaultAzureCredential is used in production\n",{"type":51,"tag":85,"props":190,"children":192},{"class":87,"line":191},3,[193,198,203,208,212],{"type":51,"tag":85,"props":194,"children":195},{"style":125},[196],{"type":57,"value":197},"VISION_KEY",{"type":51,"tag":85,"props":199,"children":200},{"style":131},[201],{"type":57,"value":202},"=\u003C",{"type":51,"tag":85,"props":204,"children":205},{"style":98},[206],{"type":57,"value":207},"your-api-key",{"type":51,"tag":85,"props":209,"children":210},{"style":131},[211],{"type":57,"value":154},{"type":51,"tag":85,"props":213,"children":214},{"style":162},[215],{"type":57,"value":216},"  # Only required for the legacy API-key auth path below\n",{"type":51,"tag":66,"props":218,"children":220},{"id":219},"authentication-lifecycle",[221],{"type":57,"value":222},"Authentication & Lifecycle",{"type":51,"tag":224,"props":225,"children":226},"blockquote",{},[227,236,355],{"type":51,"tag":60,"props":228,"children":229},{},[230],{"type":51,"tag":231,"props":232,"children":233},"strong",{},[234],{"type":57,"value":235},"🔑 Two rules apply to every code sample below:",{"type":51,"tag":237,"props":238,"children":239},"ol",{},[240,296],{"type":51,"tag":241,"props":242,"children":243},"li",{},[244,257,259],{"type":51,"tag":231,"props":245,"children":246},{},[247,249,255],{"type":57,"value":248},"Prefer ",{"type":51,"tag":81,"props":250,"children":252},{"className":251},[],[253],{"type":57,"value":254},"DefaultAzureCredential",{"type":57,"value":256},".",{"type":57,"value":258}," It works locally (Azure CLI \u002F VS Code \u002F Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account\u002FAPI keys — they bypass Entra audit and rotation.\n",{"type":51,"tag":260,"props":261,"children":262},"ul",{},[263,275],{"type":51,"tag":241,"props":264,"children":265},{},[266,268,273],{"type":57,"value":267},"Local dev: ",{"type":51,"tag":81,"props":269,"children":271},{"className":270},[],[272],{"type":57,"value":254},{"type":57,"value":274}," works as-is.",{"type":51,"tag":241,"props":276,"children":277},{},[278,280,286,288,294],{"type":57,"value":279},"Production: set ",{"type":51,"tag":81,"props":281,"children":283},{"className":282},[],[284],{"type":57,"value":285},"AZURE_TOKEN_CREDENTIALS=prod",{"type":57,"value":287}," (or ",{"type":51,"tag":81,"props":289,"children":291},{"className":290},[],[292],{"type":57,"value":293},"AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>",{"type":57,"value":295},") to constrain the credential chain to production-safe credentials.",{"type":51,"tag":241,"props":297,"children":298},{},[299,304,306],{"type":51,"tag":231,"props":300,"children":301},{},[302],{"type":57,"value":303},"Wrap every client in a context manager",{"type":57,"value":305}," so HTTP transports, sockets, and token caches are released deterministically:\n",{"type":51,"tag":260,"props":307,"children":308},{},[309,320],{"type":51,"tag":241,"props":310,"children":311},{},[312,314],{"type":57,"value":313},"Sync: ",{"type":51,"tag":81,"props":315,"children":317},{"className":316},[],[318],{"type":57,"value":319},"with \u003CClient>(...) as client:",{"type":51,"tag":241,"props":321,"children":322},{},[323,325,331,333,338,339,345,347,353],{"type":57,"value":324},"Async: ",{"type":51,"tag":81,"props":326,"children":328},{"className":327},[],[329],{"type":57,"value":330},"async with \u003CClient>(...) as client:",{"type":57,"value":332}," ",{"type":51,"tag":231,"props":334,"children":335},{},[336],{"type":57,"value":337},"and",{"type":57,"value":332},{"type":51,"tag":81,"props":340,"children":342},{"className":341},[],[343],{"type":57,"value":344},"async with DefaultAzureCredential() as credential:",{"type":57,"value":346}," (from ",{"type":51,"tag":81,"props":348,"children":350},{"className":349},[],[351],{"type":57,"value":352},"azure.identity.aio",{"type":57,"value":354},")",{"type":51,"tag":60,"props":356,"children":357},{},[358],{"type":57,"value":359},"Snippets may abbreviate this setup, but production code should always follow both rules.",{"type":51,"tag":73,"props":361,"children":364},{"className":362,"code":363,"language":21,"meta":78,"style":78},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import os\nfrom azure.identity import DefaultAzureCredential, ManagedIdentityCredential\nfrom azure.ai.vision.imageanalysis import ImageAnalysisClient\nfrom azure.ai.vision.imageanalysis.models import VisualFeatures\n\n# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>\ncredential = DefaultAzureCredential(require_envvar=True)\n# Or use a specific credential directly in production:\n# See https:\u002F\u002Flearn.microsoft.com\u002Fpython\u002Fapi\u002Foverview\u002Fazure\u002Fidentity-readme?view=azure-python#credential-classes\n# credential = ManagedIdentityCredential()\n\nwith ImageAnalysisClient(\n    endpoint=os.environ[\"VISION_ENDPOINT\"],\n    credential=credential,\n) as client:\n    result = client.analyze_from_url(\n        image_url=\"https:\u002F\u002Faka.ms\u002Fazsdk\u002Fimage-analysis\u002Fsample.jpg\",\n        visual_features=[VisualFeatures.CAPTION],\n    )\n",[365],{"type":51,"tag":81,"props":366,"children":367},{"__ignoreMap":78},[368,376,384,392,401,411,420,429,438,447,456,464,473,482,491,500,509,518,527],{"type":51,"tag":85,"props":369,"children":370},{"class":87,"line":88},[371],{"type":51,"tag":85,"props":372,"children":373},{},[374],{"type":57,"value":375},"import os\n",{"type":51,"tag":85,"props":377,"children":378},{"class":87,"line":168},[379],{"type":51,"tag":85,"props":380,"children":381},{},[382],{"type":57,"value":383},"from azure.identity import DefaultAzureCredential, ManagedIdentityCredential\n",{"type":51,"tag":85,"props":385,"children":386},{"class":87,"line":191},[387],{"type":51,"tag":85,"props":388,"children":389},{},[390],{"type":57,"value":391},"from azure.ai.vision.imageanalysis import ImageAnalysisClient\n",{"type":51,"tag":85,"props":393,"children":395},{"class":87,"line":394},4,[396],{"type":51,"tag":85,"props":397,"children":398},{},[399],{"type":57,"value":400},"from azure.ai.vision.imageanalysis.models import VisualFeatures\n",{"type":51,"tag":85,"props":402,"children":404},{"class":87,"line":403},5,[405],{"type":51,"tag":85,"props":406,"children":408},{"emptyLinePlaceholder":407},true,[409],{"type":57,"value":410},"\n",{"type":51,"tag":85,"props":412,"children":414},{"class":87,"line":413},6,[415],{"type":51,"tag":85,"props":416,"children":417},{},[418],{"type":57,"value":419},"# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>\n",{"type":51,"tag":85,"props":421,"children":423},{"class":87,"line":422},7,[424],{"type":51,"tag":85,"props":425,"children":426},{},[427],{"type":57,"value":428},"credential = DefaultAzureCredential(require_envvar=True)\n",{"type":51,"tag":85,"props":430,"children":432},{"class":87,"line":431},8,[433],{"type":51,"tag":85,"props":434,"children":435},{},[436],{"type":57,"value":437},"# Or use a specific credential directly in production:\n",{"type":51,"tag":85,"props":439,"children":441},{"class":87,"line":440},9,[442],{"type":51,"tag":85,"props":443,"children":444},{},[445],{"type":57,"value":446},"# See https:\u002F\u002Flearn.microsoft.com\u002Fpython\u002Fapi\u002Foverview\u002Fazure\u002Fidentity-readme?view=azure-python#credential-classes\n",{"type":51,"tag":85,"props":448,"children":450},{"class":87,"line":449},10,[451],{"type":51,"tag":85,"props":452,"children":453},{},[454],{"type":57,"value":455},"# credential = ManagedIdentityCredential()\n",{"type":51,"tag":85,"props":457,"children":459},{"class":87,"line":458},11,[460],{"type":51,"tag":85,"props":461,"children":462},{"emptyLinePlaceholder":407},[463],{"type":57,"value":410},{"type":51,"tag":85,"props":465,"children":467},{"class":87,"line":466},12,[468],{"type":51,"tag":85,"props":469,"children":470},{},[471],{"type":57,"value":472},"with ImageAnalysisClient(\n",{"type":51,"tag":85,"props":474,"children":476},{"class":87,"line":475},13,[477],{"type":51,"tag":85,"props":478,"children":479},{},[480],{"type":57,"value":481},"    endpoint=os.environ[\"VISION_ENDPOINT\"],\n",{"type":51,"tag":85,"props":483,"children":485},{"class":87,"line":484},14,[486],{"type":51,"tag":85,"props":487,"children":488},{},[489],{"type":57,"value":490},"    credential=credential,\n",{"type":51,"tag":85,"props":492,"children":494},{"class":87,"line":493},15,[495],{"type":51,"tag":85,"props":496,"children":497},{},[498],{"type":57,"value":499},") as client:\n",{"type":51,"tag":85,"props":501,"children":503},{"class":87,"line":502},16,[504],{"type":51,"tag":85,"props":505,"children":506},{},[507],{"type":57,"value":508},"    result = client.analyze_from_url(\n",{"type":51,"tag":85,"props":510,"children":512},{"class":87,"line":511},17,[513],{"type":51,"tag":85,"props":514,"children":515},{},[516],{"type":57,"value":517},"        image_url=\"https:\u002F\u002Faka.ms\u002Fazsdk\u002Fimage-analysis\u002Fsample.jpg\",\n",{"type":51,"tag":85,"props":519,"children":521},{"class":87,"line":520},18,[522],{"type":51,"tag":85,"props":523,"children":524},{},[525],{"type":57,"value":526},"        visual_features=[VisualFeatures.CAPTION],\n",{"type":51,"tag":85,"props":528,"children":530},{"class":87,"line":529},19,[531],{"type":51,"tag":85,"props":532,"children":533},{},[534],{"type":57,"value":535},"    )\n",{"type":51,"tag":537,"props":538,"children":540},"h3",{"id":539},"legacy-api-key-existing-keyed-deployments",[541],{"type":57,"value":542},"Legacy: API Key (existing keyed deployments)",{"type":51,"tag":60,"props":544,"children":545},{},[546,548,553,555,561],{"type":57,"value":547},"New code should use ",{"type":51,"tag":81,"props":549,"children":551},{"className":550},[],[552],{"type":57,"value":254},{"type":57,"value":554}," above. Use ",{"type":51,"tag":81,"props":556,"children":558},{"className":557},[],[559],{"type":57,"value":560},"AzureKeyCredential",{"type":57,"value":562}," only if you have an existing keyed deployment that hasn't been migrated to Entra ID yet — for example, regulated environments still completing their Entra rollout.",{"type":51,"tag":73,"props":564,"children":566},{"className":362,"code":565,"language":21,"meta":78,"style":78},"import os\nfrom azure.core.credentials import AzureKeyCredential\nfrom azure.ai.vision.imageanalysis import ImageAnalysisClient\nfrom azure.ai.vision.imageanalysis.models import VisualFeatures\n\nwith ImageAnalysisClient(\n    endpoint=os.environ[\"VISION_ENDPOINT\"],\n    credential=AzureKeyCredential(os.environ[\"VISION_KEY\"]),\n) as client:\n    result = client.analyze_from_url(\n        image_url=\"https:\u002F\u002Faka.ms\u002Fazsdk\u002Fimage-analysis\u002Fsample.jpg\",\n        visual_features=[VisualFeatures.CAPTION],\n    )\n",[567],{"type":51,"tag":81,"props":568,"children":569},{"__ignoreMap":78},[570,577,585,592,599,606,613,620,628,635,642,649,656],{"type":51,"tag":85,"props":571,"children":572},{"class":87,"line":88},[573],{"type":51,"tag":85,"props":574,"children":575},{},[576],{"type":57,"value":375},{"type":51,"tag":85,"props":578,"children":579},{"class":87,"line":168},[580],{"type":51,"tag":85,"props":581,"children":582},{},[583],{"type":57,"value":584},"from azure.core.credentials import AzureKeyCredential\n",{"type":51,"tag":85,"props":586,"children":587},{"class":87,"line":191},[588],{"type":51,"tag":85,"props":589,"children":590},{},[591],{"type":57,"value":391},{"type":51,"tag":85,"props":593,"children":594},{"class":87,"line":394},[595],{"type":51,"tag":85,"props":596,"children":597},{},[598],{"type":57,"value":400},{"type":51,"tag":85,"props":600,"children":601},{"class":87,"line":403},[602],{"type":51,"tag":85,"props":603,"children":604},{"emptyLinePlaceholder":407},[605],{"type":57,"value":410},{"type":51,"tag":85,"props":607,"children":608},{"class":87,"line":413},[609],{"type":51,"tag":85,"props":610,"children":611},{},[612],{"type":57,"value":472},{"type":51,"tag":85,"props":614,"children":615},{"class":87,"line":422},[616],{"type":51,"tag":85,"props":617,"children":618},{},[619],{"type":57,"value":481},{"type":51,"tag":85,"props":621,"children":622},{"class":87,"line":431},[623],{"type":51,"tag":85,"props":624,"children":625},{},[626],{"type":57,"value":627},"    credential=AzureKeyCredential(os.environ[\"VISION_KEY\"]),\n",{"type":51,"tag":85,"props":629,"children":630},{"class":87,"line":440},[631],{"type":51,"tag":85,"props":632,"children":633},{},[634],{"type":57,"value":499},{"type":51,"tag":85,"props":636,"children":637},{"class":87,"line":449},[638],{"type":51,"tag":85,"props":639,"children":640},{},[641],{"type":57,"value":508},{"type":51,"tag":85,"props":643,"children":644},{"class":87,"line":458},[645],{"type":51,"tag":85,"props":646,"children":647},{},[648],{"type":57,"value":517},{"type":51,"tag":85,"props":650,"children":651},{"class":87,"line":466},[652],{"type":51,"tag":85,"props":653,"children":654},{},[655],{"type":57,"value":526},{"type":51,"tag":85,"props":657,"children":658},{"class":87,"line":475},[659],{"type":51,"tag":85,"props":660,"children":661},{},[662],{"type":57,"value":535},{"type":51,"tag":66,"props":664,"children":666},{"id":665},"analyze-image-from-url",[667],{"type":57,"value":668},"Analyze Image from URL",{"type":51,"tag":73,"props":670,"children":672},{"className":362,"code":671,"language":21,"meta":78,"style":78},"from azure.ai.vision.imageanalysis.models import VisualFeatures\n\nimage_url = \"https:\u002F\u002Fexample.com\u002Fimage.jpg\"\n\nresult = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[\n        VisualFeatures.CAPTION,\n        VisualFeatures.TAGS,\n        VisualFeatures.OBJECTS,\n        VisualFeatures.READ,\n        VisualFeatures.PEOPLE,\n        VisualFeatures.SMART_CROPS,\n        VisualFeatures.DENSE_CAPTIONS\n    ],\n    gender_neutral_caption=True,\n    language=\"en\"\n)\n",[673],{"type":51,"tag":81,"props":674,"children":675},{"__ignoreMap":78},[676,683,690,698,705,713,721,729,737,745,753,761,769,777,785,793,801,809],{"type":51,"tag":85,"props":677,"children":678},{"class":87,"line":88},[679],{"type":51,"tag":85,"props":680,"children":681},{},[682],{"type":57,"value":400},{"type":51,"tag":85,"props":684,"children":685},{"class":87,"line":168},[686],{"type":51,"tag":85,"props":687,"children":688},{"emptyLinePlaceholder":407},[689],{"type":57,"value":410},{"type":51,"tag":85,"props":691,"children":692},{"class":87,"line":191},[693],{"type":51,"tag":85,"props":694,"children":695},{},[696],{"type":57,"value":697},"image_url = \"https:\u002F\u002Fexample.com\u002Fimage.jpg\"\n",{"type":51,"tag":85,"props":699,"children":700},{"class":87,"line":394},[701],{"type":51,"tag":85,"props":702,"children":703},{"emptyLinePlaceholder":407},[704],{"type":57,"value":410},{"type":51,"tag":85,"props":706,"children":707},{"class":87,"line":403},[708],{"type":51,"tag":85,"props":709,"children":710},{},[711],{"type":57,"value":712},"result = client.analyze_from_url(\n",{"type":51,"tag":85,"props":714,"children":715},{"class":87,"line":413},[716],{"type":51,"tag":85,"props":717,"children":718},{},[719],{"type":57,"value":720},"    image_url=image_url,\n",{"type":51,"tag":85,"props":722,"children":723},{"class":87,"line":422},[724],{"type":51,"tag":85,"props":725,"children":726},{},[727],{"type":57,"value":728},"    visual_features=[\n",{"type":51,"tag":85,"props":730,"children":731},{"class":87,"line":431},[732],{"type":51,"tag":85,"props":733,"children":734},{},[735],{"type":57,"value":736},"        VisualFeatures.CAPTION,\n",{"type":51,"tag":85,"props":738,"children":739},{"class":87,"line":440},[740],{"type":51,"tag":85,"props":741,"children":742},{},[743],{"type":57,"value":744},"        VisualFeatures.TAGS,\n",{"type":51,"tag":85,"props":746,"children":747},{"class":87,"line":449},[748],{"type":51,"tag":85,"props":749,"children":750},{},[751],{"type":57,"value":752},"        VisualFeatures.OBJECTS,\n",{"type":51,"tag":85,"props":754,"children":755},{"class":87,"line":458},[756],{"type":51,"tag":85,"props":757,"children":758},{},[759],{"type":57,"value":760},"        VisualFeatures.READ,\n",{"type":51,"tag":85,"props":762,"children":763},{"class":87,"line":466},[764],{"type":51,"tag":85,"props":765,"children":766},{},[767],{"type":57,"value":768},"        VisualFeatures.PEOPLE,\n",{"type":51,"tag":85,"props":770,"children":771},{"class":87,"line":475},[772],{"type":51,"tag":85,"props":773,"children":774},{},[775],{"type":57,"value":776},"        VisualFeatures.SMART_CROPS,\n",{"type":51,"tag":85,"props":778,"children":779},{"class":87,"line":484},[780],{"type":51,"tag":85,"props":781,"children":782},{},[783],{"type":57,"value":784},"        VisualFeatures.DENSE_CAPTIONS\n",{"type":51,"tag":85,"props":786,"children":787},{"class":87,"line":493},[788],{"type":51,"tag":85,"props":789,"children":790},{},[791],{"type":57,"value":792},"    ],\n",{"type":51,"tag":85,"props":794,"children":795},{"class":87,"line":502},[796],{"type":51,"tag":85,"props":797,"children":798},{},[799],{"type":57,"value":800},"    gender_neutral_caption=True,\n",{"type":51,"tag":85,"props":802,"children":803},{"class":87,"line":511},[804],{"type":51,"tag":85,"props":805,"children":806},{},[807],{"type":57,"value":808},"    language=\"en\"\n",{"type":51,"tag":85,"props":810,"children":811},{"class":87,"line":520},[812],{"type":51,"tag":85,"props":813,"children":814},{},[815],{"type":57,"value":816},")\n",{"type":51,"tag":66,"props":818,"children":820},{"id":819},"analyze-image-from-file",[821],{"type":57,"value":822},"Analyze Image from File",{"type":51,"tag":73,"props":824,"children":826},{"className":362,"code":825,"language":21,"meta":78,"style":78},"with open(\"image.jpg\", \"rb\") as f:\n    image_data = f.read()\n\nresult = client.analyze(\n    image_data=image_data,\n    visual_features=[VisualFeatures.CAPTION, VisualFeatures.TAGS]\n)\n",[827],{"type":51,"tag":81,"props":828,"children":829},{"__ignoreMap":78},[830,838,846,853,861,869,877],{"type":51,"tag":85,"props":831,"children":832},{"class":87,"line":88},[833],{"type":51,"tag":85,"props":834,"children":835},{},[836],{"type":57,"value":837},"with open(\"image.jpg\", \"rb\") as f:\n",{"type":51,"tag":85,"props":839,"children":840},{"class":87,"line":168},[841],{"type":51,"tag":85,"props":842,"children":843},{},[844],{"type":57,"value":845},"    image_data = f.read()\n",{"type":51,"tag":85,"props":847,"children":848},{"class":87,"line":191},[849],{"type":51,"tag":85,"props":850,"children":851},{"emptyLinePlaceholder":407},[852],{"type":57,"value":410},{"type":51,"tag":85,"props":854,"children":855},{"class":87,"line":394},[856],{"type":51,"tag":85,"props":857,"children":858},{},[859],{"type":57,"value":860},"result = client.analyze(\n",{"type":51,"tag":85,"props":862,"children":863},{"class":87,"line":403},[864],{"type":51,"tag":85,"props":865,"children":866},{},[867],{"type":57,"value":868},"    image_data=image_data,\n",{"type":51,"tag":85,"props":870,"children":871},{"class":87,"line":413},[872],{"type":51,"tag":85,"props":873,"children":874},{},[875],{"type":57,"value":876},"    visual_features=[VisualFeatures.CAPTION, VisualFeatures.TAGS]\n",{"type":51,"tag":85,"props":878,"children":879},{"class":87,"line":422},[880],{"type":51,"tag":85,"props":881,"children":882},{},[883],{"type":57,"value":816},{"type":51,"tag":66,"props":885,"children":887},{"id":886},"image-caption",[888],{"type":57,"value":889},"Image Caption",{"type":51,"tag":73,"props":891,"children":893},{"className":362,"code":892,"language":21,"meta":78,"style":78},"result = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.CAPTION],\n    gender_neutral_caption=True\n)\n\nif result.caption:\n    print(f\"Caption: {result.caption.text}\")\n    print(f\"Confidence: {result.caption.confidence:.2f}\")\n",[894],{"type":51,"tag":81,"props":895,"children":896},{"__ignoreMap":78},[897,904,911,919,927,934,941,949,957],{"type":51,"tag":85,"props":898,"children":899},{"class":87,"line":88},[900],{"type":51,"tag":85,"props":901,"children":902},{},[903],{"type":57,"value":712},{"type":51,"tag":85,"props":905,"children":906},{"class":87,"line":168},[907],{"type":51,"tag":85,"props":908,"children":909},{},[910],{"type":57,"value":720},{"type":51,"tag":85,"props":912,"children":913},{"class":87,"line":191},[914],{"type":51,"tag":85,"props":915,"children":916},{},[917],{"type":57,"value":918},"    visual_features=[VisualFeatures.CAPTION],\n",{"type":51,"tag":85,"props":920,"children":921},{"class":87,"line":394},[922],{"type":51,"tag":85,"props":923,"children":924},{},[925],{"type":57,"value":926},"    gender_neutral_caption=True\n",{"type":51,"tag":85,"props":928,"children":929},{"class":87,"line":403},[930],{"type":51,"tag":85,"props":931,"children":932},{},[933],{"type":57,"value":816},{"type":51,"tag":85,"props":935,"children":936},{"class":87,"line":413},[937],{"type":51,"tag":85,"props":938,"children":939},{"emptyLinePlaceholder":407},[940],{"type":57,"value":410},{"type":51,"tag":85,"props":942,"children":943},{"class":87,"line":422},[944],{"type":51,"tag":85,"props":945,"children":946},{},[947],{"type":57,"value":948},"if result.caption:\n",{"type":51,"tag":85,"props":950,"children":951},{"class":87,"line":431},[952],{"type":51,"tag":85,"props":953,"children":954},{},[955],{"type":57,"value":956},"    print(f\"Caption: {result.caption.text}\")\n",{"type":51,"tag":85,"props":958,"children":959},{"class":87,"line":440},[960],{"type":51,"tag":85,"props":961,"children":962},{},[963],{"type":57,"value":964},"    print(f\"Confidence: {result.caption.confidence:.2f}\")\n",{"type":51,"tag":66,"props":966,"children":968},{"id":967},"dense-captions-multiple-regions",[969],{"type":57,"value":970},"Dense Captions (Multiple Regions)",{"type":51,"tag":73,"props":972,"children":974},{"className":362,"code":973,"language":21,"meta":78,"style":78},"result = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.DENSE_CAPTIONS]\n)\n\nif result.dense_captions:\n    for caption in result.dense_captions.list:\n        print(f\"Caption: {caption.text}\")\n        print(f\"  Confidence: {caption.confidence:.2f}\")\n        print(f\"  Bounding box: {caption.bounding_box}\")\n",[975],{"type":51,"tag":81,"props":976,"children":977},{"__ignoreMap":78},[978,985,992,1000,1007,1014,1022,1030,1038,1046],{"type":51,"tag":85,"props":979,"children":980},{"class":87,"line":88},[981],{"type":51,"tag":85,"props":982,"children":983},{},[984],{"type":57,"value":712},{"type":51,"tag":85,"props":986,"children":987},{"class":87,"line":168},[988],{"type":51,"tag":85,"props":989,"children":990},{},[991],{"type":57,"value":720},{"type":51,"tag":85,"props":993,"children":994},{"class":87,"line":191},[995],{"type":51,"tag":85,"props":996,"children":997},{},[998],{"type":57,"value":999},"    visual_features=[VisualFeatures.DENSE_CAPTIONS]\n",{"type":51,"tag":85,"props":1001,"children":1002},{"class":87,"line":394},[1003],{"type":51,"tag":85,"props":1004,"children":1005},{},[1006],{"type":57,"value":816},{"type":51,"tag":85,"props":1008,"children":1009},{"class":87,"line":403},[1010],{"type":51,"tag":85,"props":1011,"children":1012},{"emptyLinePlaceholder":407},[1013],{"type":57,"value":410},{"type":51,"tag":85,"props":1015,"children":1016},{"class":87,"line":413},[1017],{"type":51,"tag":85,"props":1018,"children":1019},{},[1020],{"type":57,"value":1021},"if result.dense_captions:\n",{"type":51,"tag":85,"props":1023,"children":1024},{"class":87,"line":422},[1025],{"type":51,"tag":85,"props":1026,"children":1027},{},[1028],{"type":57,"value":1029},"    for caption in result.dense_captions.list:\n",{"type":51,"tag":85,"props":1031,"children":1032},{"class":87,"line":431},[1033],{"type":51,"tag":85,"props":1034,"children":1035},{},[1036],{"type":57,"value":1037},"        print(f\"Caption: {caption.text}\")\n",{"type":51,"tag":85,"props":1039,"children":1040},{"class":87,"line":440},[1041],{"type":51,"tag":85,"props":1042,"children":1043},{},[1044],{"type":57,"value":1045},"        print(f\"  Confidence: {caption.confidence:.2f}\")\n",{"type":51,"tag":85,"props":1047,"children":1048},{"class":87,"line":449},[1049],{"type":51,"tag":85,"props":1050,"children":1051},{},[1052],{"type":57,"value":1053},"        print(f\"  Bounding box: {caption.bounding_box}\")\n",{"type":51,"tag":66,"props":1055,"children":1057},{"id":1056},"tags",[1058],{"type":57,"value":1059},"Tags",{"type":51,"tag":73,"props":1061,"children":1063},{"className":362,"code":1062,"language":21,"meta":78,"style":78},"result = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.TAGS]\n)\n\nif result.tags:\n    for tag in result.tags.list:\n        print(f\"Tag: {tag.name} (confidence: {tag.confidence:.2f})\")\n",[1064],{"type":51,"tag":81,"props":1065,"children":1066},{"__ignoreMap":78},[1067,1074,1081,1089,1096,1103,1111,1119],{"type":51,"tag":85,"props":1068,"children":1069},{"class":87,"line":88},[1070],{"type":51,"tag":85,"props":1071,"children":1072},{},[1073],{"type":57,"value":712},{"type":51,"tag":85,"props":1075,"children":1076},{"class":87,"line":168},[1077],{"type":51,"tag":85,"props":1078,"children":1079},{},[1080],{"type":57,"value":720},{"type":51,"tag":85,"props":1082,"children":1083},{"class":87,"line":191},[1084],{"type":51,"tag":85,"props":1085,"children":1086},{},[1087],{"type":57,"value":1088},"    visual_features=[VisualFeatures.TAGS]\n",{"type":51,"tag":85,"props":1090,"children":1091},{"class":87,"line":394},[1092],{"type":51,"tag":85,"props":1093,"children":1094},{},[1095],{"type":57,"value":816},{"type":51,"tag":85,"props":1097,"children":1098},{"class":87,"line":403},[1099],{"type":51,"tag":85,"props":1100,"children":1101},{"emptyLinePlaceholder":407},[1102],{"type":57,"value":410},{"type":51,"tag":85,"props":1104,"children":1105},{"class":87,"line":413},[1106],{"type":51,"tag":85,"props":1107,"children":1108},{},[1109],{"type":57,"value":1110},"if result.tags:\n",{"type":51,"tag":85,"props":1112,"children":1113},{"class":87,"line":422},[1114],{"type":51,"tag":85,"props":1115,"children":1116},{},[1117],{"type":57,"value":1118},"    for tag in result.tags.list:\n",{"type":51,"tag":85,"props":1120,"children":1121},{"class":87,"line":431},[1122],{"type":51,"tag":85,"props":1123,"children":1124},{},[1125],{"type":57,"value":1126},"        print(f\"Tag: {tag.name} (confidence: {tag.confidence:.2f})\")\n",{"type":51,"tag":66,"props":1128,"children":1130},{"id":1129},"object-detection",[1131],{"type":57,"value":1132},"Object Detection",{"type":51,"tag":73,"props":1134,"children":1136},{"className":362,"code":1135,"language":21,"meta":78,"style":78},"result = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.OBJECTS]\n)\n\nif result.objects:\n    for obj in result.objects.list:\n        print(f\"Object: {obj.tags[0].name}\")\n        print(f\"  Confidence: {obj.tags[0].confidence:.2f}\")\n        box = obj.bounding_box\n        print(f\"  Bounding box: x={box.x}, y={box.y}, w={box.width}, h={box.height}\")\n",[1137],{"type":51,"tag":81,"props":1138,"children":1139},{"__ignoreMap":78},[1140,1147,1154,1162,1169,1176,1184,1192,1200,1208,1216],{"type":51,"tag":85,"props":1141,"children":1142},{"class":87,"line":88},[1143],{"type":51,"tag":85,"props":1144,"children":1145},{},[1146],{"type":57,"value":712},{"type":51,"tag":85,"props":1148,"children":1149},{"class":87,"line":168},[1150],{"type":51,"tag":85,"props":1151,"children":1152},{},[1153],{"type":57,"value":720},{"type":51,"tag":85,"props":1155,"children":1156},{"class":87,"line":191},[1157],{"type":51,"tag":85,"props":1158,"children":1159},{},[1160],{"type":57,"value":1161},"    visual_features=[VisualFeatures.OBJECTS]\n",{"type":51,"tag":85,"props":1163,"children":1164},{"class":87,"line":394},[1165],{"type":51,"tag":85,"props":1166,"children":1167},{},[1168],{"type":57,"value":816},{"type":51,"tag":85,"props":1170,"children":1171},{"class":87,"line":403},[1172],{"type":51,"tag":85,"props":1173,"children":1174},{"emptyLinePlaceholder":407},[1175],{"type":57,"value":410},{"type":51,"tag":85,"props":1177,"children":1178},{"class":87,"line":413},[1179],{"type":51,"tag":85,"props":1180,"children":1181},{},[1182],{"type":57,"value":1183},"if result.objects:\n",{"type":51,"tag":85,"props":1185,"children":1186},{"class":87,"line":422},[1187],{"type":51,"tag":85,"props":1188,"children":1189},{},[1190],{"type":57,"value":1191},"    for obj in result.objects.list:\n",{"type":51,"tag":85,"props":1193,"children":1194},{"class":87,"line":431},[1195],{"type":51,"tag":85,"props":1196,"children":1197},{},[1198],{"type":57,"value":1199},"        print(f\"Object: {obj.tags[0].name}\")\n",{"type":51,"tag":85,"props":1201,"children":1202},{"class":87,"line":440},[1203],{"type":51,"tag":85,"props":1204,"children":1205},{},[1206],{"type":57,"value":1207},"        print(f\"  Confidence: {obj.tags[0].confidence:.2f}\")\n",{"type":51,"tag":85,"props":1209,"children":1210},{"class":87,"line":449},[1211],{"type":51,"tag":85,"props":1212,"children":1213},{},[1214],{"type":57,"value":1215},"        box = obj.bounding_box\n",{"type":51,"tag":85,"props":1217,"children":1218},{"class":87,"line":458},[1219],{"type":51,"tag":85,"props":1220,"children":1221},{},[1222],{"type":57,"value":1223},"        print(f\"  Bounding box: x={box.x}, y={box.y}, w={box.width}, h={box.height}\")\n",{"type":51,"tag":66,"props":1225,"children":1227},{"id":1226},"ocr-text-extraction",[1228],{"type":57,"value":1229},"OCR (Text Extraction)",{"type":51,"tag":73,"props":1231,"children":1233},{"className":362,"code":1232,"language":21,"meta":78,"style":78},"result = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.READ]\n)\n\nif result.read:\n    for block in result.read.blocks:\n        for line in block.lines:\n            print(f\"Line: {line.text}\")\n            print(f\"  Bounding polygon: {line.bounding_polygon}\")\n            \n            # Word-level details\n            for word in line.words:\n                print(f\"  Word: {word.text} (confidence: {word.confidence:.2f})\")\n",[1234],{"type":51,"tag":81,"props":1235,"children":1236},{"__ignoreMap":78},[1237,1244,1251,1259,1266,1273,1281,1289,1297,1305,1313,1321,1329,1337],{"type":51,"tag":85,"props":1238,"children":1239},{"class":87,"line":88},[1240],{"type":51,"tag":85,"props":1241,"children":1242},{},[1243],{"type":57,"value":712},{"type":51,"tag":85,"props":1245,"children":1246},{"class":87,"line":168},[1247],{"type":51,"tag":85,"props":1248,"children":1249},{},[1250],{"type":57,"value":720},{"type":51,"tag":85,"props":1252,"children":1253},{"class":87,"line":191},[1254],{"type":51,"tag":85,"props":1255,"children":1256},{},[1257],{"type":57,"value":1258},"    visual_features=[VisualFeatures.READ]\n",{"type":51,"tag":85,"props":1260,"children":1261},{"class":87,"line":394},[1262],{"type":51,"tag":85,"props":1263,"children":1264},{},[1265],{"type":57,"value":816},{"type":51,"tag":85,"props":1267,"children":1268},{"class":87,"line":403},[1269],{"type":51,"tag":85,"props":1270,"children":1271},{"emptyLinePlaceholder":407},[1272],{"type":57,"value":410},{"type":51,"tag":85,"props":1274,"children":1275},{"class":87,"line":413},[1276],{"type":51,"tag":85,"props":1277,"children":1278},{},[1279],{"type":57,"value":1280},"if result.read:\n",{"type":51,"tag":85,"props":1282,"children":1283},{"class":87,"line":422},[1284],{"type":51,"tag":85,"props":1285,"children":1286},{},[1287],{"type":57,"value":1288},"    for block in result.read.blocks:\n",{"type":51,"tag":85,"props":1290,"children":1291},{"class":87,"line":431},[1292],{"type":51,"tag":85,"props":1293,"children":1294},{},[1295],{"type":57,"value":1296},"        for line in block.lines:\n",{"type":51,"tag":85,"props":1298,"children":1299},{"class":87,"line":440},[1300],{"type":51,"tag":85,"props":1301,"children":1302},{},[1303],{"type":57,"value":1304},"            print(f\"Line: {line.text}\")\n",{"type":51,"tag":85,"props":1306,"children":1307},{"class":87,"line":449},[1308],{"type":51,"tag":85,"props":1309,"children":1310},{},[1311],{"type":57,"value":1312},"            print(f\"  Bounding polygon: {line.bounding_polygon}\")\n",{"type":51,"tag":85,"props":1314,"children":1315},{"class":87,"line":458},[1316],{"type":51,"tag":85,"props":1317,"children":1318},{},[1319],{"type":57,"value":1320},"            \n",{"type":51,"tag":85,"props":1322,"children":1323},{"class":87,"line":466},[1324],{"type":51,"tag":85,"props":1325,"children":1326},{},[1327],{"type":57,"value":1328},"            # Word-level details\n",{"type":51,"tag":85,"props":1330,"children":1331},{"class":87,"line":475},[1332],{"type":51,"tag":85,"props":1333,"children":1334},{},[1335],{"type":57,"value":1336},"            for word in line.words:\n",{"type":51,"tag":85,"props":1338,"children":1339},{"class":87,"line":484},[1340],{"type":51,"tag":85,"props":1341,"children":1342},{},[1343],{"type":57,"value":1344},"                print(f\"  Word: {word.text} (confidence: {word.confidence:.2f})\")\n",{"type":51,"tag":66,"props":1346,"children":1348},{"id":1347},"people-detection",[1349],{"type":57,"value":1350},"People Detection",{"type":51,"tag":73,"props":1352,"children":1354},{"className":362,"code":1353,"language":21,"meta":78,"style":78},"result = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.PEOPLE]\n)\n\nif result.people:\n    for person in result.people.list:\n        print(f\"Person detected:\")\n        print(f\"  Confidence: {person.confidence:.2f}\")\n        box = person.bounding_box\n        print(f\"  Bounding box: x={box.x}, y={box.y}, w={box.width}, h={box.height}\")\n",[1355],{"type":51,"tag":81,"props":1356,"children":1357},{"__ignoreMap":78},[1358,1365,1372,1380,1387,1394,1402,1410,1418,1426,1434],{"type":51,"tag":85,"props":1359,"children":1360},{"class":87,"line":88},[1361],{"type":51,"tag":85,"props":1362,"children":1363},{},[1364],{"type":57,"value":712},{"type":51,"tag":85,"props":1366,"children":1367},{"class":87,"line":168},[1368],{"type":51,"tag":85,"props":1369,"children":1370},{},[1371],{"type":57,"value":720},{"type":51,"tag":85,"props":1373,"children":1374},{"class":87,"line":191},[1375],{"type":51,"tag":85,"props":1376,"children":1377},{},[1378],{"type":57,"value":1379},"    visual_features=[VisualFeatures.PEOPLE]\n",{"type":51,"tag":85,"props":1381,"children":1382},{"class":87,"line":394},[1383],{"type":51,"tag":85,"props":1384,"children":1385},{},[1386],{"type":57,"value":816},{"type":51,"tag":85,"props":1388,"children":1389},{"class":87,"line":403},[1390],{"type":51,"tag":85,"props":1391,"children":1392},{"emptyLinePlaceholder":407},[1393],{"type":57,"value":410},{"type":51,"tag":85,"props":1395,"children":1396},{"class":87,"line":413},[1397],{"type":51,"tag":85,"props":1398,"children":1399},{},[1400],{"type":57,"value":1401},"if result.people:\n",{"type":51,"tag":85,"props":1403,"children":1404},{"class":87,"line":422},[1405],{"type":51,"tag":85,"props":1406,"children":1407},{},[1408],{"type":57,"value":1409},"    for person in result.people.list:\n",{"type":51,"tag":85,"props":1411,"children":1412},{"class":87,"line":431},[1413],{"type":51,"tag":85,"props":1414,"children":1415},{},[1416],{"type":57,"value":1417},"        print(f\"Person detected:\")\n",{"type":51,"tag":85,"props":1419,"children":1420},{"class":87,"line":440},[1421],{"type":51,"tag":85,"props":1422,"children":1423},{},[1424],{"type":57,"value":1425},"        print(f\"  Confidence: {person.confidence:.2f}\")\n",{"type":51,"tag":85,"props":1427,"children":1428},{"class":87,"line":449},[1429],{"type":51,"tag":85,"props":1430,"children":1431},{},[1432],{"type":57,"value":1433},"        box = person.bounding_box\n",{"type":51,"tag":85,"props":1435,"children":1436},{"class":87,"line":458},[1437],{"type":51,"tag":85,"props":1438,"children":1439},{},[1440],{"type":57,"value":1223},{"type":51,"tag":66,"props":1442,"children":1444},{"id":1443},"smart-cropping",[1445],{"type":57,"value":1446},"Smart Cropping",{"type":51,"tag":73,"props":1448,"children":1450},{"className":362,"code":1449,"language":21,"meta":78,"style":78},"result = client.analyze_from_url(\n    image_url=image_url,\n    visual_features=[VisualFeatures.SMART_CROPS],\n    smart_crops_aspect_ratios=[0.9, 1.33, 1.78]  # Portrait, 4:3, 16:9\n)\n\nif result.smart_crops:\n    for crop in result.smart_crops.list:\n        print(f\"Aspect ratio: {crop.aspect_ratio}\")\n        box = crop.bounding_box\n        print(f\"  Crop region: x={box.x}, y={box.y}, w={box.width}, h={box.height}\")\n",[1451],{"type":51,"tag":81,"props":1452,"children":1453},{"__ignoreMap":78},[1454,1461,1468,1476,1484,1491,1498,1506,1514,1522,1530],{"type":51,"tag":85,"props":1455,"children":1456},{"class":87,"line":88},[1457],{"type":51,"tag":85,"props":1458,"children":1459},{},[1460],{"type":57,"value":712},{"type":51,"tag":85,"props":1462,"children":1463},{"class":87,"line":168},[1464],{"type":51,"tag":85,"props":1465,"children":1466},{},[1467],{"type":57,"value":720},{"type":51,"tag":85,"props":1469,"children":1470},{"class":87,"line":191},[1471],{"type":51,"tag":85,"props":1472,"children":1473},{},[1474],{"type":57,"value":1475},"    visual_features=[VisualFeatures.SMART_CROPS],\n",{"type":51,"tag":85,"props":1477,"children":1478},{"class":87,"line":394},[1479],{"type":51,"tag":85,"props":1480,"children":1481},{},[1482],{"type":57,"value":1483},"    smart_crops_aspect_ratios=[0.9, 1.33, 1.78]  # Portrait, 4:3, 16:9\n",{"type":51,"tag":85,"props":1485,"children":1486},{"class":87,"line":403},[1487],{"type":51,"tag":85,"props":1488,"children":1489},{},[1490],{"type":57,"value":816},{"type":51,"tag":85,"props":1492,"children":1493},{"class":87,"line":413},[1494],{"type":51,"tag":85,"props":1495,"children":1496},{"emptyLinePlaceholder":407},[1497],{"type":57,"value":410},{"type":51,"tag":85,"props":1499,"children":1500},{"class":87,"line":422},[1501],{"type":51,"tag":85,"props":1502,"children":1503},{},[1504],{"type":57,"value":1505},"if result.smart_crops:\n",{"type":51,"tag":85,"props":1507,"children":1508},{"class":87,"line":431},[1509],{"type":51,"tag":85,"props":1510,"children":1511},{},[1512],{"type":57,"value":1513},"    for crop in result.smart_crops.list:\n",{"type":51,"tag":85,"props":1515,"children":1516},{"class":87,"line":440},[1517],{"type":51,"tag":85,"props":1518,"children":1519},{},[1520],{"type":57,"value":1521},"        print(f\"Aspect ratio: {crop.aspect_ratio}\")\n",{"type":51,"tag":85,"props":1523,"children":1524},{"class":87,"line":449},[1525],{"type":51,"tag":85,"props":1526,"children":1527},{},[1528],{"type":57,"value":1529},"        box = crop.bounding_box\n",{"type":51,"tag":85,"props":1531,"children":1532},{"class":87,"line":458},[1533],{"type":51,"tag":85,"props":1534,"children":1535},{},[1536],{"type":57,"value":1537},"        print(f\"  Crop region: x={box.x}, y={box.y}, w={box.width}, h={box.height}\")\n",{"type":51,"tag":66,"props":1539,"children":1541},{"id":1540},"async-client",[1542],{"type":57,"value":1543},"Async Client",{"type":51,"tag":73,"props":1545,"children":1547},{"className":362,"code":1546,"language":21,"meta":78,"style":78},"from azure.ai.vision.imageanalysis.aio import ImageAnalysisClient\nfrom azure.identity.aio import DefaultAzureCredential\n\nasync def analyze_image():\n    async with DefaultAzureCredential() as credential:\n        async with ImageAnalysisClient(\n            endpoint=endpoint,\n            credential=credential\n        ) as client:\n            result = await client.analyze_from_url(\n                image_url=image_url,\n                visual_features=[VisualFeatures.CAPTION]\n            )\n            print(result.caption.text)\n",[1548],{"type":51,"tag":81,"props":1549,"children":1550},{"__ignoreMap":78},[1551,1559,1567,1574,1582,1590,1598,1606,1614,1622,1630,1638,1646,1654],{"type":51,"tag":85,"props":1552,"children":1553},{"class":87,"line":88},[1554],{"type":51,"tag":85,"props":1555,"children":1556},{},[1557],{"type":57,"value":1558},"from azure.ai.vision.imageanalysis.aio import ImageAnalysisClient\n",{"type":51,"tag":85,"props":1560,"children":1561},{"class":87,"line":168},[1562],{"type":51,"tag":85,"props":1563,"children":1564},{},[1565],{"type":57,"value":1566},"from azure.identity.aio import DefaultAzureCredential\n",{"type":51,"tag":85,"props":1568,"children":1569},{"class":87,"line":191},[1570],{"type":51,"tag":85,"props":1571,"children":1572},{"emptyLinePlaceholder":407},[1573],{"type":57,"value":410},{"type":51,"tag":85,"props":1575,"children":1576},{"class":87,"line":394},[1577],{"type":51,"tag":85,"props":1578,"children":1579},{},[1580],{"type":57,"value":1581},"async def analyze_image():\n",{"type":51,"tag":85,"props":1583,"children":1584},{"class":87,"line":403},[1585],{"type":51,"tag":85,"props":1586,"children":1587},{},[1588],{"type":57,"value":1589},"    async with DefaultAzureCredential() as credential:\n",{"type":51,"tag":85,"props":1591,"children":1592},{"class":87,"line":413},[1593],{"type":51,"tag":85,"props":1594,"children":1595},{},[1596],{"type":57,"value":1597},"        async with ImageAnalysisClient(\n",{"type":51,"tag":85,"props":1599,"children":1600},{"class":87,"line":422},[1601],{"type":51,"tag":85,"props":1602,"children":1603},{},[1604],{"type":57,"value":1605},"            endpoint=endpoint,\n",{"type":51,"tag":85,"props":1607,"children":1608},{"class":87,"line":431},[1609],{"type":51,"tag":85,"props":1610,"children":1611},{},[1612],{"type":57,"value":1613},"            credential=credential\n",{"type":51,"tag":85,"props":1615,"children":1616},{"class":87,"line":440},[1617],{"type":51,"tag":85,"props":1618,"children":1619},{},[1620],{"type":57,"value":1621},"        ) as client:\n",{"type":51,"tag":85,"props":1623,"children":1624},{"class":87,"line":449},[1625],{"type":51,"tag":85,"props":1626,"children":1627},{},[1628],{"type":57,"value":1629},"            result = await client.analyze_from_url(\n",{"type":51,"tag":85,"props":1631,"children":1632},{"class":87,"line":458},[1633],{"type":51,"tag":85,"props":1634,"children":1635},{},[1636],{"type":57,"value":1637},"                image_url=image_url,\n",{"type":51,"tag":85,"props":1639,"children":1640},{"class":87,"line":466},[1641],{"type":51,"tag":85,"props":1642,"children":1643},{},[1644],{"type":57,"value":1645},"                visual_features=[VisualFeatures.CAPTION]\n",{"type":51,"tag":85,"props":1647,"children":1648},{"class":87,"line":475},[1649],{"type":51,"tag":85,"props":1650,"children":1651},{},[1652],{"type":57,"value":1653},"            )\n",{"type":51,"tag":85,"props":1655,"children":1656},{"class":87,"line":484},[1657],{"type":51,"tag":85,"props":1658,"children":1659},{},[1660],{"type":57,"value":1661},"            print(result.caption.text)\n",{"type":51,"tag":66,"props":1663,"children":1665},{"id":1664},"visual-features",[1666],{"type":57,"value":1667},"Visual Features",{"type":51,"tag":1669,"props":1670,"children":1671},"table",{},[1672,1691],{"type":51,"tag":1673,"props":1674,"children":1675},"thead",{},[1676],{"type":51,"tag":1677,"props":1678,"children":1679},"tr",{},[1680,1686],{"type":51,"tag":1681,"props":1682,"children":1683},"th",{},[1684],{"type":57,"value":1685},"Feature",{"type":51,"tag":1681,"props":1687,"children":1688},{},[1689],{"type":57,"value":1690},"Description",{"type":51,"tag":1692,"props":1693,"children":1694},"tbody",{},[1695,1713,1730,1747,1764,1781,1798],{"type":51,"tag":1677,"props":1696,"children":1697},{},[1698,1708],{"type":51,"tag":1699,"props":1700,"children":1701},"td",{},[1702],{"type":51,"tag":81,"props":1703,"children":1705},{"className":1704},[],[1706],{"type":57,"value":1707},"CAPTION",{"type":51,"tag":1699,"props":1709,"children":1710},{},[1711],{"type":57,"value":1712},"Single sentence describing the image",{"type":51,"tag":1677,"props":1714,"children":1715},{},[1716,1725],{"type":51,"tag":1699,"props":1717,"children":1718},{},[1719],{"type":51,"tag":81,"props":1720,"children":1722},{"className":1721},[],[1723],{"type":57,"value":1724},"DENSE_CAPTIONS",{"type":51,"tag":1699,"props":1726,"children":1727},{},[1728],{"type":57,"value":1729},"Captions for multiple regions",{"type":51,"tag":1677,"props":1731,"children":1732},{},[1733,1742],{"type":51,"tag":1699,"props":1734,"children":1735},{},[1736],{"type":51,"tag":81,"props":1737,"children":1739},{"className":1738},[],[1740],{"type":57,"value":1741},"TAGS",{"type":51,"tag":1699,"props":1743,"children":1744},{},[1745],{"type":57,"value":1746},"Content tags (objects, scenes, actions)",{"type":51,"tag":1677,"props":1748,"children":1749},{},[1750,1759],{"type":51,"tag":1699,"props":1751,"children":1752},{},[1753],{"type":51,"tag":81,"props":1754,"children":1756},{"className":1755},[],[1757],{"type":57,"value":1758},"OBJECTS",{"type":51,"tag":1699,"props":1760,"children":1761},{},[1762],{"type":57,"value":1763},"Object detection with bounding boxes",{"type":51,"tag":1677,"props":1765,"children":1766},{},[1767,1776],{"type":51,"tag":1699,"props":1768,"children":1769},{},[1770],{"type":51,"tag":81,"props":1771,"children":1773},{"className":1772},[],[1774],{"type":57,"value":1775},"READ",{"type":51,"tag":1699,"props":1777,"children":1778},{},[1779],{"type":57,"value":1780},"OCR text extraction",{"type":51,"tag":1677,"props":1782,"children":1783},{},[1784,1793],{"type":51,"tag":1699,"props":1785,"children":1786},{},[1787],{"type":51,"tag":81,"props":1788,"children":1790},{"className":1789},[],[1791],{"type":57,"value":1792},"PEOPLE",{"type":51,"tag":1699,"props":1794,"children":1795},{},[1796],{"type":57,"value":1797},"People detection with bounding boxes",{"type":51,"tag":1677,"props":1799,"children":1800},{},[1801,1810],{"type":51,"tag":1699,"props":1802,"children":1803},{},[1804],{"type":51,"tag":81,"props":1805,"children":1807},{"className":1806},[],[1808],{"type":57,"value":1809},"SMART_CROPS",{"type":51,"tag":1699,"props":1811,"children":1812},{},[1813],{"type":57,"value":1814},"Suggested crop regions for thumbnails",{"type":51,"tag":66,"props":1816,"children":1818},{"id":1817},"error-handling",[1819],{"type":57,"value":1820},"Error Handling",{"type":51,"tag":73,"props":1822,"children":1824},{"className":362,"code":1823,"language":21,"meta":78,"style":78},"from azure.core.exceptions import HttpResponseError\n\ntry:\n    result = client.analyze_from_url(\n        image_url=image_url,\n        visual_features=[VisualFeatures.CAPTION]\n    )\nexcept HttpResponseError as e:\n    print(f\"Status code: {e.status_code}\")\n    print(f\"Reason: {e.reason}\")\n    print(f\"Message: {e.error.message}\")\n",[1825],{"type":51,"tag":81,"props":1826,"children":1827},{"__ignoreMap":78},[1828,1836,1843,1851,1858,1866,1874,1881,1889,1897,1905],{"type":51,"tag":85,"props":1829,"children":1830},{"class":87,"line":88},[1831],{"type":51,"tag":85,"props":1832,"children":1833},{},[1834],{"type":57,"value":1835},"from azure.core.exceptions import HttpResponseError\n",{"type":51,"tag":85,"props":1837,"children":1838},{"class":87,"line":168},[1839],{"type":51,"tag":85,"props":1840,"children":1841},{"emptyLinePlaceholder":407},[1842],{"type":57,"value":410},{"type":51,"tag":85,"props":1844,"children":1845},{"class":87,"line":191},[1846],{"type":51,"tag":85,"props":1847,"children":1848},{},[1849],{"type":57,"value":1850},"try:\n",{"type":51,"tag":85,"props":1852,"children":1853},{"class":87,"line":394},[1854],{"type":51,"tag":85,"props":1855,"children":1856},{},[1857],{"type":57,"value":508},{"type":51,"tag":85,"props":1859,"children":1860},{"class":87,"line":403},[1861],{"type":51,"tag":85,"props":1862,"children":1863},{},[1864],{"type":57,"value":1865},"        image_url=image_url,\n",{"type":51,"tag":85,"props":1867,"children":1868},{"class":87,"line":413},[1869],{"type":51,"tag":85,"props":1870,"children":1871},{},[1872],{"type":57,"value":1873},"        visual_features=[VisualFeatures.CAPTION]\n",{"type":51,"tag":85,"props":1875,"children":1876},{"class":87,"line":422},[1877],{"type":51,"tag":85,"props":1878,"children":1879},{},[1880],{"type":57,"value":535},{"type":51,"tag":85,"props":1882,"children":1883},{"class":87,"line":431},[1884],{"type":51,"tag":85,"props":1885,"children":1886},{},[1887],{"type":57,"value":1888},"except HttpResponseError as e:\n",{"type":51,"tag":85,"props":1890,"children":1891},{"class":87,"line":440},[1892],{"type":51,"tag":85,"props":1893,"children":1894},{},[1895],{"type":57,"value":1896},"    print(f\"Status code: {e.status_code}\")\n",{"type":51,"tag":85,"props":1898,"children":1899},{"class":87,"line":449},[1900],{"type":51,"tag":85,"props":1901,"children":1902},{},[1903],{"type":57,"value":1904},"    print(f\"Reason: {e.reason}\")\n",{"type":51,"tag":85,"props":1906,"children":1907},{"class":87,"line":458},[1908],{"type":51,"tag":85,"props":1909,"children":1910},{},[1911],{"type":57,"value":1912},"    print(f\"Message: {e.error.message}\")\n",{"type":51,"tag":66,"props":1914,"children":1916},{"id":1915},"image-requirements",[1917],{"type":57,"value":1918},"Image Requirements",{"type":51,"tag":260,"props":1920,"children":1921},{},[1922,1927,1932],{"type":51,"tag":241,"props":1923,"children":1924},{},[1925],{"type":57,"value":1926},"Formats: JPEG, PNG, GIF, BMP, WEBP, ICO, TIFF, MPO",{"type":51,"tag":241,"props":1928,"children":1929},{},[1930],{"type":57,"value":1931},"Max size: 20 MB",{"type":51,"tag":241,"props":1933,"children":1934},{},[1935],{"type":57,"value":1936},"Dimensions: 50x50 to 16000x16000 pixels",{"type":51,"tag":66,"props":1938,"children":1940},{"id":1939},"best-practices",[1941],{"type":57,"value":1942},"Best Practices",{"type":51,"tag":237,"props":1944,"children":1945},{},[1946,1972,2020,2030,2040,2050,2060,2070,2080],{"type":51,"tag":241,"props":1947,"children":1948},{},[1949,1954,1956,1962,1964,1970],{"type":51,"tag":231,"props":1950,"children":1951},{},[1952],{"type":57,"value":1953},"Pick sync OR async and stay consistent.",{"type":57,"value":1955}," Do not mix ",{"type":51,"tag":81,"props":1957,"children":1959},{"className":1958},[],[1960],{"type":57,"value":1961},"azure.ai.vision.imageanalysis",{"type":57,"value":1963}," sync clients with ",{"type":51,"tag":81,"props":1965,"children":1967},{"className":1966},[],[1968],{"type":57,"value":1969},"azure.ai.vision.imageanalysis.aio",{"type":57,"value":1971}," async clients in the same call path. Choose one mode per module.",{"type":51,"tag":241,"props":1973,"children":1974},{},[1975,1980,1982,1988,1990,1996,1998,2003,2005,2010,2012,2018],{"type":51,"tag":231,"props":1976,"children":1977},{},[1978],{"type":57,"value":1979},"Always use context managers for clients and async credentials.",{"type":57,"value":1981}," Wrap every client in ",{"type":51,"tag":81,"props":1983,"children":1985},{"className":1984},[],[1986],{"type":57,"value":1987},"with ImageAnalysisClient(...) as client:",{"type":57,"value":1989}," (sync) or ",{"type":51,"tag":81,"props":1991,"children":1993},{"className":1992},[],[1994],{"type":57,"value":1995},"async with ImageAnalysisClient(...) as client:",{"type":57,"value":1997}," (async). For async ",{"type":51,"tag":81,"props":1999,"children":2001},{"className":2000},[],[2002],{"type":57,"value":254},{"type":57,"value":2004}," from ",{"type":51,"tag":81,"props":2006,"children":2008},{"className":2007},[],[2009],{"type":57,"value":352},{"type":57,"value":2011},", also use ",{"type":51,"tag":81,"props":2013,"children":2015},{"className":2014},[],[2016],{"type":57,"value":2017},"async with credential:",{"type":57,"value":2019}," so tokens and transports are cleaned up.",{"type":51,"tag":241,"props":2021,"children":2022},{},[2023,2028],{"type":51,"tag":231,"props":2024,"children":2025},{},[2026],{"type":57,"value":2027},"Select only needed features",{"type":57,"value":2029}," to optimize latency and cost",{"type":51,"tag":241,"props":2031,"children":2032},{},[2033,2038],{"type":51,"tag":231,"props":2034,"children":2035},{},[2036],{"type":57,"value":2037},"Use async client",{"type":57,"value":2039}," for high-throughput scenarios",{"type":51,"tag":241,"props":2041,"children":2042},{},[2043,2048],{"type":51,"tag":231,"props":2044,"children":2045},{},[2046],{"type":57,"value":2047},"Handle HttpResponseError",{"type":57,"value":2049}," for invalid images or auth issues",{"type":51,"tag":241,"props":2051,"children":2052},{},[2053,2058],{"type":51,"tag":231,"props":2054,"children":2055},{},[2056],{"type":57,"value":2057},"Enable gender_neutral_caption",{"type":57,"value":2059}," for inclusive descriptions",{"type":51,"tag":241,"props":2061,"children":2062},{},[2063,2068],{"type":51,"tag":231,"props":2064,"children":2065},{},[2066],{"type":57,"value":2067},"Specify language",{"type":57,"value":2069}," for localized captions",{"type":51,"tag":241,"props":2071,"children":2072},{},[2073,2078],{"type":51,"tag":231,"props":2074,"children":2075},{},[2076],{"type":57,"value":2077},"Use smart_crops_aspect_ratios",{"type":57,"value":2079}," matching your thumbnail requirements",{"type":51,"tag":241,"props":2081,"children":2082},{},[2083,2088],{"type":51,"tag":231,"props":2084,"children":2085},{},[2086],{"type":57,"value":2087},"Cache results",{"type":57,"value":2089}," when analyzing the same image multiple times",{"type":51,"tag":66,"props":2091,"children":2093},{"id":2092},"reference-files",[2094],{"type":57,"value":2095},"Reference Files",{"type":51,"tag":1669,"props":2097,"children":2098},{},[2099,2115],{"type":51,"tag":1673,"props":2100,"children":2101},{},[2102],{"type":51,"tag":1677,"props":2103,"children":2104},{},[2105,2110],{"type":51,"tag":1681,"props":2106,"children":2107},{},[2108],{"type":57,"value":2109},"File",{"type":51,"tag":1681,"props":2111,"children":2112},{},[2113],{"type":57,"value":2114},"Contents",{"type":51,"tag":1692,"props":2116,"children":2117},{},[2118,2135],{"type":51,"tag":1677,"props":2119,"children":2120},{},[2121,2130],{"type":51,"tag":1699,"props":2122,"children":2123},{},[2124],{"type":51,"tag":2125,"props":2126,"children":2128},"a",{"href":2127},"references\u002Fcapabilities.md",[2129],{"type":57,"value":2127},{"type":51,"tag":1699,"props":2131,"children":2132},{},[2133],{"type":57,"value":2134},"Additional non-hero capabilities, operation-group coverage, and production checklists.",{"type":51,"tag":1677,"props":2136,"children":2137},{},[2138,2146],{"type":51,"tag":1699,"props":2139,"children":2140},{},[2141],{"type":51,"tag":2125,"props":2142,"children":2144},{"href":2143},"references\u002Fnon-hero-scenarios.md",[2145],{"type":57,"value":2143},{"type":51,"tag":1699,"props":2147,"children":2148},{},[2149],{"type":57,"value":2150},"Dedicated non-hero examples for secondary\u002Fadvanced scenarios.",{"type":51,"tag":2152,"props":2153,"children":2154},"style",{},[2155],{"type":57,"value":2156},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2158,"total":2257},[2159,2175,2196,2211,2226,2237,2250],{"slug":2160,"name":2160,"fn":2161,"description":2162,"org":2163,"tags":2164,"stars":25,"repoUrl":26,"updatedAt":2174},"azure-ai-agents-persistent-dotnet","build AI agents with Azure .NET SDK","Azure AI Agents Persistent SDK for .NET. Low-level SDK for creating and managing AI agents with threads, messages, runs, and tools. Use for agent CRUD, conversation threads, streaming responses, function calling, file search, and code interpreter. Triggers: \"PersistentAgentsClient\", \"persistent agents\", \"agent threads\", \"agent runs\", \"streaming agents\", \"function calling agents .NET\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2165,2168,2170,2171],{"name":2166,"slug":2167,"type":15},".NET","net",{"name":2169,"slug":32,"type":15},"Agents",{"name":13,"slug":14,"type":15},{"name":2172,"slug":2173,"type":15},"LLM","llm","2026-07-03T16:32:10.297433",{"slug":2176,"name":2176,"fn":2177,"description":2178,"org":2179,"tags":2180,"stars":25,"repoUrl":26,"updatedAt":2195},"azure-ai-anomalydetector-java","build anomaly detection applications with Java","Build anomaly detection applications with Azure AI Anomaly Detector SDK for Java. Use when implementing univariate\u002Fmultivariate anomaly detection, time-series analysis, or AI-powered monitoring.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2181,2184,2185,2188,2191,2192],{"name":2182,"slug":2183,"type":15},"Analytics","analytics",{"name":13,"slug":14,"type":15},{"name":2186,"slug":2187,"type":15},"Data Analysis","data-analysis",{"name":2189,"slug":2190,"type":15},"Java","java",{"name":9,"slug":8,"type":15},{"name":2193,"slug":2194,"type":15},"Monitoring","monitoring","2026-05-13T06:14:16.261754",{"slug":2197,"name":2197,"fn":2198,"description":2199,"org":2200,"tags":2201,"stars":25,"repoUrl":26,"updatedAt":2210},"azure-ai-contentsafety-java","build content moderation applications with Azure AI","Build content moderation applications with Azure AI Content Safety SDK for Java. Use when implementing text\u002Fimage analysis, blocklist management, or harm detection for hate, violence, sexual content, and self-harm.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2202,2205,2206,2207],{"name":2203,"slug":2204,"type":15},"AI Infrastructure","ai-infrastructure",{"name":13,"slug":14,"type":15},{"name":2189,"slug":2190,"type":15},{"name":2208,"slug":2209,"type":15},"Security","security","2026-07-07T06:53:31.293235",{"slug":2212,"name":2212,"fn":2213,"description":2214,"org":2215,"tags":2216,"stars":25,"repoUrl":26,"updatedAt":2225},"azure-ai-contentsafety-py","detect harmful content with Azure AI Content Safety","Azure AI Content Safety SDK for Python. Use for detecting harmful content in text and images with multi-severity classification.\nTriggers: \"azure-ai-contentsafety\", \"ContentSafetyClient\", \"content moderation\", \"harmful content\", \"text analysis\", \"image analysis\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2217,2218,2221,2222,2223,2224],{"name":13,"slug":14,"type":15},{"name":2219,"slug":2220,"type":15},"Compliance","compliance",{"name":2172,"slug":2173,"type":15},{"name":9,"slug":8,"type":15},{"name":20,"slug":21,"type":15},{"name":2208,"slug":2209,"type":15},"2026-07-18T05:14:23.017504",{"slug":2227,"name":2227,"fn":2228,"description":2229,"org":2230,"tags":2231,"stars":25,"repoUrl":26,"updatedAt":2236},"azure-ai-language-conversations-py","implement conversational language understanding with Python","Implement Conversational Language Understanding (CLU) using the azure-ai-language-conversations Python SDK. Use when working with ConversationAnalysisClient to analyze conversation intent and entities, building NLP features, or integrating language understanding into applications.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2232,2233,2234,2235],{"name":2182,"slug":2183,"type":15},{"name":13,"slug":14,"type":15},{"name":2172,"slug":2173,"type":15},{"name":20,"slug":21,"type":15},"2026-07-31T05:54:29.068751",{"slug":2238,"name":2238,"fn":2239,"description":2240,"org":2241,"tags":2242,"stars":25,"repoUrl":26,"updatedAt":2249},"azure-ai-translation-text-py","translate text using Azure AI services","Azure AI Text Translation SDK for real-time text translation, transliteration, language detection, and dictionary lookup. Use for translating text content in applications.\nTriggers: \"text translation\", \"translator\", \"translate text\", \"transliterate\", \"TextTranslationClient\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2243,2246,2247,2248],{"name":2244,"slug":2245,"type":15},"API Development","api-development",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":20,"slug":21,"type":15},"2026-07-18T05:14:16.988376",{"slug":4,"name":4,"fn":5,"description":6,"org":2251,"tags":2252,"stars":25,"repoUrl":26,"updatedAt":27},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2253,2254,2255,2256],{"name":13,"slug":14,"type":15},{"name":23,"slug":24,"type":15},{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},38,{"items":2259,"total":2394},[2260,2282,2289,2298,2305,2314,2321,2328,2335,2350,2369,2382],{"slug":2261,"name":2261,"fn":2262,"description":2263,"org":2264,"tags":2265,"stars":2279,"repoUrl":2280,"updatedAt":2281},"rushstack-best-practices","manage Rush monorepos with best practices","Provides best practices and guidance for working with Rush monorepos. Use when the user is working in a Rush-based repository, asks about Rush commands (install, update, build, rebuild), needs help with project selection, dependency management, build caching, subspace configuration, or troubleshooting Rush-specific issues.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2266,2269,2272,2273,2276],{"name":2267,"slug":2268,"type":15},"Engineering","engineering",{"name":2270,"slug":2271,"type":15},"Local Development","local-development",{"name":9,"slug":8,"type":15},{"name":2274,"slug":2275,"type":15},"Project Management","project-management",{"name":2277,"slug":2278,"type":15},"Rush","rush",6484,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Frushstack","2026-04-06T18:34:44.965032",{"slug":2160,"name":2160,"fn":2161,"description":2162,"org":2283,"tags":2284,"stars":25,"repoUrl":26,"updatedAt":2174},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2285,2286,2287,2288],{"name":2166,"slug":2167,"type":15},{"name":2169,"slug":32,"type":15},{"name":13,"slug":14,"type":15},{"name":2172,"slug":2173,"type":15},{"slug":2176,"name":2176,"fn":2177,"description":2178,"org":2290,"tags":2291,"stars":25,"repoUrl":26,"updatedAt":2195},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2292,2293,2294,2295,2296,2297],{"name":2182,"slug":2183,"type":15},{"name":13,"slug":14,"type":15},{"name":2186,"slug":2187,"type":15},{"name":2189,"slug":2190,"type":15},{"name":9,"slug":8,"type":15},{"name":2193,"slug":2194,"type":15},{"slug":2197,"name":2197,"fn":2198,"description":2199,"org":2299,"tags":2300,"stars":25,"repoUrl":26,"updatedAt":2210},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2301,2302,2303,2304],{"name":2203,"slug":2204,"type":15},{"name":13,"slug":14,"type":15},{"name":2189,"slug":2190,"type":15},{"name":2208,"slug":2209,"type":15},{"slug":2212,"name":2212,"fn":2213,"description":2214,"org":2306,"tags":2307,"stars":25,"repoUrl":26,"updatedAt":2225},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2308,2309,2310,2311,2312,2313],{"name":13,"slug":14,"type":15},{"name":2219,"slug":2220,"type":15},{"name":2172,"slug":2173,"type":15},{"name":9,"slug":8,"type":15},{"name":20,"slug":21,"type":15},{"name":2208,"slug":2209,"type":15},{"slug":2227,"name":2227,"fn":2228,"description":2229,"org":2315,"tags":2316,"stars":25,"repoUrl":26,"updatedAt":2236},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2317,2318,2319,2320],{"name":2182,"slug":2183,"type":15},{"name":13,"slug":14,"type":15},{"name":2172,"slug":2173,"type":15},{"name":20,"slug":21,"type":15},{"slug":2238,"name":2238,"fn":2239,"description":2240,"org":2322,"tags":2323,"stars":25,"repoUrl":26,"updatedAt":2249},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2324,2325,2326,2327],{"name":2244,"slug":2245,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":20,"slug":21,"type":15},{"slug":4,"name":4,"fn":5,"description":6,"org":2329,"tags":2330,"stars":25,"repoUrl":26,"updatedAt":27},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2331,2332,2333,2334],{"name":13,"slug":14,"type":15},{"name":23,"slug":24,"type":15},{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"slug":2336,"name":2336,"fn":2337,"description":2338,"org":2339,"tags":2340,"stars":25,"repoUrl":26,"updatedAt":2349},"azure-appconfiguration-java","manage configuration with Azure App Configuration","Azure App Configuration SDK for Java. Centralized application configuration management with key-value settings, feature flags, and snapshots.\nTriggers: \"ConfigurationClient java\", \"app configuration java\", \"feature flag java\", \"configuration setting java\", \"azure config java\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2341,2342,2345,2348],{"name":13,"slug":14,"type":15},{"name":2343,"slug":2344,"type":15},"Configuration","configuration",{"name":2346,"slug":2347,"type":15},"Feature Flags","feature-flags",{"name":2189,"slug":2190,"type":15},"2026-07-03T16:32:01.278468",{"slug":2351,"name":2351,"fn":2352,"description":2353,"org":2354,"tags":2355,"stars":25,"repoUrl":26,"updatedAt":2368},"azure-cosmos-rust","build applications with Azure Cosmos DB","Azure Cosmos DB library for Rust (NoSQL API). Document CRUD, containers, and globally distributed data.\nTriggers: \"cosmos db rust\", \"CosmosClient rust\", \"document crud rust\", \"NoSQL rust\", \"partition key rust\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2356,2359,2362,2365],{"name":2357,"slug":2358,"type":15},"Cosmos DB","cosmos-db",{"name":2360,"slug":2361,"type":15},"Database","database",{"name":2363,"slug":2364,"type":15},"NoSQL","nosql",{"name":2366,"slug":2367,"type":15},"Rust","rust","2026-07-31T05:54:27.021432",{"slug":2370,"name":2370,"fn":2352,"description":2371,"org":2372,"tags":2373,"stars":25,"repoUrl":26,"updatedAt":2381},"azure-cosmos-ts","Azure Cosmos DB JavaScript\u002FTypeScript SDK (@azure\u002Fcosmos) for data plane operations. Use for CRUD operations on documents, queries, bulk operations, and container management. Triggers: \"Cosmos DB\", \"@azure\u002Fcosmos\", \"CosmosClient\", \"document CRUD\", \"NoSQL queries\", \"bulk operations\", \"partition key\", \"container.items\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2374,2375,2376,2377,2378],{"name":2357,"slug":2358,"type":15},{"name":2360,"slug":2361,"type":15},{"name":9,"slug":8,"type":15},{"name":2363,"slug":2364,"type":15},{"name":2379,"slug":2380,"type":15},"TypeScript","typescript","2026-07-03T16:31:19.368382",{"slug":2383,"name":2383,"fn":2384,"description":2385,"org":2386,"tags":2387,"stars":25,"repoUrl":26,"updatedAt":2393},"azure-data-tables-java","build table storage applications with Java","Build table storage applications with Azure Tables SDK for Java. Use when working with Azure Table Storage or Cosmos DB Table API for NoSQL key-value data, schemaless storage, or structured data at scale.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2388,2389,2390,2391,2392],{"name":13,"slug":14,"type":15},{"name":2357,"slug":2358,"type":15},{"name":2360,"slug":2361,"type":15},{"name":2189,"slug":2190,"type":15},{"name":2363,"slug":2364,"type":15},"2026-05-13T06:14:17.582229",267]