infodev
infodev

Reputation: 5235

azure function don't run locally

I'm trying to run my azure function locally

I have created a local.setting.json and added environment variables inside

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "WEBSITE_NODE_DEFAULT_VERSION":"10.14.1",
    "APPINSIGHTS_INSTRUMENTATIONKEY":"b5277bdd-e284-44cbxxxxx",
    "AzureWebJobsStorage": "DefaultEndpointsProtocol=DefaultEndpointsProtocol=https;AccountName=text2spexxxxxxxxxxxxx",
    "WEBSITE_RUN_FROM_PACKAGE":"xxxxxxxxxxxx",
    "FUNCTIONS_EXTENSION_VERSION":"~2",
    "AZURE_STORAGE_CONNECTION_STRING":"xxxxxxx"
  },
  "Host": {
    "LocalHttpPort": 7071,
    "CORS": "*",
    "CORSCredentials": false
  }
}

But I get this error when I run the function using VSCode debugger

Exception: Worker was unable to load function texttospeechmain: 'Error: Credentials must be provided when creating a service client.'

Which credentials should I provide and where ?

Upvotes: 0

Views: 1265

Answers (1)

Mike Williams
Mike Williams

Reputation: 182

When debugging (in visual studio) I always set

"AzureWebJobsStorage": "UseDevelopmentStorage=true"

In my local.setting.json

Then when running locally it starts up the storage emulator automatically.

It may do the same in Vs code

Upvotes: 0

Related Questions