cu-sdk-setup

Configure Java environments for Azure AI Content Understanding SDK setup and sample execution.

2.6k|2.2k|Updated Dec 6, 2011
One-click install
npx skills add https://github.com/Azure/azure-sdk-for-java --skill cu-sdk-setup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cu-sdk-setup
Source: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/cu-sdk-setup
Command: npx skills add https://github.com/Azure/azure-sdk-for-java --skill cu-sdk-setup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Setting up the Azure AI Content Understanding Java SDK requires coordinating JDK and Maven versions, Azure resource provisioning, model deployments, and environment variables, which is error-prone when done manually.

Core Features & Use Cases

  • Toolchain Verification and Installation: Probes for JDK 8+ and Maven 3.6+, and offers platform-specific install commands for macOS, Linux, and Windows when missing.
  • Interactive .env Configuration: Gathers the Foundry endpoint, authentication method (API key or DefaultAzureCredential), and model deployment names, then writes a safely quoted .env file plus a PowerShell loader helper.
  • Foundry Resource Probing: Calls the Content Understanding defaults API to detect existing model deployments and skips redundant one-time configuration when defaults are already set.
  • Use Case: A developer cloning azure-sdk-for-java runs the setup script, answers a few prompts, and is ready to run Sample02_AnalyzeUrl with mvn exec:java in minutes.

Quick Start

Ask the assistant to set up your Java environment for the Azure AI Content Understanding SDK and walk you through running your first sample.

Frequently Asked Questions about cu-sdk-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up the Azure AI Content Understanding Java SDK?

Run the setup_user_env.sh script (or setup_user_env.ps1 on Windows) from the package directory. It verifies JDK 8+ and Maven 3.6+, resolves dependencies, and interactively creates a .env file with your Foundry endpoint and model deployments.

How do I run Azure Content Understanding Java samples with Maven?

Load the .env file into your shell first, then run mvn exec:java with -Dexec.mainClass pointing to the sample class and -Dexec.classpathScope=test. The test classpath scope is required because samples live under src/samples/java.

Does the Content Understanding SDK support DefaultAzureCredential authentication?

Yes, you can leave CONTENTUNDERSTANDING_KEY empty and authenticate via DefaultAzureCredential after running az login. You must also assign yourself the Cognitive Services User role on the Foundry resource, even if you own it.

Why do I get ClassNotFoundException when running Content Understanding samples?

This happens when -Dexec.classpathScope=test is missing from the mvn exec:java command. Sample classes are compiled into the test classpath, so without that flag Maven cannot find them.

Why does mvn install -DskipTests fail with a jacoco check error?

The default build enforces a minimum coverage ratio, and skipping tests produces no coverage data, causing the jacoco check goal to fail. Add -Djacoco.skip=true to the command to bypass the coverage check during environment setup.

What Java and Maven versions are required for the Content Understanding SDK?

The SDK requires JDK 8 or later, with JDK 11, 17, or 21 LTS recommended, and Maven 3.6 or later. The setup script probes both versions and offers to install them via Homebrew, apt, or winget if missing.