对于在Azure上运行的Spark,区别只是只用wasb访问HDFS,其他的准备工作都由Azure在使用 Spark 创建 HDInsight 集群.列出文件的方法是 listFiles 或 WholeTextFiles of SparkContext
For Spark running on local, there is an official blog which introduces how to access Azure Blob Storage from Spark. The key is that you need to configure Azure Storage account as HDFS-compatible storage in core-site.xml file and add two jars hadoop-azure & azure-storage to your classpath for accessing HDFS via the protocol wasb[s]. You can refer to the official tutorial to know HDFS-compatible storage with wasb, and the blog about configuration for HDInsight more details.
For Spark running on Azure, the difference is just only access HDFS with wasb, the other preparations has been done by Azure when
creating HDInsight cluster with Spark. The method for listing files
is listFiles or wholeTextFiles of SparkContext