Share via

Login error using powershell

Varun Bhatia 0 Reputation points
2024-10-03T13:53:41.4766667+00:00

I'm trying to run a script from local powershell but it giving me below error from today:

The provided account "" does not have access to subscription name

"<>". Please try logging in with different credentials or a different subscription name. If a

subscription is not specified, please check the configs by Get-AzConfig.

PS C:\Users**\downloads> get-azconfig

Key Value Applies To Scope Help Message


DefaultSubscriptionForLogin <Management Group ID> Az CurrentUser Subscription name or GUID. Sets the def...

DisplayBreakingChangeWarning True Az Default Controls if warning messages for breaki...

DisplayRegionIdentified True Az Default When enabled, Azure PowerShell displays...

DisplaySurveyMessage True Az Default When enabled, you are prompted infreque...

EnableDataCollection True Az Default When enabled, Azure PowerShell cmdlets ...

EnableLoginByWam False Az CurrentUser [Preview] When enabled, Web Account Man...

  1. Checked, my Azure login id is working fine

2.Also, able to login into the Azure tenant with Owner rights to the id at management group and Subscription level

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra ID

1 answer

Sort by: Most helpful
  1. Manu Philip 20,651 Reputation points MVP Volunteer Moderator
    2024-10-03T15:13:32.1266667+00:00

    Hi,

    Have you tried connecting using the following command?

    Connect-AzAccount -Subscription <subscriptionId>
    

    If so, try with -TenantId parameter as below and see if it helps!

    Connect-AzAccount -TenantId <tenantId> -Subscription <subscriptionId>
    

    Hope this helps.


    --please don't forget to upvote and Accept as answer if the reply is helpful--

    Was this answer helpful?

    0 comments No comments

Your answer

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