Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using Starlink func start is very slow and function endpoint returns 'endpoints_resolution_error: Endpoints cannot be resolved' #3524

Closed
oshihirii opened this issue Nov 16, 2023 · 1 comment

Comments

@oshihirii
Copy link

oshihirii commented Nov 16, 2023

Steps to reproduce:

  • Be connected to Starlink
  • Create a local development environment for Azure Functions
  • Create your functions
  • Run func start
  • Call a local function endpoint

Expected Behaviour:

Local function endpoints start quickly.

Calling a function endpoint runs my function code.

Actual Behaviour:

Local function endpoints start slowly.

Calling a function endpoint returns this error:

endpoints_resolution_error: Endpoints cannot be resolved

Workaround:

If I connect to a VPN and run func start, it starts quickly and calling the local function endpoints returns no errors.

I posted on the msal-node repo, as I thought it might be related to that library in particular:

AzureAD/microsoft-authentication-library-for-js#6684

When I remove the code that requests a token, i get a successful response.

As soon as I add the token request back, I get the error.

But perhaps it is an issue with azure-functions-core-tools.

Environment:

package.json:

{
  "name": "",
  "version": "1.0.0",
  "description": "",
  "main": "src/functions/*.js",
  "scripts": {
    "start": "func start",
    "test": "echo \"No tests yet...\""
  },
  "dependencies": {
    "@azure/functions": "^4.0.0-alpha.1",
    "@azure/msal-node": "^2.5.1",
    "axios": "^1.6.0",
    "pino": "^8.16.1"
  },
  "devDependencies": {
    "azure-functions-core-tools": "^4.x"
  }
}

host.json:

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.*, 5.0.0)"
  }
}

Node.js:

$ node --version
v18.18.1

My function files generally have this structure:

// import libraries, eg:
import { app } from '@azure/functions';
import axios from 'axios';

// add some helper functions here

app.http('MyPOSTHttpTriggerFunction', {
    methods: ['POST'],  
    authLevel: 'function',
    handler: async (request, context) => {

   // get a token to make graph api requests   
   // call some helper functions
   // return a response 

}

I am using the Azure Functions v4 programming model, Node.js and ES6 style module syntax etc.

@khkh-ms
Copy link
Contributor

khkh-ms commented Feb 6, 2024

It is very difficult to reproduce the issue. It appears to be related to specific ISP as you mentioned that you don't see the issue after connecting to the VPN.

@khkh-ms khkh-ms closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants