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

Improve error message for Timer trigger when AzureWebJobsStorage is not set #6

Closed
ahmelsayed opened this issue Jan 4, 2017 · 11 comments
Milestone

Comments

@ahmelsayed
Copy link
Contributor

From @TonyAbell on November 27, 2016 19:51

Steps

  • func init
  • func new
    (Select timer template, and give it a name of timer)
  • func run timer

Error

A ScriptHost error has occurred
Stopping Host
Unable to retrieve functions list: No MediaTypeFormatter is available to read an object of type 'FunctionEnvelope[]' from content with media type 'text/plain'.

Language

I have tried this on the following languages, with the same results for each one.

  • C#
  • F#
  • JS

@ahmelsayed

Copied from original issue: Azure/azure-functions-host#993

@ahmelsayed ahmelsayed added the CLI label Jan 4, 2017
@ahmelsayed
Copy link
Contributor Author

From @lindydonna on December 15, 2016 1:49

@TonyAbell Did you have a value for AzureWebJobsStorage in appsettings.json? This is likely a poor error message that needs to be improved.

@ahmelsayed
Copy link
Contributor Author

From @desinole on December 15, 2016 16:5

I had the same issue with a brand new TimerTrigger project. Setting the "AzureWebJobsStorage" value to "UseDevelopmentStorage=true" in the appsettings.json file fixed it

@ahmelsayed
Copy link
Contributor Author

From @lindydonna on December 21, 2016 22:2

@ahmelsayed's proposal:

  1. Test to see if local storage emulator works ok for common scenarios
  2. Inject this value (and print a warning to the console) if AzureWebJobsStorage is null

@ahmelsayed
Copy link
Contributor Author

From @lindydonna on December 21, 2016 22:3

Error message issue will be fixed with Azure/azure-functions-host#1069

@ahmelsayed ahmelsayed removed the CLI label Jan 6, 2017
@ahmelsayed ahmelsayed changed the title CLI Timer fails on run Timer fails on run Jan 6, 2017
@lima02
Copy link

lima02 commented Jan 8, 2017

@ahmelsayed I have tried the following and still having issues. Can you pls shed some light?
appsettings.json:
{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "UseDevelopmentStorage=true", "AzureWebJobsDashboard": "" } }
I get this...
Reading host configuration file 'C:\src\SC-Contracts\host.json'
Listening on http://localhost:7071/
Hit CTRL-C to exit...
ScriptHost initialization failed

@lindydonna
Copy link
Contributor

You should use a connection string for AzureWebJobsStorage. Local development storage isn't guaranteed to work correctly.

Here's a video walkthrough that shows how to get the setting: https://regularitguy.com/2017/01/11/the-coolness-of-visual-studio-azure-functions-tools/

@ahmelsayed
Copy link
Contributor Author

Fixed.

@lindydonna lindydonna modified the milestones: 1.0.0.beta.11, 1.0.0.beta.10 Feb 4, 2017
@atrauzzi
Copy link

@lindydonna Is there any way to have this setting pulled from here?

image

The reason I'm asking is because I don't have anything environment specific in my project files. My resource templates configure all the settings I need in the Azure App Service instance.

@markmonster
Copy link

I think these settings can be retrieved via ConfigurationManager.AppSettings["SettingName"]. Did you try this?

@atrauzzi
Copy link

Well, this is the webjobs/functions framework that requires these settings. So it won't be up to me to pull them. But it appears to be working to just have them set in the application settings as a string.

@lindydonna - This might be another one of those grey areas of requirements/functionality I seem to be good at finding. Functions apps do have some prerequisites, so when I want to automate my deployments, I have to know that certain infrastructure and associated credentials have to exist and be made available to the app service instance.

@lindydonna
Copy link
Contributor

You can use func azure functionapp fetch-app-settings to pull down the settings to your local machine.

Using an ARM template to automate Function App creation is documented here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-infrastructure-as-code

@msftbot msftbot bot 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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants