Dotnet Core: How to get configuration from an external library
up vote
0
down vote
favorite
I am writing an Azure WebJob library. Each function of a WebJob is standalone, and does not get passed any context with the calls to it.
I use Azure Storage for Tables and Queues with my library and so I need access to configuration to get the connection info. I know that the configuration is attached to the JobHost in the main app, but how do I get to that configuration from an outside library?
Thanks!
azure .net-core azure-webjobs
add a comment |
up vote
0
down vote
favorite
I am writing an Azure WebJob library. Each function of a WebJob is standalone, and does not get passed any context with the calls to it.
I use Azure Storage for Tables and Queues with my library and so I need access to configuration to get the connection info. I know that the configuration is attached to the JobHost in the main app, but how do I get to that configuration from an outside library?
Thanks!
azure .net-core azure-webjobs
Do you want to add connectionstring to your Queues and Table library? In azure webjob you do not need to do it. You could addappsetting.json
or bind toIConfigurationRoot
object. You could refer to this article. If I understand wrong, please correct me:)
– Joey Cai
Nov 9 at 7:58
I also need to be able to read any app setting. For example, I need to be able to specify a setting in config for the location of a folder that my library needs to write output to. Without direct access to the IConfiguration instance, I don't know how to get to that information.
– The Sharp Ninja
Nov 10 at 8:30
What the mean about ` I need to be able to specify a setting in config for the location of a folder that my library needs to write output to.` Could you tell me more about your idea. I could not get your point.
– Joey Cai
Nov 13 at 2:28
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am writing an Azure WebJob library. Each function of a WebJob is standalone, and does not get passed any context with the calls to it.
I use Azure Storage for Tables and Queues with my library and so I need access to configuration to get the connection info. I know that the configuration is attached to the JobHost in the main app, but how do I get to that configuration from an outside library?
Thanks!
azure .net-core azure-webjobs
I am writing an Azure WebJob library. Each function of a WebJob is standalone, and does not get passed any context with the calls to it.
I use Azure Storage for Tables and Queues with my library and so I need access to configuration to get the connection info. I know that the configuration is attached to the JobHost in the main app, but how do I get to that configuration from an outside library?
Thanks!
azure .net-core azure-webjobs
azure .net-core azure-webjobs
asked Nov 9 at 5:12
The Sharp Ninja
761411
761411
Do you want to add connectionstring to your Queues and Table library? In azure webjob you do not need to do it. You could addappsetting.json
or bind toIConfigurationRoot
object. You could refer to this article. If I understand wrong, please correct me:)
– Joey Cai
Nov 9 at 7:58
I also need to be able to read any app setting. For example, I need to be able to specify a setting in config for the location of a folder that my library needs to write output to. Without direct access to the IConfiguration instance, I don't know how to get to that information.
– The Sharp Ninja
Nov 10 at 8:30
What the mean about ` I need to be able to specify a setting in config for the location of a folder that my library needs to write output to.` Could you tell me more about your idea. I could not get your point.
– Joey Cai
Nov 13 at 2:28
add a comment |
Do you want to add connectionstring to your Queues and Table library? In azure webjob you do not need to do it. You could addappsetting.json
or bind toIConfigurationRoot
object. You could refer to this article. If I understand wrong, please correct me:)
– Joey Cai
Nov 9 at 7:58
I also need to be able to read any app setting. For example, I need to be able to specify a setting in config for the location of a folder that my library needs to write output to. Without direct access to the IConfiguration instance, I don't know how to get to that information.
– The Sharp Ninja
Nov 10 at 8:30
What the mean about ` I need to be able to specify a setting in config for the location of a folder that my library needs to write output to.` Could you tell me more about your idea. I could not get your point.
– Joey Cai
Nov 13 at 2:28
Do you want to add connectionstring to your Queues and Table library? In azure webjob you do not need to do it. You could add
appsetting.json
or bind to IConfigurationRoot
object. You could refer to this article. If I understand wrong, please correct me:)– Joey Cai
Nov 9 at 7:58
Do you want to add connectionstring to your Queues and Table library? In azure webjob you do not need to do it. You could add
appsetting.json
or bind to IConfigurationRoot
object. You could refer to this article. If I understand wrong, please correct me:)– Joey Cai
Nov 9 at 7:58
I also need to be able to read any app setting. For example, I need to be able to specify a setting in config for the location of a folder that my library needs to write output to. Without direct access to the IConfiguration instance, I don't know how to get to that information.
– The Sharp Ninja
Nov 10 at 8:30
I also need to be able to read any app setting. For example, I need to be able to specify a setting in config for the location of a folder that my library needs to write output to. Without direct access to the IConfiguration instance, I don't know how to get to that information.
– The Sharp Ninja
Nov 10 at 8:30
What the mean about ` I need to be able to specify a setting in config for the location of a folder that my library needs to write output to.` Could you tell me more about your idea. I could not get your point.
– Joey Cai
Nov 13 at 2:28
What the mean about ` I need to be able to specify a setting in config for the location of a folder that my library needs to write output to.` Could you tell me more about your idea. I could not get your point.
– Joey Cai
Nov 13 at 2:28
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53220207%2fdotnet-core-how-to-get-configuration-from-an-external-library%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you want to add connectionstring to your Queues and Table library? In azure webjob you do not need to do it. You could add
appsetting.json
or bind toIConfigurationRoot
object. You could refer to this article. If I understand wrong, please correct me:)– Joey Cai
Nov 9 at 7:58
I also need to be able to read any app setting. For example, I need to be able to specify a setting in config for the location of a folder that my library needs to write output to. Without direct access to the IConfiguration instance, I don't know how to get to that information.
– The Sharp Ninja
Nov 10 at 8:30
What the mean about ` I need to be able to specify a setting in config for the location of a folder that my library needs to write output to.` Could you tell me more about your idea. I could not get your point.
– Joey Cai
Nov 13 at 2:28