Trying to install an Azure Stack Hub (development kit), the installation fails when we try to connect to Azure AD.

MrTenant 26 Reputation points
2021-02-05T13:16:50.333+00:00

Issue is this:

Trying to install an Azure Stack Hub (development kit), the installation fails when we try to connect to Azure AD.
We are using the latest setup, Build version 1.2008.0.59.

The command that fails in Powershell is Get-AzureAdTenantDetails, it claims the account is not an administrator in Azure AD:

Get-AzureAdTenantDetails : The account you entered 'abc.def@X .onmicrosoft.com' is not an
administrator of any Azure Active Directory tenant.”

Here is the thing though, if we run that command in another powershell window (with same account), and load modules manually, the commands works fine (i.e. the account is OK)

Also, if we run the Azure validation tools (https://learn.microsoft.com/sv-se/azure-stack/operator/azure-stack-validate-identity?view=azs-2008&tabs=az),
they work in the powershell we opened manually, however if we try to run that tool in the powershell window that the ASDK installation initiated it fails like this:

Error message:
[Test-AzsServiceAdministrator] Test Test-AzsService[redacted] fail with exception System.Management.Automation.MethodException: Cannot convert argument "redirectUri", with value: "Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential", for "AcquireToken" to type "System.Uri": "Cannot convert the "Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential" value of type "Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential" to type "System.Uri"." ---> System.Management.Automation.PSInvalidCastException: Cannot convert the "Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential" value of type "Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential" to type "System.Uri".


Something is fishy with the Azure Stack hub setup, what can we do?

Please advise...

Azure Stack Hub
Azure Stack Hub
An extension of Azure for running apps in an on-premises environment and delivering Azure services in a datacenter.
193 questions
Microsoft Security Microsoft Entra Microsoft Entra ID
{count} votes

Accepted answer
  1. Mark Bowler 101 Reputation points
    2021-02-11T10:56:45.193+00:00

    I hit the same problem. Took ages debugging the install scripts to get to the bottom of it.

    There's an issue with one of the installation scripts which expects the user to have a role of 'Company Administrator' instead of 'Global Administrator'.

    Try editing line 339 in C:\CloudDeployment\Setup\Common\AzureADConfiguration.psm1 and change the description to 'Global Administrator', and then re-run.

    You might have to remove the module in PowerShell (Remove-Module) as well before re-running so that it gets imported again.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.