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 connection strings are missing, provide a tip on how to fetch app settings #38

Closed
lindydonna opened this issue Jan 24, 2017 · 7 comments

Comments

@lindydonna
Copy link
Contributor

lindydonna commented Jan 24, 2017

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.

@lindydonna lindydonna changed the title When missing connection strings, provide note about fetching app settings When connection strings are missing, provide a tip on how to fetch app settings Jan 24, 2017
@lindydonna
Copy link
Contributor Author

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

@BartJanvanAssen
Copy link

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?

@lindydonna
Copy link
Contributor Author

@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.

@BartJanvanAssen
Copy link

Ah I see, many thanx!

@lindydonna
Copy link
Contributor Author

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.

@lindydonna lindydonna modified the milestones: 1.0.0.beta.95, 1.0.0.beta.96 Apr 14, 2017
@lindydonna lindydonna modified the milestones: 1.0.0.beta.96, 1.0.0.beta.95 Apr 14, 2017
@ahmelsayed ahmelsayed modified the milestones: 1.0.0.beta.96, 1.0.0.beta.97 May 3, 2017
@lindydonna lindydonna modified the milestones: 1.0.0.beta.98, 1.0.0.beta.100 May 16, 2017
@reddy6ue
Copy link

reddy6ue commented Jan 31, 2018

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

@fschaal
Copy link

fschaal commented Feb 2, 2018

@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

@ghost ghost locked as resolved and limited conversation to collaborators Dec 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants