Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I am attempting to acquire a token from AzureAD in a native app and while this works fine on a number of computers, I have one where the application just hangs. Here is the code:
public async Task<string> GetTokenAAD()
{
//example https://docs.microsoft.com/en-us/power-bi/developer/get-azuread-access-token
var credential = new UserPasswordCredential(this.userName, this.password);
var authenticationContext = new AuthenticationContext(Properties.Settings.Default.AADAUTH_URL);
authenticationResult = await authenticationContext.AcquireTokenAsync(resourceUrl, this.clientID, credential); //code hangs here
if (authenticationResult != null)
{
return authenticationResult.AccessToken;
}
return string.Empty;
}
Solved! Go to Solution.
Turns out the issue was unrelated to PowerBI or Azure AD. The function was being called from a non-async function and I resolved it by adding ConfigureAwait(True) to the AcquiteTokenAsync call.
Could you please explain a bit for " application just hangs" ?
If it hangs in Windows, there should be application log generated for this event, please take a check under Event Viewer and see if any specific error message logged.
Further, for Windows Application hang, please check:
Extracting Information from Crash and Hang Dumps
Regards,
Michael
Turns out the issue was unrelated to PowerBI or Azure AD. The function was being called from a non-async function and I resolved it by adding ConfigureAwait(True) to the AcquiteTokenAsync call.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |