Open William1104 opened 1 month ago
@umangsriv Could you investigate this? You can use fiddler to find out what exact URL it is pinging.
May be it's related to https://github.com/Azure/azure-functions-host/issues/9434
@umangsriv Could you investigate this? You can use fiddler to find out what exact URL it is pinging.
May be it's related to Azure/azure-functions-host#9434
Sure @kshyju , I'll look into this.
Hello @kshyju, I have investigated the issue and performed debugging in both online and offline modes. During my analysis, I identified two suspected URLs:
Beyond these, I did not observe and significant issues, if anything else you would suggest I explore or if there are further steps you would recommend, please let me know.
Hey @kshyju, could you please provide an update so we can proceed?
Hi @kshyju , I wanted to provide an update on the offline mode issue I've been investigating and seek some guidance on the best approach to move forward.
Issue Summary :
The core problem arises when trying to run 'func start' in offline mode, as certain components in the application continue to make network calls to external resources, specifically to 'functionscdn.azureedge.net'.
A host error has occurred during startup operation '647a2997-d85f-4c99-9bac-49186e155f1d'. [2024-11-04T11:56:26.811Z] Microsoft.Azure.WebJobs.Script: Error building configuration in an external startup class. System.Net.Http: No such host is known. (functionscdn.azureedge.net:443). System.Net.Sockets: No such host is known.
Findings
Network Dependencies in multiple components like:
'GetExtensionBundle' method, which calls the ExtensionBundleManager
, is one of the sources of this issue, this method attempts to retrieve bundles from a CDN path, causing the application to fail in offline mode. [Line 454 and 456 : https://github.com/Azure/azure-functions-core-tools/blob/v4.x/src/Azure.Functions.Cli/Actions/HostActions/StartHostAction.cs]
host.RunAsync() in IWebHost, where it seems that network dependencies are embedded within the startup configuration of 'IWebHost', application attempts to resolve certain configurations online, leading to similar connection failures in offline mode.
Mocking or Bypass Network Dependencies:
Incorporate caching, for components like 'ExtensionBundleManager', we could consider adding a mechanism to download and store the required resources locally when online, then load these from a local path in offline mode.
Similarly, for configurations in IWebHost (such as host.RunAsync()), we could explore mocking-dependent services or configurations in offline mode, possibly using a condition to switch implementations based on network availability.
I would appreciate any guidance or suggestions on ensuring we address offline mode compatibility comprehensively. Additionally, if there are existing strategies or preferred practices for handling offline mode, insights on those would be very helpful.
Version
Description
func start
would fail to execute when there is no Internet access. Some developers may have to work in a network without Internet access (or very limited access). It potentially makes azure-functions-core-tools not work..When the machine has Internet access, we can run the tools locally.
But when we stop the Internet access, the tool would fail to build configuration in an external class. It looks like this process needs to download something from a CDN (functionscdn.azureedge.net:443).
Steps to reproduce
simply stop the Internet access and then run
func start
. We should see error following messages: