title: Write Data as Json from DataFrame to Azure Blob Storage
body: <p>I have some data in dataframe which i have to convert to json and store it into Azure Blob Storage.
  Is there any way to achieve this?
  Below are the steps which i have tried. I am trying it from spark-shell.</p>
  
  <pre><code>val df = spark.sql("select * from historic_data.all_historic_data").show()
  
  spark.conf.set("fs.azure.account.key.&lt;STORAGE_ACCOUNT_NAME&gt;.blob.core.windows.net","STORAGE_ACCOUNT_KEY")
  
  df.write.mode(SaveMode.Append).json("wasbs://BlobStorageContainer@&lt;STORAGE_ACCOUNT_NAME&gt;.blob.core.windows.net/&lt;FOLDER_PATH_OF BLOB&gt;/")
  </code></pre>
  
  <p>While running the write command i am getting below error </p>
  
  <pre><code>org.apache.hadoop.fs.azure.AzureException: com.microsoft.azure.storage.StorageException: The specifed resource name contains invalid characters.
    at org.apache.hadoop.fs.azure.AzureNativeFileSystemStore.retrieveMetadata(AzureNativeFileSystemStore.java:2208)
    at org.apache.hadoop.fs.azure.NativeAzureFileSystem.getFileStatusInternal(NativeAzureFileSystem.java:2673)
    at org.apache.hadoop.fs.azure.NativeAzureFileSystem.getFileStatus(NativeAzureFileSystem.java:2618)
    at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1448)
    at org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelationCommand.run(InsertIntoHadoopFsRelationCommand.scala:92
  
  </code></pre>
  
  <p>Is there anything i have missed while providing blob details?
  below is screen shot of my storage account :</p>
  
  <p><a href="https://i.stack.imgur.com/nNCVq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nNCVq.png" alt="enter image description here"></a></p>
  
  <p>I havent seen any similiar kind of question here which will WRITE from dataframe as Json into Azure Blob.</p>