Error in VSCode when connecting to Function Apps in some subscriptions but not others.

WildAl 30 Reputation points
2024-04-19T14:43:07.7933333+00:00

In VS Code, using the Azure Extension, when I click on a Function Apps there is an error generated for each function in two of my subscriptions but not two others. It makes no difference whether the functions are working or not. The error seems to come from the data VS Code receives from Azure.

The following error comes up in VS Code in the bottom right area:

"internal error: Expected value to be neither null nor undefined: defaultHostName . Source: Azure Functions" .

When I click on any function, in a subscription that has the problem, I get the following error message underneath the function:Could not resolve resource "/subscriptions/xxxxx/resourceGroups/xxx/providers/Microsoft.Web/sites/I checked the commencement date on the subscriptions that don't have an error and they both have a start date of the year 2014. Of the subscriptions that don't work, one has a start date of Mar/2016 and one Nov/2018. So it might be related to something that was installed or perhaps not installed with later subscriptions, or with how those subscriptions work with Azure.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,915 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2024-05-16T14:27:31.05+00:00

    For community awareness, the underlying issue here the extension makes a LIST call to Azure to obtain the defaultHostNameurl for app services, which includes function apps.

    Currently, it's a limitation of the defaultHostName being empty in this call when a containerized app is hosted in the same region as other app services. A proposed workaround is to have the containerized app in a separate region of other app services, but that isn't a guarantee. Having said that, a permanent solution is being worked on.

    @WildAl

    1 person found this answer helpful.

  2. James Rudley 0 Reputation points
    2024-05-01T14:16:53.9566667+00:00

    Update your azure functions extension. I opened an issue and worked with the dev to resolve this.


  3. Yash Dhanore 0 Reputation points
    2024-05-06T14:12:20.25+00:00

    i'm still facing it. Several members from our team are facing it. This is the issue we have created using the help of MS support.
    https://github.com/microsoft/vscode-azurefunctions/issues/4121

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.