Forum Discussion

shatvani's avatar
shatvani
Copper Contributor
Sep 29, 2023
Solved

PowerShell subscription

Hi, I am sorry to ask so newbie question but I start studying Azure just now. I bought a course and I got tuck at the first lesson. I want to open PowerShell window in Azure but it tells me this: ...
  • LeonPavesic's avatar
    Sep 29, 2023

    Hi shatvani,

    There are a few possible reasons why you might be getting this message, even though your company has Azure AD subscriptions:

    • You are not logged in to the correct Azure Active Directory tenant.
    • Your user account does not have the necessary permissions to access Azure Cloud Shell.
    • Your company has disabled Azure Cloud Shell for your subscription.

    To check which Azure Active Directory tenant you are logged in to, run the following PowerShell command:

     

    Get-AzContext

     

     

    This will return the name of the tenant that is currently associated with your PowerShell session.

    If you are not logged in to the correct tenant, you can switch tenants using the Set-AzContext cmdlet.

    To check if your user account has the necessary permissions to access Azure Cloud Shell, run the following PowerShell command:

     

    Get-AzRoleAssignment -PrincipalName <your_user_account_name>

     

     

    This will return a list of all the roles that are assigned to your user account. If you do not see the Azure Cloud Shell Contributor role in the list, then you will need to contact your Azure administrator to have it assigned to you.

    If you have checked both of the above and you are still getting the message No valid subscriptions found, then it is likely that your company has disabled Azure Cloud Shell for your subscription. In this case, you will need to contact your Azure administrator to have it enabled.

    Please click Mark as Best Response & Like if my post helped you to solve your issue.
    This will help others to find the correct solution easily. It also closes the item.


    If the post was useful in other ways, please consider giving it Like.


    Kindest regards,


    Leon Pavesic
    (LinkedIn)

Resources