Rediger

Del via


Add a new Azure Stack Hub user account in Microsoft Entra ID

Before you can test offers and plans and create resources, you'll need a user account for the Azure Stack Hub user portal. You create a user account in your Microsoft Entra tenant, by using the Azure portal or PowerShell.

Create user account using the Azure portal

You must have an Azure subscription to use the Azure portal.

  1. Sign in to the Azure portal.

  2. Using the Directory + Subscription filter icon in the upper right, switch to the Microsoft Entra directory tenant you're using for Azure Stack Hub.

  3. Using the search bar at the top, search for and select the Microsoft Entra ID service.

  4. In the left pane, select Users.

  5. On the Users page, select + New user.

    Users - Lists all existing user accounts

  6. On the New user page, select Create user then fill in the required info:

    Users - Add a new user account

    • User name (required): The identifier used for sign in. For example, mary@contoso.com. The domain part of the user name must use either the initial default domain name, <yourdomainname>.onmicrosoft.com, or a custom domain name, such as contoso.com. For more information about how to create a custom domain name, see How to add a custom domain name to Microsoft Entra ID.
    • Name (required): The first and last name of the new user. For example, Mary Parker.
    • Show Password: Select the checkbox and copy the autogenerated password provided in Initial password. You'll need this password for the initial sign-in process.
    • Groups and roles: Make sure the User directory role is selected.
    • Settings and Job info: Optionally, you can add more info about the user. You can also add user info later. For more details, see How to add or change user profile information.
  7. Select Create. You should see a "Successfully created user" notification in the upper right.

  8. Sign out and sign in to the Azure portal again, with the new account using the password you saved. Change the password when prompted.

  9. Sign in to the Azure Stack Hub user portal with the new account to see the user portal.

Create a user account using PowerShell

If you don't have an Azure subscription, you can't use the Azure portal to add a tenant user account. In this case, you can use the Azure AD module for Windows PowerShell instead.

Note

Azure AD and MSOnline PowerShell modules are deprecated as of March 30, 2024. To learn more, read the deprecation update. After this date, support for these modules are limited to migration assistance to Microsoft Graph PowerShell SDK and security fixes. The deprecated modules will continue to function through March, 30 2025.

We recommend migrating to Microsoft Graph PowerShell to interact with Microsoft Entra ID (formerly Azure AD). For common migration questions, refer to the Migration FAQ. Note: Versions 1.0.x of MSOnline may experience disruption after June 30, 2024.

  1. Install the Microsoft Azure AD module for Windows PowerShell with these steps:

    • Open an elevated Windows PowerShell command prompt (run Windows PowerShell as admin).
    • Run the Install-Module AzureAD command.
    • If you're prompted to install the NuGet provider, select Y and Enter.
    • If you're prompted to install the module from PSGallery, select Y and Enter.
  2. Run the following cmdlets to sign in and create the user account:

    • If your directory doesn't require multi-factor authentication, use this sequence to authenticate:
    # Wait for the prompt, then sign in using your Azure AD credentials
    $aadcred = get-credential
    Connect-AzureAD -credential $aadcred
    
    • If your directory requires multi-factor authentication, use this sequence to authenticate:
    # Wait for the prompt, then sign in using your Azure AD credentials and MFA code
    Connect-AzureAD -Confirm
    
    • Now that you've authenticated, complete the sequence by adding the new user:
    # Create the new user account (be sure to replace all <placeholder> values first)
    $passwordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
    $passwordProfile.Password = "<Password>"
    New-AzureADUser -DisplayName "<UserName>" -PasswordProfile $passwordProfile -UserPrincipalName "<username>@<yourdomainname>" -AccountEnabled $true -MailNickName "<MailNickName>"
    
  3. Sign in to the Azure portal with the new user account. Change the password when prompted.

  4. Sign in to the Azure Stack Hub user portal with the new account to see the user portal.

Next steps