Update alternate email in Azure AD using Graph API call

To update alternate email ID I have decided to user Graph api and update field using script.

I implemented script and it is working fine when I use visual studio.

But when I save this script in designer and compile it I get erorr as below. I know this is happening because of import for Microsoft.IdentityModel.Clients.ActiveDirectory is not working.

Could you help to resolve it.

Thank you and have a great weekend to all.

Type 'AuthenticationContext' is not defined. CCC_AzureAd 15
Type 'AuthenticationContext' is not defined. CCC_AzureAd 15
'AuthenticationContextIntegratedAuthExtensions' is not declared. It may be inaccessible due to its protection level. CCC_AzureAd 16

#If Not SCRIPTDEBUGGER Then
Imports Microsoft.IdentityModel.Clients.ActiveDirectory
Imports System.ComponentModel.Composition

#End If

Public Function CCC_AzureAd() As String

Try
Dim clientId As String = "12345"
Dim userId As String = "xxxxxx"
Dim password As String = "xxxxxxx"
Dim organizationDomain As String = "test.com"

Dim AuthCtx As AuthenticationContext = New AuthenticationContext("">https://login.windows.net/" + organizationDomain)
Dim token As String = AuthenticationContextIntegratedAuthExtensions.AcquireTokenAsync(AuthCtx, "
">https://graph.microsoft.com/", clientId, New UserPasswordCredential(userId, password)).Result