I have deployed ASDK version 1.2008.0.59. The installation was successful. I am now trying to register the ASDK using one of the accounts we have in our team. I am getting following error:
WARNING: Attempting to find a refresh token and an access token from the existing token cache data...
VERBOSE: 2021-02-16.06-24-32: Removing any existing PSSession...
Get-AzToken : Unable to find type [Microsoft.Azure.Commands.Common.Authentication.Authentication.Clients.AuthenticationClientFactory].
At C:\AzureStack-Tools-az\Registration\RegisterWithAzure.psm1:404 char:26
+ ... eshToken = (Get-AzToken -Context $AzureContext -FromCache -Verbose).G ...
+ CategoryInfo : InvalidOperation: (Microsoft.Azure...onClientFactory:TypeName) [Get-AzToken], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound,Get-AzToken
We had registered ASDK using same account before but for some reason we had to re-deploy ASDK. We did that without de-registering. From what I have read online, we dont have to de-register in order re-deploy. Any idea what the error above is about?
I am using following script which is mentioned in ASDK docs:
Add the Azure cloud subscription environment name.
Supported environment names are AzureCloud, AzureChinaCloud, or AzureUSGovernment depending which Azure subscription you're using.
Connect-AzAccount -EnvironmentName "<environment name>"
Register the Azure Stack Hub resource provider in your Azure subscription
Register-AzResourceProvider -ProviderNamespace Microsoft.AzureStack
Import the registration module that was downloaded with the GitHub tools
If you have multiple subscriptions, run the following command to select the one you want to use:
Get-AzSubscription -SubscriptionID "<subscription ID>" | Select-AzSubscription
Register Azure Stack Hub
$AzureContext = Get-AzContext
$CloudAdminCred = Get-Credential -UserName AZURESTACK\CloudAdmin -Message "Enter the credentials to access the privileged endpoint."
$RegistrationName = "<unique-registration-name>"
-RegistrationName $RegistrationName `