0

Im trying to disable an Azure serverless function by using the java client for Azure. the request seems to return without any errors, but the change is not actually applied. also, a link for decent documentation for the serverless java client (AzureResourceManager) with examples will be nice.

FunctionApp functionApp = azureResourceManager.functionApps().getById(functionId);
FunctionEnvelope f11 = functionApp.listFunctions().stream().findFirst().get();
f11.innerModel().withIsDisabled(true);
functionApp.update().apply();
Ben Sagi
  • 9
  • 1

1 Answers1

0

found the following solution. the function enable/disable property is actually an app setting field of the function app. we need to add this configuration to the function app:

    functionApp.update().withAppSetting("AzureWebJobs.<function_name>.Disabled", "1").apply();
Ben Sagi
  • 9
  • 1