[integrations][azureai] Remove the deprecated Azure AI Inference integration - #988
[integrations][azureai] Remove the deprecated Azure AI Inference integration#988weiqingy wants to merge 3 commits into
Conversation
wenjin272
left a comment
There was a problem hiding this comment.
One documentation clarification:
| On the setup, `AzureAIChatModelSetup` → `OpenAICompletionsSetup`: | ||
|
|
||
| Azure AI supports various models through the Azure AI Inference API. Visit the [Azure AI Model Catalog](https://ai.azure.com/explore/models) for the complete and up-to-date list of available models. | ||
| - Set `model` explicitly to your Foundry deployment name. Leaving it out is **not** reported as a configuration error: `OpenAICompletionsSetup` substitutes its own OpenAI default (`gpt-4o-mini`), which does not exist on a Foundry resource, so the problem only surfaces later as a confusing error from the provider. |
There was a problem hiding this comment.
The statement that gpt-4o-mini "does not exist on a Foundry resource" is too absolute. With the OpenAI v1 API, model is the deployment name, and a deployment may legitimately be named gpt-4o-mini. If no such deployment exists, the request fails later at the provider; if one does exist, omitting model may silently select an unintended deployment. Could we instead say that the default may not match the intended deployment and therefore model should be set explicitly?
There was a problem hiding this comment.
You're right, that was overreaching.
Reworded to cover both outcomes:
Set
modelexplicitly to your Foundry deployment name. Leaving it out is not reported as a configuration error:OpenAICompletionsSetupsubstitutes its own OpenAI default (gpt-4o-mini), and on the OpenAI v1 route that value is read as a deployment name. If no deployment on the resource carries that name, the request fails later at the provider; if one does, it is used silently in place of the deployment you meant.
I kept both branches rather than the shorter "may not match the intended deployment", since the silent-selection case is the expensive one to debug.
b3a73a0 to
1011700
Compare
|
Rebased onto main to clear the conflict with #991. Worth flagging, since it is not obvious from the diff: the rebase also drops the five |
…gration The com.azure:azure-ai-inference SDK the module is built on is deprecated and retires on 2026-08-26, so the integration would sit on a dependency that no longer receives fixes, including security fixes. Users migrate to OpenAICompletionsConnection pointed at a Microsoft Foundry OpenAI v1 endpoint, which reaches the same models: the Azure OpenAI endpoint also serves non-OpenAI Foundry models, and the Cohere, Llama, Mistral and Phi families this module was documented for are sold by Azure on that resource. chat_models.md carries the parameter mapping, including that the endpoint value changes shape rather than only its key name. The azure YAML alias is removed rather than repointed. azure_openai already resolves to the Java Azure OpenAI classes in both languages, so no provider becomes unreachable by alias. Removing the module also drops its pin on reactor-core. azure-core was mediating mcp-core's declared 3.7.0 down to 3.4.41, so the distribution jar now bundles 3.7.0. No dependencyManagement entry is added to hold the older version, which was an artifact of dependency mediation rather than a choice. The e2e chat-model integration test dropped its AZURE provider branch, which existed only to exercise this integration. Generated-by: Claude Code 2.1.226
Removing the azureai module takes 46 dependencies out of the shaded distribution jar, so the bundled NOTICE listed artifacts that are no longer present, and four license texts under META-INF/licenses covered nothing that still ships. Each removal was checked by locating the artifact's own jar and testing whether any of its entries survive in the rebuilt shaded jar, rather than by matching on the coordinate prefix. The azure block is interleaved with entries that must stay: reactive-streams and reactor-core remain bundled through other paths, while jna and jna-platform drop out entirely. Entries carrying no distinguishing payload were kept, since over-listing is the safer error. The reactor-core line moves to 3.7.0, the version the jar bundles once azure-core stops mediating it down. Generated-by: Claude Code 2.1.226
On the OpenAI v1 route `model` is the deployment name, so `gpt-4o-mini` is a name a Foundry deployment can carry. The migration note asserted it does not exist on a Foundry resource, which describes only one of the two outcomes. State both: no matching deployment fails at the provider, a matching one is used silently in place of the intended deployment. Generated-by: Claude Code 2.1.226
1011700 to
28256dc
Compare
Linked issue: #931
Purpose of change
integrations/chat-models/azureaiis built oncom.azure:azure-ai-inference, which Microsoft has deprecated and retires on 2026-08-26. Past that date the integration sits on a dependency that no longer receives fixes, including security fixes.This removes the module outright rather than shipping a deprecated compatibility layer, per the direction settled on the issue.
The replacement is
OpenAICompletionsConnectionpointed at a Microsoft Foundry OpenAI v1 endpoint. The two are close enough to make the compatibility layer unnecessary: the Azure OpenAI endpoint also serves non-OpenAI models, and the Cohere, Llama, Mistral and Phi families this module was documented for are sold by Azure on that same resource (endpoints doc).The migration note in
chat_models.mdcarries the parameter mapping. Two points worth surfacing here because they are the ones that bite:The endpoint value changes shape, not just its key name.
https://<resource>.services.ai.azure.com/modelsbecomeshttps://<resource>.openai.azure.com/openai/v1/. Carrying the old value intoapi_base_urlunchanged will not work.modelmust be set explicitly to the Foundry deployment name. It is not enforced as required:OpenAICompletionsSetupsubstitutesgpt-4o-miniwhen it is blank, so omitting it fails provider-side against Foundry rather than at config time.The note also explains why the target is
OpenAICompletionsConnectionrather thanAzureOpenAIChatModelConnection, since only one of the two has "Azure" in its name: the/openai/v1/route uses implicit versioning and takes noapi-version, whichAzureOpenAIChatModelConnectionrequires.The
azureYAML alias is removed rather than repointed.azure_openaialready resolves to the Java Azure OpenAI classes in both languages, so no provider becomes unreachable by alias.A dependency version change rides along with this removal
Worth calling out explicitly, since it is not obvious from a removal diff.
azure-corewas mediatingmcp-core's declaredreactor-core:3.7.0down to3.4.41. Deleting the module removes that pin, so the shaded distribution jar now bundles 3.7.0, and the bundledNOTICEis updated to match.No
dependencyManagemententry was added to hold 3.4.41. That version was an artifact of dependency mediation rather than a deliberate choice, so pinning it back would re-freeze an accident and keepmcp-coreon an older reactor than it asks for. Happy to be redirected if the project would rather pin.The second commit updates
META-INF/NOTICEand drops four now-orphaned license texts. Each of the 46 removed entries was checked by locating that artifact's own jar and testing whether any of its entries survive in the rebuilt shaded jar, rather than by matching on the coordinate prefix. That distinction matters here: the azure block is interleaved with entries that must stay, soreactive-streamsandreactor-coreremain bundled through other paths whilejnaandjna-platformdrop out entirely. Entries carrying no distinguishing payload were kept, since over-listing is the safer error.The two commits are ordered removal-then-NOTICE deliberately. The reverse would briefly describe a jar that still bundles the module with a NOTICE missing 46 entries and four license texts covering still-shipping dependencies.
Tests
No new tests. This removes code and its wiring; there is no new behavior to pin.
Verified on the branch:
tools/build.shclean,tools/ut.shgreen (Java 0 failures and 0 errors across modules, Python 812 passed and 13 skipped),tools/lint.sh -cclean,tools/check-license.shclean. The rebuilt distribution jar was checked to ship the corrected NOTICE.ChatModelIntegrationAgentandChatModelIntegrationTestreferenced the removed constants, so the tree does not compile without editing them. TheirAZUREprovider branch was deleted rather than repointed at a Foundry endpoint, which would have meant inventing an unspecified credential-gated configuration. No workflow or script referencesAZURE_ENDPOINTorAZURE_API_KEY.Two gaps I have not closed, stated plainly rather than left implied. The e2e suite was not run, since it needs Ollama and credentials; the two edited e2e files are verified to
test-compileonly. And no Hugo render was performed, so the doc anchors were checked by reading headings rather than by rendering the site.API
Yes. This removes public API.
Removed:
AzureAIChatModelConnectionandAzureAIChatModelSetup;ResourceName.ChatModel.AZURE_CONNECTIONandAZURE_SETUPon the Java side and theirResourceName.ChatModel.Java.*counterparts on the Python side, which is how Python agents reached the module cross-language; theazureYAML alias for bothchat_model_connectionsandchat_model_setups; and theflink-agents-integrations-chat-models-azureaiMaven artifact.An existing
clazz: azurein YAML now fails at class load naming the missing class, rather than reporting an unknown alias, becauseAliases.resolveClazzpasses unrecognized names through unchanged. That pass-through behavior is unchanged by this PR, and the migration note covers the rename for YAML users as well as for the Java API.Documentation
doc-neededdoc-not-neededdoc-includedWas this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code 2.1.226, included in both commit messages.