visual-studioazureazure-functionsfaas

Azure Function App = run single Azure Function locally to debug


In visual studio I have created an Azure Function App with several Function.

When I launch the Function App debugger from the tool bar all Functions are triggered.

Is there a way to trigger a single function from the App within Visual Studio 2017?


Solution

  • There is no easy way to achieve this, but it is possible.

    1. Disable functions:

    by modifying the function.json file:

    "bindings": [
    ...
    ],
    "disabled": true
    

    or by using the [Disable] attribute:

    [Disable]
    [FunctionName("Function")]
    [NoAutomaticTrigger]
    public static void Function(string input, TraceWriter log)
    { }
    
    1. func run using Azure Core Tools (only v1.x)

    Run function using command: func run <functionName>

    1. Specify functions in the host.json file

    In your host.json file specify functions that should be run:

    { 
       "functions":[ "FunctionToRun" ]
    }