Azure / azure-amqp-common-go

Azure AMQP abstractions for Golang contains common types and interfaces for use in Service Bus and Event Hubs.
MIT License
12 stars 25 forks source link

Token based authentication is causing very frequent refresh token generation activity on Azure Portal #42

Open krpranay opened 4 years ago

krpranay commented 4 years ago

Expected Behavior

Actual Behavior

I am using tokenprovider approach to created new eventhub object. tokenProvider, err := aad.NewJWTProvider(aad.JWTProviderWithEnvironmentVars()) cred, err := storageLeaser.NewAADSASCredential( azurehubevent.SubscriptionID, azurehubevent.ResourceGroupName, storageAccountName, w.StorageBlobName, storageLeaser.AADSASCredentialWithEnvironmentVars()) leaserCheckpointer, err := storage.NewStorageLeaserCheckpointer(cred, storageAccountName, w.StorageBlobName, azureEnv) // Starting New Connection processor, err := eph.New( ctx, eventhubconnstring, eventhubinstanceName, tokenProvider, leaserCheckpointer, leaserCheckpointer, eventProcessorHostOption...) err = processor.Start(ctx)

I am able to connect to event hub and fetch activity logs out of it. But seems most of the logs are related to "Returns Storage Account SAS Token". This is due to the very frequent call going from my application to refresh token.

Is there any way to reduce the number of refresh token calls?

Note : I saw dotnet version have one parameter called tokenTimeToLive to specify how long token is valid.

Environment