Writing Job Results into Microsoft Azure Blob Storage

This article explains how to write job results directly to your Microsoft Azure Blob Storage.

Table of Contents

Prerequisites

  • Basic knowledge of Treasure Data, including the toolbelt.
  • A Microsoft Azure Platform account

Create Azure Storage Account

First, you need to create Azure Storage account. Here’s a documentation about how to creat it.

In the Azure Portal, navigate to your storage account, click All settings and then click Access keys to obtain account access keys.

Usage

Create the destination Container in Microsoft Azure Blob Storage

First, please create your container of Azure Blob Storage from your Azure portal.

Please also check the Naming and Referencing Containers, Blobs, and Metadata roles.

Write the query

Please visit the Treasure Data Console query editor page and compile your query.

Specify the Result Export target

In the same window, click the Add button in the Result Export section and select Microsoft Azure Blob Storage from the drop down menu. Please fill out all the information below, including your Account Name, Account Key, Container, and Path.



Execute the query

Finally, either save the query with a name and run or just run the query. Upon successful completion of the query, its result will be automatically imported to the specified Container destination:

Usage from CLI

You can also use CLI for Result Export to Microsoft Azure Blob Storage.

account_name/account_key case

Example,

$ td query --result '{"type":"azure_blob_storage","account_name":"xxxx","account_key":"xxxx","container":"xxxx","path_prefix":"/path/to/file.csv","sequence_format":"","header_line":true,"quote_policy":"MINIMAL","delimiter":",","null_string":"","newline":"CRLF"}' -d sample_datasets "select * from www_access" -T presto

Last modified: Mar 16 2017 08:36:40 UTC

If this article is incorrect or outdated, or omits critical information, please let us know. For all other issues, please see our support channels.