1
votes

I went through the following process of adding a second Azure function to my solution:

enter image description here

When attempting to run locally I get the following exception:

enter image description here

HTTP could not register URL http://localhost:7071/ because TCP port 7071 is being used by another application. Press any to continue....[10/30/2018 8:52:01 PM] Loaded custom extension 'BotFrameworkConfiguration' [10/30/2018 8:52:01 PM] Loaded custom extension 'SendGridConfiguration' [10/30/2018 8:52:01 PM] Loaded custom extension 'EventGridExtensionConfig' [10/30/2018 8:52:01 PM] registered EventGrid Endpoint = http://localhost:7071/admin/extensions/EventGridExtensionConfig [10/30/2018 8:52:02 PM] Generating 0 job function(s) [10/30/2018 8:52:02 PM] Found the following functions: [10/30/2018 8:52:02 PM] TranslatorFunctions.Function1.Run [10/30/2018 8:52:02 PM] .Apps.Alidade.TranslatorFunctions.OnTranslateHTTPTriggered.Run [10/30/2018 8:52:02 PM] TranslatorFunctions.OnTranslateParameterizedHTTPTriggered.Run [10/30/2018 8:52:02 PM] [10/30/2018 8:52:02 PM] Host initialized (1467ms) [10/30/2018 8:52:02 PM] Host started (1505ms) [10/30/2018 8:52:02 PM] Job host started [10/30/2018 8:52:02 PM] The following 3 functions are in error: [10/30/2018 8:52:02 PM] Function1: Cannot access a disposed object. [10/30/2018 8:52:02 PM] OnTranslateHTTPTriggered: Cannot access a disposed object. [10/30/2018 8:52:02 PM] OnTranslateParameterizedHTTPTriggered: Cannot access a disposed object. [10/30/2018 8:52:02 PM] [10/30/2018 8:52:02 PM]

What am I doing wrong? How do we allow for multiple azure functions to run on the same solution?

1
Can you confirm the url is not in use by other application? Also what's the prompt after you add new function? Can't see the complete info in your gif. - Jerry Liu
When the function runtime starts up - it will tell you its address in the first few lines of the console window. It may not be the one you think it is. - Sql Surfer
Check which application is using the port 7071 in your case. Probably there is a second instance of func.exe running. You can check that easily in the Windows Task Manager. Terminate the on you do not need. You can def. have multiple functions in a function app running locally. - Sebastian Achatz

1 Answers

1
votes

The way i have resolved this is I went to file local.settings.json and I added the Host section to the file:

{
  "IsEncrypted": false,
  "Values": {},
  "Host": {
    "LocalHttpPort": 7073
  }
}