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

Specify connection strings in config only #589

Closed
abatishchev opened this issue Oct 27, 2015 · 10 comments

Comments

@abatishchev
Copy link

commented Oct 27, 2015

Is it possible to do not specify the dashboard connection strings in web app portal settings?

I tried to have them only in web project's Web.config and console project's App.config but still getting an error. But for better deployment and full automation story I'd like to do not specify them in the portal at all.

@mathewc

This comment has been minimized.

Copy link
Contributor

commented Oct 27, 2015

Yes, you should be able to specify the AzureWebJobsStorage/AzureWebJobsDashboard connection strings in app.config. You're saying this isn't working for you? If the connection strings are in your app.config with the correct names, and the app.config is being deployed with your WebJob binaries, it should work.

@abatishchev

This comment has been minimized.

Copy link
Author

commented Oct 27, 2015

I read them from a configuration provider injected into ctor and assign to host config. Seems it isn't enough?

@abatishchev

This comment has been minimized.

Copy link
Author

commented Oct 27, 2015

I created an empty Api App project. Added an empty console project. Linked one to another. Deployed to Azure.

Still getting the same errors:

Continuous WebJob Details AbWebJobsTestConsole

Make sure that you are setting a connection string named AzureWebJobsDashboard in your Microsoft Azure Website configuration by using the following format DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY pointing to the Microsoft Azure Storage account where the Microsoft Azure WebJobs Runtime logs are stored.

Please visit the article about configuring connection strings for more information on how you can configure connection strings in your Microsoft Azure Website.

The configuration is not properly set for the Microsoft Azure WebJobs Dashboard.
In your Microsoft Azure Website configuration you must set a connection string named AzureWebJobsDashboard by using the following format DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY pointing to the Microsoft Azure Storage account where the Microsoft Azure WebJobs Runtime logs are stored.

Please visit the article about configuring connection strings for more information on how you can configure connection strings in your Microsoft Azure Website.

The source code is here: https://github.com/abatishchev/AbWebJobsTest. Please suggest.

@mathewc

This comment has been minimized.

Copy link
Contributor

commented Oct 27, 2015

So, here's what is happening: the WebJob IS able to read the connection strings at runtime from app.config. However, the Dashboard (which runs as a separate site extension / web app) does NOT have access to that app.config. You have to make the connection string you want to use for the dashboard available to it via app settings.

So: you can set the Dashboard connection string once for the WebApp in the portal app settings, but you don't need to provide the AzureWebJobsStorage connection string - it can stay in app.config if you wish.

Note: these connection strings don't have to be the same. You can have multiple WebJobs using different storage connection strings, all mapped to the same dashboard. Since there can be multiple web jobs in a single WebApp, the Dashboard can't get it from app.config (which one would it use)?

@mathewc mathewc closed this Oct 27, 2015

@hgjura

This comment has been minimized.

Copy link

commented Aug 6, 2016

This does not seem to work. The only place where you can set the AzureWebJobsDashboard, and have it work correctly it is in the portal. I tried in the Web.Config of the main/host web app and/or in the App.Config of the webjob project itself (as per the on-liner decumentation provided in the app.config), and it does not work. Which is kind of not nice, since I need to deploy and redeploy the webjobs via VSTS and connot ask people to go and mess around with the Azure portal only to set this config entry only.

@abatishchev

This comment has been minimized.

Copy link
Author

commented Aug 9, 2016

I'd agree that this isn't nice, intuitive or useful.
I understand that this makes possible to have multiple webjobs to be monitored by a single dashboard.
Notwithstanding, I believe that more popular demand would be the ability to set all connection strings programmatically and indeed avoid deploying using ARM.

@haydenhancock

This comment has been minimized.

Copy link

commented Aug 12, 2016

Same issue here. I've defined the connection strings in my App.config, however, I received the error mentioned above. Once I went into the deployed WebJob in Azure and defined the same connection strings it started working as expected.

@YoungjaeKim

This comment has been minimized.

Copy link

commented Dec 7, 2016

I can reproduce that manual input at Portal Application Settings is required. app.config file does not help for AzureWebJobsDashboard in order to remove dashboard error display. It would be better to recognize app.config value in Dashboard.

Or, why don't you guide "Input AzureWebJobsDashboard value at the Portal Application Settings" in Dashboard error message?

@dennis-yemelyanov

This comment has been minimized.

Copy link

commented Mar 24, 2017

Agreed, there should be a way for the dashboard to read this connection string from some simple config file, such us settings.job instead of forcing users to mess with site settings.

@abatishchev

This comment has been minimized.

Copy link
Author

commented Mar 25, 2017

Can this be addresses in upcoming major version?

alrod pushed a commit to alrod/azure-webjobs-sdk that referenced this issue Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.