@@ -70,29 +70,25 @@ public static async Task<FunctionMetadataResponse> ToFunctionMetadataResponse(th
70
70
/// <returns>JObject that represent the trigger for scale controller to consume</returns>
71
71
public static async Task < JObject > ToFunctionTrigger ( this FunctionMetadata functionMetadata , ScriptJobHostOptions config )
72
72
{
73
- // Only look at the function if it's not disabled
74
- if ( ! functionMetadata . IsDisabled )
75
- {
76
- // Get function.json path
77
- var functionPath = Path . Combine ( config . RootScriptPath , functionMetadata . Name ) ;
78
- var functionMetadataFilePath = Path . Combine ( functionPath , ScriptConstants . FunctionMetadataFileName ) ;
73
+ // Get function.json path
74
+ var functionPath = Path . Combine ( config . RootScriptPath , functionMetadata . Name ) ;
75
+ var functionMetadataFilePath = Path . Combine ( functionPath , ScriptConstants . FunctionMetadataFileName ) ;
79
76
80
- // Read function.json as a JObject
81
- var functionConfig = await GetFunctionConfig ( functionMetadataFilePath ) ;
77
+ // Read function.json as a JObject
78
+ var functionConfig = await GetFunctionConfig ( functionMetadataFilePath ) ;
82
79
83
- // Find the trigger and add functionName to it
84
- foreach ( JObject binding in ( JArray ) functionConfig [ "bindings" ] )
80
+ // Find the trigger and add functionName to it
81
+ foreach ( JObject binding in ( JArray ) functionConfig [ "bindings" ] )
82
+ {
83
+ var type = ( string ) binding [ "type" ] ;
84
+ if ( type . EndsWith ( "Trigger" , StringComparison . OrdinalIgnoreCase ) )
85
85
{
86
- var type = ( string ) binding [ "type" ] ;
87
- if ( type . EndsWith ( "Trigger" , StringComparison . OrdinalIgnoreCase ) )
88
- {
89
- binding . Add ( "functionName" , functionMetadata . Name ) ;
90
- return binding ;
91
- }
86
+ binding . Add ( "functionName" , functionMetadata . Name ) ;
87
+ return binding ;
92
88
}
93
89
}
94
90
95
- // If the function is disabled or has no trigger return null
91
+ // If the function has no trigger return null
96
92
return null ;
97
93
}
98
94
0 commit comments