title: ERROR: The requested resource requires user authentication: in AzureCLI task build pipeline
body: <p>I am unable to trigger azure pipeline build from azureCLI task</p>
  <p>Task :</p>
  <pre><code>- task: AzureCLI@2
    inputs:
      azureSubscription: 'Free Trial(My subscription)'
      scriptType: 'pscore'
      scriptLocation: 'inlineScript'
      inlineScript: |
        az --version
        echo &quot;Running : az account show&quot;
        az account show
        #export AZURE_DEVOPS_EXT_PAT='mypat'
        $env:AZURE_DEVOPS_EXT_PAT='mypat'
        az pipelines create --name newPipeline --org https://dev.azure.com/AbiNilOrg/ --project azure-devops-kubernetes-terraform --branch master
  </code></pre>
  <p>The output with error :</p>
  <pre><code>Running : az account show
  {
    &quot;environmentName&quot;: &quot;AzureCloud&quot;,
    &quot;homeTenantId&quot;: &quot;***&quot;,
    &quot;id&quot;: &quot;73c1af29-384c-4574-bd88-92d7bb392cfc&quot;,
    &quot;isDefault&quot;: true,
    &quot;managedByTenants&quot;: [],
    &quot;name&quot;: &quot;Free Trial&quot;,
    &quot;state&quot;: &quot;Enabled&quot;,
    &quot;tenantId&quot;: &quot;***&quot;,
    &quot;user&quot;: {
      &quot;name&quot;: &quot;***&quot;,
      &quot;type&quot;: &quot;servicePrincipal&quot;
    }
  }
  WARNING: This command is in preview and under development. Reference and support 
  levels: https://aka.ms/CLI_refstatus
  ERROR: The requested resource requires user authentication: 
  https://dev.azure.com/AbiNilOrg/azure-devops-kubernetes- 
  terraform/_apis/serviceendpoint/endpoints
  ##[error]Script failed with exit code: 1
  </code></pre>
  <p>I understand that azure is unable to form the correct URI to hit the rest point</p>
  <pre><code>ERROR: The requested resource requires user authentication: 
  https://dev.azure.com/AbiNilOrg/azure-devops-kubernetes- 
  terraform/_apis/serviceendpoint/endpoints
  </code></pre>
  <p>The suffix <strong>serviceendpoint/endpoints</strong> of the URI isnt correct.</p>
  <p>ADO guys, if have any idea on this can please help!</p>
  <p>Thanks in advace!
  Nilotpal</p>