Azure / azure-functions-core-tools

Command line tools for Azure Functions
MIT License
1.31k stars 433 forks source link

Missing storageConnectionFromEnv with KEDA EventHubs scaler #2505

Open TsuyoshiUshio opened 3 years ago

TsuyoshiUshio commented 3 years ago

For the usage of KEDA, I found the storageConnectionFromEnv is missing when I create this local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "AzureWebJobsStorage": "<<MY_STORAGE>>",
    "Connection": "<<CONNECTION>>",
    "EventHubConnection": "<<CONNECTION>>",
    "APPINSIGHTS_INSTRUMENTATIONKEY":"<<MY_INSTRUMENTATION_KEY>>",
    "APPLICATIONINSIGHTS_CONNECTION_STRING":"<<CONNECTION_STRING>>"
  }
}

I found the scaled object has this metadata, that is storageConnectionFromEnv missing. https://keda.sh/docs/2.2/scalers/azure-event-hub/

  - metadata:
      cardinality: many
      connectionFromEnv: EventHubConnection
      consumerGroup: $Default
      dataType: string
      direction: in
      eventHubName: workitems
    type: azure-eventhub
gabrielSoudry commented 3 years ago

Same problem here ! I just added it manually based on --dry-run and it finally worked :tada: