Skills azure-ai-vision-imageanalysis-java
📦

azure-ai-vision-imageanalysis-java

Safe

Build image analysis apps with Azure AI Vision Java SDK

Need to add image captioning, OCR text extraction, object detection, or smart cropping to your Java application. This skill provides ready-to-use code patterns for integrating Azure AI Vision SDK with proper credential management and error handling.

Supports: Claude Codex Code(CC)
🥉 72 Bronze
1

Download the skill ZIP

2

Upload in Claude

Go to Settings → Capabilities → Skills → Upload skill

3

Toggle on and start using

Test it

Using "azure-ai-vision-imageanalysis-java". Generate caption for image.jpg

Expected outcome:

The Azure AI Vision SDK generates a caption like: 'A group of people sitting at a conference table discussing a presentation' with a confidence score of 0.92. The code shows how to extract both the text and confidence value.

Using "azure-ai-vision-imageanalysis-java". Extract text from receipt.png

Expected outcome:

OCR results include structured text blocks with line and word-level details. Each word shows its text, confidence score (e.g., 0.98), and bounding polygon coordinates for precise positioning.

Using "azure-ai-vision-imageanalysis-java". Detect objects in photo.jpg

Expected outcome:

Object detection returns an array of detected objects. Each object includes tags with names (e.g., 'person', 'laptop') and confidence scores, plus bounding box coordinates (x, y, width, height) for drawing detection boxes.

Security Audit

Safe
v1 • 2/24/2026

This is a legitimate Azure AI Vision SDK documentation skill for Java. Static analysis flagged many patterns but all are false positives: (1) External commands detected at lines 15-268 are Maven XML and Java code examples, not shell commands. (2) Network URLs at lines 102, 269, 281 are example/demo URLs and documentation links. (3) Environment variable access at lines 32-33 uses System.getenv() for secure credential management - this is the recommended secure practice. (4) High/blocker findings for 'weak cryptographic algorithm' are YAML metadata and table formatting, not cryptographic code. The skill uses proper security practices by reading Azure credentials from environment variables rather than hardcoding them.

1
Files scanned
295
Lines analyzed
4
findings
1
Total audits
Low Risk Issues (4)
External Commands Detection - False Positive
Static analyzer flagged 38 instances of 'Ruby/shell backtick execution' at various lines (15-268). Upon manual review, these are Maven XML dependency definitions and Java code examples - NOT shell commands. The analyzer incorrectly identified XML tags like <groupId> and <artifactId> as shell backticks.
Hardcoded URLs - False Positive
Static analyzer flagged 3 hardcoded URLs. These are all legitimate: (1) Line 102: example.com demo URL in sample code, (2) Line 269: Azure endpoint template for environment configuration, (3) Line 281: Microsoft documentation link. No credential exfiltration risk.
Environment Variable Access - Legitimate Secure Practice
Static analyzer flagged System.getenv() calls at lines 32-33. This is the SECURE recommended practice for handling Azure credentials - reading from environment variables rather than hardcoding them in source code. This is NOT a security vulnerability.
Weak Cryptographic Algorithm - False Positive
Static analyzer flagged 'weak cryptographic algorithm' at lines 3, 65, 67, 281, 294. These are: Line 3 (YAML: 'risk: unknown'), lines 65-67 (Markdown table formatting), line 281 (Azure documentation URL), line 294 (skill description). No cryptographic code present.

Detected Patterns

Critical Heuristic: Code Execution + Network + Credential Access - FALSE POSITIVE
Audited by: claude

Quality Score

38
Architecture
100
Maintainability
87
Content
32
Community
97
Security
100
Spec Compliance

What You Can Build

Automate document digitization

Extract text from scanned documents, receipts, and invoices to create searchable digital archives. Use OCR to convert paper documents into editable text.

Enhance e-commerce product catalogs

Automatically generate product image captions and detect objects for better search indexing. Create consistent smart-cropped thumbnails for uniform catalog display.

Build accessibility features

Generate image descriptions for visually impaired users. Provide automatic alt text for images in content management systems.

Try These Prompts

Basic image caption
Use the Azure AI Vision Java SDK to generate a caption for the image at local file path /path/to/image.jpg. Show how to set up the client with environment variables and print the caption text with confidence score.
Extract text from document
Show me how to use the Azure AI Vision SDK to perform OCR on a scanned document image. Include code to iterate through detected text blocks, lines, and words with their bounding polygons.
Multi-feature analysis
Write Java code that analyzes an image using multiple visual features: caption, tags, objects, and read (OCR). Show how to configure the analysis options for gender-neutral captions and specify language.
Async image processing
Demonstrate how to use the async client in Azure AI Vision Java SDK to analyze images. Show the subscription pattern for handling async results and errors.

Best Practices

  • Always store Azure credentials in environment variables, never hardcode API keys in source code
  • Use async clients for high-volume image processing to improve throughput
  • Handle HttpResponseException for robust error handling and retry logic

Avoid

  • Do not hardcode API keys or endpoint URLs in your Java source files
  • Do not ignore error handling - always catch and log Azure service exceptions
  • Do not process images larger than 20MB - resize before analysis to avoid failures

Frequently Asked Questions

How do I authenticate with Azure AI Vision?
You can authenticate using an API key with KeyCredential or use DefaultAzureCredential for managed identity support. Store your VISION_ENDPOINT and VISION_KEY in environment variables.
What image formats are supported?
Azure AI Vision supports JPEG, PNG, GIF, BMP, WEBP, ICO, TIFF, and MPO formats. Image size must be under 20MB with dimensions between 50x50 and 16000x16000 pixels.
Can I analyze images from a URL?
Yes, use the analyzeFromUrl() method to analyze images accessible via HTTP URLs. The SDK also supports analyzing local files using BinaryData.fromFile().
How accurate is the caption feature?
Caption confidence scores typically range from 0.0 to 1.0. Higher scores indicate more reliable captions. Dense Captions provides multiple descriptions for different image regions.
What languages are supported for OCR?
Azure AI Vision OCR supports over 90 languages. Specify the language in ImageAnalysisOptions using setLanguage() for best results.
Does this work with on-premise Azure Stack?
Yes, Azure AI Vision SDK can connect to Azure Stack or other Azure Cognitive Services instances by setting the appropriate endpoint URL to your local service.

Developer Details

File structure

📄 SKILL.md