Azure AI Vision Image Analysis for Java
A practical Java SDK guide for captions, OCR, object detection, tagging, and smart image cropping.
The skill exposes API-key environment variables, DefaultAzureCredential, and managed identity, and recommends managed identity for production. However, it does not disclose that images and OCR data are sent to Azure, data retention, sensitive-content handling, least-privilege requirements, user confirmation, network boundaries, or rollback. No malware, credential theft, or destructive default is evident, but these omissions warrant deductions.
The main path covers installation, synchronous and asynchronous clients, major visual features, and HTTP error handling. However, the beta dependency is unexplained; several examples rely on undefined imageUrl, endpoint, or imports; input validation, empty-result handling, timeout configuration, and implemented retry behavior are missing. Some SDK calls are not statically verified as compilable. Static calibration therefore keeps this below 10.
The audience, capability scope, and trigger phrases are reasonably clear, covering captions, OCR, objects, tags, people, and cropping, with regional limits and a language option noted. Boundaries for unsuitable use, privacy-sensitive images, cost and quotas, deployment prerequisites, and mainland-China network reachability are not addressed, so points are deducted.
SKILL.md provides metadata, installation, client setup, a feature table, examples, error handling, environment variables, limitations, and trigger phrases, with an additional examples reference. However, it lacks a changelog, stable-version policy, explicit maintenance/update path, and explanation of the beta dependency. Repeated examples contain hidden assumptions. MIT licensing and Microsoft authorship are clear.
The material can directly inform code generation for common Java image-analysis tasks and includes broad feature coverage plus a report example. However, examples are not shown to compile or execute, outputs are mostly console-oriented, and production integration guidance for configuration, testing, retries, and privacy is incomplete. Static evidence supports only limited effectiveness.
The versioned skill file, reference examples, MIT license, and repository CI/evaluation material provide some auditability. There is no skill-specific test suite, real execution evidence, or independent corroboration for the documented SDK paths; external documentation is only linked, so static reproducibility is limited.
- Do not hard-code or commit API keys; prefer managed identity and verify minimal RBAC permissions for the Azure resource.
- Treat images, OCR text, and remote URLs as potentially sensitive; confirm data flow, region, retention, and user authorization before deployment.
- Compile and validate version 1.1.0-beta.1 and the examples in the target project; add missing variables/imports, empty-result handling, timeouts, and exponential-backoff retries.
- Separately verify regional availability and mainland-China network/service reachability for Caption and Dense Captions.
What it does & when to use it
This skill helps Java developers build applications with the Azure AI Vision Image Analysis SDK. It provides Maven installation, API-key and Azure identity authentication, and synchronous or asynchronous client examples. The covered features include captions, dense captions, OCR, tags, objects, people, and smart crops. It fits applications that can provide an Azure Vision endpoint and credentials, with regional constraints for caption features.
It shows how to add the com.azure:azure-ai-vision-imageanalysis Maven dependency, create synchronous or asynchronous clients, and analyze local image files or image URLs through an Azure Vision endpoint. The examples generate captions, extract text with confidence and bounding polygons, return tags, detect objects and people with bounding boxes, produce smart-crop regions, and combine multiple visual features. It also demonstrates gender-neutral captions, language selection, environment variables, and HttpResponseException handling.
- A Java developer needs human-readable descriptions for uploaded images and uses CAPTION or DENSE_CAPTIONS.
- A document-processing application needs OCR text, lines, words, confidence values, and locations from images and uses READ.
- An image catalog or moderation workflow needs detected objects and bounding boxes and uses OBJECTS.
- An application needs content tags or person locations from images and uses TAGS or PEOPLE.
- A thumbnail service needs salient regions for selected aspect ratios and uses SMART_CROPS.
Pros & cons
- Covers captions, OCR, tags, objects, people, and smart cropping in one Java-focused guide.
- Includes API-key and DefaultAzureCredential authentication, plus synchronous and asynchronous clients.
- Provides concrete examples for local files and URLs, confidence values, bounding boxes, and error details.
- The Maven example uses the beta version `1.1.0-beta.1`.
- CAPTION and DENSE_CAPTIONS require GPU-supported regions, so regional availability must be checked before deployment.
- The application requires an Azure Vision endpoint and credentials; the source does not document pricing, quotas, or a complete deployment workflow.
How to install
Install the collection with npx skills add microsoft/skills, then select this skill in the wizard. Skills are installed to the selected agent directory, such as .github/skills/ for GitHub Copilot. Add the Maven dependency com.azure:azure-ai-vision-imageanalysis:1.1.0-beta.1 to the Java project.
How to use
Example triggers include image analysis Java, Azure Vision SDK, image captioning, and OCR image text extraction. Set VISION_ENDPOINT; also set VISION_KEY for API-key authentication, or AZURE_TOKEN_CREDENTIALS=prod when using DefaultAzureCredential in production. Use the provided Java patterns with analyze or analyzeFromUrl and select the required VisualFeatures.