Home > Net >  VSCode Azure Functions - Error: Cannot read properties of undefined (reading 'createClient'
VSCode Azure Functions - Error: Cannot read properties of undefined (reading 'createClient'

Time:10-14

I'm unable to upload the code to azure functions for some reason. It was working few days ago when I tried.

Now I get the below error. Here is a screenshot of the error Screenshot

enter image description here

4:27:59 PM: Error: Cannot read properties of undefined (reading 'createClient')
4:28:03 PM: Error: Cannot read properties of undefined (reading 'createClient')
4:31:28 PM: Error: Cannot read properties of undefined (reading 'createClient')

Only thing I modified this time is the local.settings.json as below.

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "AzureWebJobsStorage": "##########",
    "CosmosDBConnection": "##########",
    "StorageConnectionString": "#########"
  }
}

tried the old version of the code which used to work and there were no modification but now that also reports the same error.

Any idea what the issue is? I'm guessing something wrong with vscode.

Here is my local.settings.json:

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "AzureWebJobsStorage": "#############",
    "CosmosDBConnection": "#############",
    "StorageConnectionString": "#############"
  }
}

Here is the .vscode\settings.json

{
  "azureFunctions.deploySubpath": "bin/Release/netcoreapp3.1/publish",
  "azureFunctions.projectLanguage": "C#",
  "azureFunctions.projectRuntime": "~3",
  "debug.internalConsoleOptions": "neverOpen",
  "azureFunctions.preDeployTask": "publish (functions)"
}

Update: Uploading from resource view works but uploading from workspace doesn't work. Here is a reference to the bug reported and the work around.

CodePudding user response:

Figured it out.

Deleted the .vscode folder from within the project folder and restarted the Visual studio code and it initialized the function app again. Now I can upload the function without any issues.

  • Related