Azure Managed Identity support #177
sverheggen
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi There, we are now using the dataverseserviceclient in Azure Function App (.net core 3.1) with the latest nuget package. This app is configured with Managed Identity. The app is registered as an app user in Dynamics 365 Sales. At the moment we instantiate the service client in the following way:
var client = new ServiceClient(new Uri(uri), GetAccessToken); where uri is the base uri from the environment.
The GetAccessToken is implemented as followed:
public async Task GetAccessToken{
var cred = new DefaultAzureCredential();
var scope = new string[] { uri };
var tokenContext = new TokenRequestContext(scope.ToArray());
Token = await cred.GetTokenAsync(tokenContext);
}
when the call is made to for example client.Retrieve("account", ); three or four times a token is requested. For now we validate the expiredon on the token and return it when it is still 5 min valid otherwise a new one is retrieve.
Is there a way to implement it using the Managed Identity and not being responsible for the token expiredon validation? That this functionality is done in the service client? If not can this be added to the backlog, because I think more and more interaction from Azure with Managed Identity will be implemented.
Thanks in advanced for your help, time and effort.
Regards,
Stefan Verheggen
Beta Was this translation helpful? Give feedback.
All reactions