Azure Stack TP2: Install Error – Function ‘ConfigureAAD’ in module ‘Roles\AAD\AAD.psd1’ raised an exception: The remote server returned an error: (401) Unauthorized

 

While running InstallAzureStackPOC.ps1 to install Azure Stack TP2, I encountered the following error:

Function ‘ConfigureAAD’ in module ‘Roles\AAD\AAD.psd1’ raised an exception: The remote server returned an error: (401) Unauthorized

I did some digging online and found a helpful thread on the MDSN Azure Forum.

The issue turned out to be that the system clock was one hour behind on the Azure Stack host and all of the VMs created by the install process.  This causes the communication from the MAS-WAS01 machine to Azure Active Directory to fail. I opted to correct the time separately on each server, but this would also be the perfect candidate for automating with a single script.  Perhaps using something like this?

Once the time was corrected throughout the environment, I was able to resume where I left off using the following command:

Note: if you are using a new PowerShell session, you will have to run the following commands to import the required modules:

With the time corrected I was able to complete the installation without any additional errors.

Leave a Reply

Your email address will not be published. Required fields are marked *