ADFv2 - Batch App - Reading File in ADLS - SPA - Cloud Exception RRS feed

  • Question

  • I am getting an error running a Batch App in Azure Data Factory version 2.  I am trying to read from a file in the Azure Data Lake Store using Service Principal Authentication.

    The error is:

      Message=Exception of type 'Microsoft.Rest.Azure.CloudException' was thrown.

                            dynamic adlsLinkedService = ((JArray)linkedServices).First(_ => "*****".Equals(((dynamic)_).name.ToString()));
                            tenantId =;
                            servicePrincipalId =;
                            servicePrincipalKey =;
                            var credentials = new ClientCredential(servicePrincipalId, servicePrincipalKey);
                            var token = ApplicationTokenProvider.LoginSilentAsync(tenantId, credentials).Result;
                            adlsFileSystemClient = new DataLakeStoreFileSystemManagementClient(token);
                            //TODO - need to pass the account name 
                            accountName = "*****";
                            using (var input = new StreamReader(adlsFileSystemClient.FileSystem.Open(accountName, inputFileName)))

    The error occurs on the last line - I have inspected all input properties and they are correct.

    Friday, March 30, 2018 1:29 PM