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

Added try/catch around InternalGetDeviceId for NetDesktop #1891

Merged
merged 1 commit into from
Jun 24, 2020

Conversation

KoenZomers
Copy link
Contributor

Added try/catch around InternalGetDeviceId for NetDesktop as this causes a crash when used from an Azure Runbook.

This can be simulated by running the following line in an Azure Runbook which equals the line being wrapped in try/catch here:

[System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces()

It will throw the exception:
_Get-PnPAccessToken : Unable to find an entry point named 'GetPerAdapterInfo' in DLL 'iphlpapi.dll'_.

Reported to us via pnp/PnP-PowerShell#2726

We can't switch to using MSAL .Net Core or MSAL .Net Standard as within PnP PowerShell we are also using the interactive login method:

var token = await AzureAuthHelper.AuthenticateAsync(Tenant);

which requires a platform specific build of MSAL to be used, thus we need to stick with MSAL NetDesktop.

Used in PR pnp/PnP-PowerShell#2735

@bgavrilMS
Copy link
Member

Thank you for your contribution @KoenZomers - this looks good. We don't really need that device ID, it was for a feature that got dropped.

@bgavrilMS bgavrilMS merged commit e8b56af into AzureAD:master Jun 24, 2020
@bgavrilMS bgavrilMS added this to the 4.16.0 milestone Jun 24, 2020
@bgavrilMS bgavrilMS added this to In progress in MSAL.NET (legacy) via automation Jun 24, 2020
@bgavrilMS bgavrilMS moved this from In progress to Fixed in MSAL.NET (legacy) Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants