You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Java SDK禁用Azure无服务器函数?变更未生效求助

Fix for Disabling Azure Function via Java SDK

Issue with Your Code

Your current code modifies the FunctionEnvelope's inner model but fails to persist the change. The functionApp.update().apply() call only applies updates to the Function App resource itself, not to individual functions contained within it.

Corrected Code

To disable a specific function, you need to use the individual function's update API directly:

FunctionApp functionApp = azureResourceManager.functionApps().getById(functionId);
FunctionEnvelope function = functionApp.listFunctions().stream().findFirst().get();
// Apply disable setting to the specific function
function.update()
    .withIsDisabled(true)
    .apply();

Documentation Note

The Azure Resource Manager Java SDK official documentation includes practical examples for managing individual functions within a Function App. Focus on sections covering FunctionEnvelope update operations, which demonstrate modifying function-specific configurations like enable/disable states.

内容的提问来源于stack exchange,提问作者Ben Sagi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 20:01:21