Azure-Functions icon indicating copy to clipboard operation
Azure-Functions copied to clipboard

Document how to disable a function in V2

Open pragnagopa opened this issue 8 years ago • 16 comments

"disabled" property in function.json is no longer valid in Functions V2. You can disable a function via portal: image This adds an app setting key: AzureWebJobs.FunctionName.Disabled value: true

pragnagopa avatar Mar 26 '18 21:03 pragnagopa

We might want to expand this to a general documentation topic on disabling, that explains the different workflows that are possible and not possible based on whether its v1/v2 and whether its a VS authored function or not.

paulbatum avatar Mar 26 '18 21:03 paulbatum

From my experience disabling compiled queue-triggered function in Azure Portal did not have any effect, we still had them running even after re-deployment.

rams78 avatar Apr 11 '18 13:04 rams78

Any joy on this? Would very much appreciate some clear guidelines, thanks

AuroraBrignola avatar Jun 05 '18 11:06 AuroraBrignola

@AuroraBrignola the information above should be enough to unblock you, assuming you're asking about V2.

paulbatum avatar Jun 05 '18 16:06 paulbatum

It would be great if functions generated by templates does not add this obsolete property.

{
  "disabled": false,
  "bindings": [
    {
      "authLevel": "function",
      "type": "httpTrigger",
      "direction": "in",
      "name": "req"
    },
    {
      "type": "http",
      "direction": "out",
      "name": "res"
    }
  ]
}

Also, the documentation should not present this property on 2.X samples: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook

ltouro avatar Aug 08 '18 18:08 ltouro

I believe this has been improved - @ggailey777 to confirm

ColbyTresness avatar Nov 16 '18 23:11 ColbyTresness

ping @ggailey777

ColbyTresness avatar Jan 18 '19 19:01 ColbyTresness

Is this the article that was needed? How to disable functions in Azure Functions

ggailey777 avatar Feb 24 '19 22:02 ggailey777

Yes @ggailey777 thanks. Will close this issue.

pragnagopa avatar Feb 25 '19 01:02 pragnagopa

Main documentation is still wrong at https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook.

This will be source of confusion for Func V2 users trying to disable a function using obsolete "disable" property.

At least, a disclaimer should be added somewhere, pointing to the new article regarding disabling functions.

ltouro avatar Feb 25 '19 17:02 ltouro

Does this mean that I can't disable functions locally? Only globally?

I'm trying to debug a new function but when I run locally all my other functions run, which I don't really want. But I don't want to disable the deployed functions.

danielcrisp avatar Mar 08 '19 12:03 danielcrisp

@ggailey777 can you take care of the docs issue?

ColbyTresness avatar Mar 08 '19 19:03 ColbyTresness

@danielcrisp you can disable functions locally. You should use local.settings.json instead App Settings (as you would do in Azure) (Env vars might work also. Not tested)

It will be something along these lines (deprecated keys might be present. This file is some months old):

{
  "IsEncrypted": false,
  "Values": {   
    "APPINSIGHTS_INSTRUMENTATIONKEY": "...",
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "AzureWebJobsStorage": "...", 
    "AzureWebJobs.myFuncNameHere.Disabled": true,
  },
  "ConnectionStrings": {
    
  }
}

ltouro avatar Mar 08 '19 20:03 ltouro

@craigshoemaker we probably have this same issue in all the binding reference articles that still show the disabled property.

ggailey777 avatar Mar 08 '19 23:03 ggailey777

@ggailey777 should we use an include file for this?

craigshoemaker avatar Mar 11 '19 14:03 craigshoemaker

https://github.com/MicrosoftDocs/azure-docs-pr/pull/126055

ggailey777 avatar Aug 13 '20 18:08 ggailey777