Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AzureException: Unable to access container using anonymous credentials, and no credentials found for them in the configuration

I am trying to use Hadoop of Azure HDInsight. I am logging into the cluster by ssh and running the following

hadoop jar jar_name class_name wasb://[email protected]/inputdir wasb://[email protected]/outputdir 

But I get the following exception:

Exception in thread "main" org.apache.hadoop.fs.azure.AzureException: org.apache.hadoop.fs.azure.AzureException: Unable to access container xxx in account yyy.core.windows.net using anonymous credentials, and no credentials found for them in the configuration.

I am using azure cli and I ran "azure login" before running the above mentioned hadoop job.

Please let me know how I can fix this error.

Ubuntu 12.04 runs on these machines.

PS: posted this on Azure forums as well, but reposting it here to get broader audience.

like image 821
Raghava Avatar asked Nov 09 '15 01:11

Raghava


3 Answers

EDIT: Your storage location should be wasb://[email protected]/inputdir

It sounds like your cluster is not attached to that storage account. Recreate your cluster and make sure that the account that holds the jar is attached to the cluster. Otherwise, move your jar to a storage account that is connected!

like image 56
Andrew Moll Avatar answered Nov 17 '22 13:11

Andrew Moll


The correct format to use Azure Blob storage is

wasbs://<container>@<storage-account-name>.blob.core.windows.net/<directory>/

Always make sure to end your wasbs with /

like image 42
Amit Shahi Avatar answered Nov 17 '22 13:11

Amit Shahi


This problem has been resolved and I am putting up the answer here in case someone faces the same issue.

I made couple of silly mistakes.

1) It should be wasb://@.blob.core.windows.net. I missed 'blob' earlier. 2) There should be a trailing '/'. So it should be hdfs dfs -ls wasb://[email protected]/

like image 41
Raghava Avatar answered Nov 17 '22 15:11

Raghava