Azure-functions-core-tools: When connection strings are missing, provide a tip on how to fetch app settings

Created on 24 Jan 2017  路  7Comments  路  Source: Azure/azure-functions-core-tools

For EventHub #32, ServiceBus #37, we have bad error messages when the connection string is not set. For Timer and Storage we now have a good message, but is specific to WebJobs and mentions app.config and the XML format.

For EventHub, ServiceBus and Storage bindings: parse function.json for all functions and look for the property connection.

  • If the value is missing or blank, print the warning: Warning: Missing "TYPE" connection string "STRING" for function "FUNCTIONNAME". Run "func azure functionapp fetch-app-settings <functionAppName>" or specify a connection string in appsettings.json.
  • Replace "TYPE" with the value of the type property (e.g., serviceBusTrigger, eventHubTrigger, inputputBlob, etc).

For all bindings other than HTTP, if AzureWebJobStorage is missing or blank, print the warning Warning: Missing connection string for AzureWebJobsStorage. This setting is required for function "FUNCTIONNAME". Run "func azure functionapp fetch-app-settings <functionAppName>" or specify an Azure Storage connection string in appsettings.json.

If there are no HTTP triggers and WebJobsStorage is not set, don't launch the host, because the error message from the SDK will be very confusing.

improvement rc-must-have

Most helpful comment

@BartJanvanAssen you should enter the connection string in appsettings.json. In function.json, you just put in the connection string key, not the actual connection string.

All 7 comments

We need to chat with the WebJobs experts to find a good implementation strategy.

Nice that it's flagged as bug, how to fix this issue?
Whats the right way of entering the connection string?
Does it gets read from the function.json?

@BartJanvanAssen you should enter the connection string in appsettings.json. In function.json, you just put in the connection string key, not the actual connection string.

Ah I see, many thanx!

If there are no HTTP triggers and WebJobsStorage is not set, don't launch the host, because the error message from the SDK will be very confusing.

What is this function.json everybody keeps talking about? My visual studio doesn't generate function.json at all. Where's the schema for this mysterious object?

I only see host.json and local.settings.json

@reddy6ue its generated when the function is build. You can find the function.json at{project-location}/bin/debug/{target-framework}/{function-name}/function.json

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jerimiahwelch picture jerimiahwelch  路  4Comments

lastcoolnameleft picture lastcoolnameleft  路  4Comments

SteveALee picture SteveALee  路  4Comments

solvingj picture solvingj  路  5Comments

frozenbubble picture frozenbubble  路  4Comments