This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure blob storage account access key globally | |
spark.conf.set( | |
"fs.azure.account.key.%s.blob.core.windows.net" % storage_name, | |
sas_key) | |
output_container_path = "wasbs://%s@%s.blob.core.windows.net" % (output_container_name, storage_name) | |
output_blob_folder = "%s/wrangled_data_folder" % output_container_path | |
# write the dataframe as a single file to blob storage | |
(dataframe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mount_name = "/mnt/financial_survey_data" | |
write_path = "%s/wrangled_data_folder" % mount_name | |
(dataframe | |
# .coalesce(1) # uncomment this line to ensure that the data is written to just one file | |
.write | |
.option("header", "true") | |
.mode("overwrite") # overwrite any pre-existing data at the path that we're writing to | |
.csv(write_path) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
container_name = '{azure-blob-container-name}' | |
storage_name = '{azure-blob-storage-instance-name}' | |
mount_name = '/mnt/financial_survey_data' # This path can be used to access the contents of the blob container | |
sas_key = '{access-key-from-azure-portal}' | |
dbutils.fs.mount( | |
source = "wasbs://%s@%s.blob.core.windows.net" % (container_name, storage_name), | |
mount_point = mount_name, | |
extra_configs = {"fs.azure.sas.%s.%s.blob.core.windows.net" % (container_name, storage_name) : sas_key }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Web.Http.Controllers; | |
using System.Web.Http.Filters; | |
using System.Text.RegularExpressions; | |
namespace Ussd.Application.Filters | |
{ |