Error:InvalidAuthenticationTokenTenant' The access token is from the wrong issuer


  • I am using Node js to authenticate into Azure AD to create a Data lake storage account, it logs in but for the account creation it gives the error: code: 'InvalidAuthenticationTokenTenant', message: 'The access token is from the wrong issuer \sts windows net \ id It must match the tenant \'sts windows net\ tenent id associated with this subs cription.

    my code snippet

    var msRestAzure = require('ms-rest-azure');
    var adlsManagement = require("azure-arm-datalake-store");

    msRestAzure.interactiveLogin(function(err, credentials) {

     var accountName = 'testadlsacct';
     var pathToEnumerate = '/myfolder';
      var acccountClient = new adlsManagement.DataLakeStoreAccountClient(credentials, 'dxxxxxxx-dxxx-4xxx-bxxx-5xxxxxxxxx');
     var filesystemClient = new adlsManagement.DataLakeStoreFileSystemClient(credentials);

      var util = require('util');
    var resourceGroupName = 'testrg';
    var accountName = 'testadlsacct';
    var location = 'eastus2';

    var accountToCreate = {
      tags: {
        testtag1: 'testvalue1',
        testtag2: 'testvalue2'
      name: accountName,
      location: location
    var client= new adlsManagement.DataLakeStoreAccountClient(credentials,    'dxxxxxxxx-xxx-xxxx--xxxxxx');
        client.account.create(resourceGroupName, accountName, accountToCreate,     function (err, result, request, response) 
    //other code here

    Wednesday, September 7, 2016 10:53 AM