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

How to use custom Azure Idenity token credential with JobHostConfiguration instead of connection string #3075

Open
ShreyaMicrosft0306 opened this issue May 28, 2024 · 2 comments

Comments

@ShreyaMicrosft0306
Copy link

Please provide a succinct description of the issue.

How to use custom Azure Idenity token credential with JobHostConfiguration instead of connection string

Provide the steps required to reproduce the problem

JobHostConfiguration in Microsoft.Azure.WebJobs.Host
var host=new JobHostConfiguration(_tableStorageConnectionString)

we are currently initializing host as above using tableStorageConnectionString
but we want to leverage tokencredentials where we can authenticate using our first party app
can you please help with how we can achieve that?

want to pass the token something like this
Dependency injection with the Azure SDK for .NET - .NET | Microsoft Learn

Expected behavior

Unable to pass First party token to JobhostConfiguration

Actual behavior

Provide a description of the actual behavior observed.

Known workarounds

NA

Related information

Provide any related information

  • Package version 2.2.0
  • Links to source
@paulyuk
Copy link
Member

paulyuk commented May 28, 2024

Hello. I think this sample will get you close:
https://github.com/paulyuk/webjobs

Note how TokenCredential is set here, and I use the DefaultAzureCredential (the identity of the running process or host), but you could set it to something very specific.
https://github.com/paulyuk/webjobs/blob/master/WebJob1/Program.cs#L41

@magom001
Copy link

magom001 commented Jul 3, 2024

Sorry, but it is an awful experience. Environment variable? Magic settings names? Can we drop all of this and have a straight forward setup, where I tell this SDK which client to use or which authentication method to use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants