title: Azure set subscription command fails via shell script, but works without shell script
body: <p>i'm just trying to execute set of AZ commands via shell scripts.</p>
  <pre><code>az account set --subscription &quot;test-subscription&quot;
  </code></pre>
  <p>If i run the command directly on powershell after <code>az login</code> , it works fine.</p>
  <p>but if i run the same command via shell scripts, throws subscription doesn't exist in AzureCloud.</p>
  <p><strong>Update:</strong></p>
  <p>The output of az account show command</p>
  <pre><code>{
    &quot;environmentName&quot;: &quot;AzureCloud&quot;,
    &quot;homeTenantId&quot;: &quot;xxx-xx-xx-x&quot;,
    &quot;id&quot;: &quot;xx-xx-xx-x-xx&quot;,
    &quot;isDefault&quot;: true,
    &quot;managedByTenants&quot;: [
      {
        &quot;tenantId&quot;: &quot;xx-xx-xxx-xx-xx&quot;
      }
    ],
    &quot;name&quot;: &quot;subscription-name&quot;,
    &quot;state&quot;: &quot;Enabled&quot;,
    &quot;tenantId&quot;: &quot;xx-xx-xx-xxx&quot;,
    &quot;user&quot;: {
      &quot;name&quot;: &quot;fn.ln@xx.com&quot;,
      &quot;type&quot;: &quot;user&quot;
    }
  }
  </code></pre>