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

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,579 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,058 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Manu Philip 18,671 Reputation points MVP
    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--

    0 comments No comments

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.