0
votes

I am learning Azure and specificially the Java serverless functions that has been recently introduced by the MS team.

I have developed a simple API as per their documentation. It works fine. But I want to disable it. As per their documentation, when i update the "disabled" to true, I am not seeing the API being disabled. I am still able to invoke it.

The sample function.json

    {
  "scriptFile" : "..\\myfunction-1.0-SNAPSHOT.jar",
  "entryPoint" : "com.xxx.myfunction.Function.hello",
  "bindings" : [ {
    "type" : "httpTrigger",
    "name" : "req",
    "direction" : "in",
    "authLevel" : "anonymous",
    "methods" : [ "get", "post" ]
  }, {
    "type" : "http",
    "name" : "$return",
    "direction" : "out"
  } ],
  "disabled" : true
}

Here is the steps that i followed to disable my function:

changed the function.json disabled to true. Click "Save" and then click "Run". I was able to get the response as 200 OK. What am i missing.

2
I am still able to invoke it. Does it means that works correctly? - Tom Sun - MSFT
Yes Tom. It is working correctly. - mack
It seems that not working for java azure function, but it works correcly for C# Azure function. - Tom Sun - MSFT
Any updates now? - Jay Gong
I have posted the observation with MSDN forum. WIll let you know once I hear back from them. - mack

2 Answers

0
votes

Clicking on the Functions , you will be displayed with list of functions and option to disable and delete.enter image description here

0
votes

I tried to disable my java azure function via two methods below:

Portal manage :

enter image description here

Function.json setting :

enter image description here

The results of both tests are all can be accessed normally as same as your test .

enter image description here

Then I learned from this case that we can configure functions array in the host.json to specify which functions can be executed.

I ensure my host.json is an empty {}. However , the result of my test is also normal access.

Per my experience, Azure function for Java was released not long and it is experimental phase. I guess this is a bug and I suggest you submit a related feedback here.

Hope it helps you.