The Java Generative AI course runs in Codespaces against Azure AI Foundry
Learn Generative AI fundamentals through Java programming.
At a glance
- What is it?
- Microsoft's Generative AI for Beginners, Java edition, is a five-chapter course that teaches Spring AI and the OpenAI Java SDK against Azure AI Foundry, with keyless Microsoft Entra ID authentication and no API keys to manage. The environment is a devcontainer or a Codespace, and the whole thing is MIT licensed with translations in more than fifty languages.
- Who is it for?
- Adopt this course if your team writes Java and has no in-house curriculum for prompt engineering, embeddings, RAG and function calling, because the five chapters build from tokenisation concepts to a working MCP calculator service and the samples are concrete rather than conceptual. Do not adopt it if your environment is cloud-free, because every chapter depends on Azure AI Foundry or a local Foundry install and the content safety chapter tests Azure's own filters.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 31 days ago.
- What is it written in?
- Mainly Java, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Five chapters that move from tokens to a deployed MCP service
The course is organised as a numbered path, and each chapter lists what it covers before linking to its own README.
Chapter 1, Introduction to Generative AI, covers core concepts, meaning large language models, tokens, embeddings and AI capabilities, then surveys the Java AI ecosystem with Spring AI and the OpenAI SDKs, introduces the Model Context Protocol and its role in AI agent communication, and finishes with practical applications including chatbots and content generation.
Chapter 2 is the environment chapter. It covers provisioning Azure AI Foundry, using Bicep and the Azure Developer CLI, and it names the pieces: GPT-5.6 Luna chat and text-embedding-3-small embeddings, Spring Boot 4.1.1 with Spring AI 2.0.1 and the ChatClient, backed by the official OpenAI Java SDK and Azure OpenAI v1. The notable choice there is keyless authentication with Microsoft Entra ID and no API keys to manage. The rest of the chapter is tooling: Docker containers, VS Code and GitHub Codespaces configuration.
Chapter 3 is where the techniques live: the official OpenAI Java SDK called against Azure OpenAI v1 with keyless authentication, prompt engineering, embeddings and vector operations for semantic search and similarity matching, retrieval-augmented generation combining the model with your own data sources, and function calling to extend the model with custom tools and plugins.
Chapter 4 is three projects rather than a chapter of prose. The Pet Story Generator in the petstory/ folder is creative content generation with Azure AI Foundry. The Foundry Local Demo in foundrylocal/ is local AI model integration with the OpenAI Java SDK, which is the one path that does not need a cloud endpoint. The MCP Calculator Service in the calculator/ folder is described as a basic Model Context Protocol implementation with Spring AI.
Chapter 5 is Responsible AI Development, covering Azure AI Foundry Content Safety and testing built-in content filtering including hard blocks and soft refusals, a responsible AI demo, and best practice guidelines for ethical development and deployment.
The whole workshop runs without a local setup
The README makes an unusual claim for a course repository: the entire workshop can be completed online without local setup. The environment setup takes 2 minutes, with exploring the samples requiring 1-3 hours depending on exploration depth.
The quick start path is six steps and they are all browser actions. You fork the repository to your GitHub account, click Code, then the Codespaces tab, then the ... menu, then New with options. You use the defaults, which selects the development container created for this course, and click Create codespace. You wait about two minutes for the environment to be ready, and then jump straight to Chapter 2, which is the provisioning chapter.
That jump is deliberate and worth noting. A reader who has never seen an LLM starts at chapter 1, but the setup chapter requires an Azure subscription and provisioning steps, so anyone who already knows the concepts can skip straight to a working environment.
The devcontainer configuration is part of the repository, along with a .vscode directory, so the same environment definition serves both the Codespace path and a local container run. That is a deliberate duplication of setup work: once the devcontainer is correct, the two paths cannot drift apart.
The chapter directories are at the top level of the repository, named 01-IntroToGenAI through 05-ResponsibleGenAI, next to the images and translated_images folders. The naming convention means a reader can see the whole curriculum from the file listing alone.
The repository also carries AGENTS.md, SUPPORT.md, SECURITY.md and a CODE_OF_CONDUCT.md, which is the standard set for a Microsoft course repository that is meant to be forked and used rather than just read.
Fifty translations is why the clone command needs sparse checkout
The repository includes 50+ language translations, which the README says significantly increases the download size, and it offers a sparse checkout alternative for people who prefer to clone locally.
For Bash, macOS and Linux:
git clone --filter=blob:none --sparse https://github.com/microsoft/Generative-AI-for-beginners-java.git
cd Generative-AI-for-beginners-java
git sparse-checkout set --no-cone '/*' '!translations' '!translated_images'The Windows command line version does the same thing with different quoting:
git clone --filter=blob:none --sparse https://github.com/microsoft/Generative-AI-for-beginners-java.git
cd Generative-AI-for-beginners-java
git sparse-checkout set --no-cone "/*" "!translations" "!translated_images"Three flags do the work here. The blob filter means git fetches file contents lazily, the sparse flag starts with a cone-free pattern set, and the set command then keeps everything except the translations and translated_images directories. The result is a much faster download with everything needed to complete the course.
The translations themselves are maintained with Co-op Translator, Microsoft's automated translation pipeline, and the language list is long: Arabic, Bengali, Bulgarian, Burmese, Simplified and Traditional Chinese in several regional variants, Croatian, Czech, Danish, Dutch, Estonian, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Kannada, Khmer, Korean, Lithuanian, Malay, Malayalam, Marathi, Nepali, Nigerian Pidgin, Norwegian, Persian, Polish, Portuguese in both Brazil and Portugal variants, Punjabi, Romanian, Russian, Serbian in Cyrillic, Slovak, Slovenian, Spanish, Swahili and more.
That list explains the download problem. A course repository whose README is duplicated into fifty languages carries fifty copies of the same prose and fifty sets of translated images, and the sparse checkout is the mitigation for anyone who does not need them.
Keyless authentication is the choice that makes the samples work
The detail that most affects whether you can run the course is the authentication model, and the README is clear about it. Chapter 2 covers keyless authentication, connecting securely with Microsoft Entra ID with no API keys to manage. Chapter 3 makes the same point for the SDK work, calling Azure OpenAI v1 directly with keyless authentication.
This is worth pausing on because it is a different pattern from most generative AI tutorials, where the reader copies an API key from a dashboard into a configuration file and pastes it into a sample. Keyless access means the sample uses the identity of whoever is running it, which for the Codespaces path is the identity you signed in to GitHub with, and for a local path is whatever `az login` has established.
The consequence is that the samples need an Azure AI Foundry resource with an access grant for that identity. The provisioning chapter is where that happens, using Bicep and the Azure Developer CLI, which is infrastructure-as-code rather than console clicking.
The Foundry Local Demo is the exception to the cloud dependency, and it is the sample to look at if your environment policy forbids sending data to a hosted endpoint. It is described as local AI model integration with the OpenAI Java SDK, which means the same Java code path is exercised against a model running on your own machine.
The model choices are named in the same chapter: GPT-5.6 Luna for chat and text-embedding-3-small for embeddings. Both are Azure catalog items rather than bare OpenAI models, which is consistent with the keyless Entra ID story and with the Azure OpenAI v1 API surface the SDK calls.
Where this course is the wrong starting point
Three limits, and the first is about the audience it assumes.
The first is that it teaches a specific stack. Spring AI 2.0.1 with Spring Boot 4.1.1, the OpenAI Java SDK against Azure OpenAI v1, Azure AI Foundry for provisioning, Bicep for infrastructure, and the Azure Developer CLI for deployment. Every sample depends on that combination. A team whose Java services already use LangChain4j, or whose platform runs on a different cloud, gets the concepts and the prompt engineering lessons and has to rewrite the code, because the samples are not abstractions over an interface you could swap.
The second is the cloud dependency in most of the path. The README's claim is that the workshop can be completed online without local setup, and that is true in the sense that no local install is needed. It is not true in the sense that no cloud resources are needed: chapter 2 provisions Azure AI Foundry, chapters 3 and 4 call it, and chapter 5 tests Azure AI Foundry Content Safety specifically, including its hard block and soft refusal behaviour. A team that cannot use Azure learns the Azure-specific safety tooling rather than the general shape of safety tooling, and the responsible AI chapter is the one most likely to be unusable in a regulated non-Microsoft environment.
The third is that it is a course, not a library or a framework. There is nothing to depend on, no version to pin, and no GitHub releases. The value is entirely in the reading and the samples, and the samples will bit-rot against a moving SDK: the README names Spring Boot 4.1.1 and Spring AI 2.0.1 as the teaching versions, and those numbers will age faster than a pinned dependency in a real project.
The alternative approach is to work from the Microsoft Foundry documentation and the Spring AI reference directly, skipping the course narrative. The difference in approach is that this course gives you a sequenced path with the environment already solved for you in a Codespace, which is a real saving on the first afternoon, while the direct documentation gives you documentation that matches the current SDK version, which is a real saving on the second week. If your team already knows Spring AI, the course is largely the Azure provisioning chapter, and that chapter is available on its own as 02-SetupDevEnvironment.
Editorial conclusion
Adopt this course if your team writes Java and has no in-house curriculum for prompt engineering, embeddings, RAG and function calling, because the five chapters build from tokenisation concepts to a working MCP calculator service and the samples are concrete rather than conceptual. Do not adopt it if your environment is cloud-free, because every chapter depends on Azure AI Foundry or a local Foundry install and the content safety chapter tests Azure's own filters. Verify first that you can provision Azure AI Foundry and authenticate with Microsoft Entra ID, since the course is built around keyless access with no API keys to manage, that the model and embedding names in the setup chapter, GPT-5.6 Luna and text-embedding-3-small, are available to your subscription, and that the tooling versions in the setup chapter, Spring Boot 4.1.1 and Spring AI 2.0.1, match what you intend to run in production.
Frequently asked questions
How do I start the Generative AI for Beginners Java course?
Fork the repository, click Code then the Codespaces tab then ... then New with options, keep the defaults so the course devcontainer is selected, and click Create codespace. Wait about two minutes for the environment to be ready, then jump to Chapter 2 on provisioning Azure AI Foundry.
Does the Java Generative AI course need API keys?
No. The setup chapter covers keyless authentication with Microsoft Entra ID and no API keys to manage, and chapter 3 shows calling Azure OpenAI v1 directly with keyless authentication through the official OpenAI Java SDK.
Which frameworks and model versions does the course use?
Chapter 2 names Spring Boot 4.1.1 with Spring AI 2.0.1 and the ChatClient, backed by the official OpenAI Java SDK and Azure OpenAI v1, with GPT-5.6 Luna for chat and text-embedding-3-small for embeddings. Provisioning is done with Bicep and the Azure Developer CLI.
What practical projects does the Java course include?
Three in chapter 4: a Pet Story Generator in the petstory/ folder for creative content generation with Azure AI Foundry, a Foundry Local Demo in foundrylocal/ for local AI model integration, and an MCP Calculator Service in the calculator/ folder built with Spring AI.
How do I clone the repository without downloading all the translations?
Use a sparse checkout. Run git clone --filter=blob:none --sparse, change into the directory, then git sparse-checkout set --no-cone '/*' '!translations' '!translated_images'. The README notes the repository includes 50+ language translations which significantly increases the download size.
What does the responsible AI chapter cover?
Chapter 5 covers Azure AI Foundry Content Safety, testing the built-in content filtering and safety mechanisms including hard blocks and soft refusals, a hands-on responsible AI demo showing how modern AI safety systems work, and best practice guidelines for ethical AI development and deployment.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/microsoft-generative-ai-for-beginners-java)Was this useful?