title: Set-AzContext works in Azure Cloud Shell but doesn't in Azure PowerShell
body: <p>When i execute following command </p>
  
  <pre><code>Clear-AzureProfile
  Connect-AzAccount -TenantID xxxxxxxxxxxxxxxxxxx
  Set-AzContext -SubscriptionId xxxxxxxxxxxxxxxxxxx
  </code></pre>
  
  <p>in <code>Azure PowerShell</code> i get this error. </p>
  
  <pre><code>Set-AzContext : Please provide a valid tenant or a valid subscription.
  At line:6 char:1
  + Set-AzContext -SubscriptionId xxxxxxxxxxxxxxxxxxx
  </code></pre>
  
  <p>and if i run the same command in <code>Azure Cloud Shell</code> it works </p>
  
  <pre><code>Name        Account         SubscriptionName    Environment    TenantId         
  xxxx        xxxxxxx         xxxx                 xxxx             xxxx
  </code></pre>
  
  <p>I switched from free-trial to pay-as-you-go subscription and using credentials for pay-as-you-go in both environment but it doesn't work. can anyone help </p>