fbeltrao/AzureFunctionExtensions

Authentication settings from App settings

Opened this issue · 4 comments

Would it be possible to refer to an app setting instead of the actual authentication settings in the attribute parameters (for instance the sas key of the Event Grid binding extension), like the Event Hub binding for instance?

Hi @robinhultman,

If you define them as %eventgrid_sas% the value should map to your app settings value (in that case eventgrid_sas).

Could you please give a try?

Hi @fbeltrao,
can it automatically load from settings?
Or do we need to write
[EventGridOutput(SasKey = "%eventgrid_sas%", TopicEndpoint = "%eventgrid_endpoint%"... )]
to every function?
Thanks

(Btw awesome extension ;)

Right now you need to use the %setting_name% to load from settings. With a few changes I believe it would be possible to use the string passed as the setting name.

I implemented this way so you can have both.

Glad you like the extension!

I believe to allow autoload from settings you need to use:

    [AppSetting(Default = "SasKey")]
    public string SasKey { get; set; }

instead of:

    [AutoResolve(Default = "SasKey")]
    public string SasKey { get; set; }