AzureStorage.Blobs
An Azure storage account's containers, or one container's blobs, as navigation tables.
Group: Files and documents. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
AzureStorage.Blobs(account as text, optional options as nullable record) as table
| Parameter | Type | Description |
|---|---|---|
account | text | The account's name (norwayanalytics), its address https://norwayanalytics.blob.core.windows.net, or a container's address. |
options | nullable record optional | BlockSize, RequestSize and ConcurrentRequests are accepted and change nothing; any other option is an error. |
Returns
table. For an account, Name and Data, a row per container. For a container, a row per blob, with the eight columns of Folder.Files.
Remarks
- A blob's Name is its whole name, slashes and all; Date modified is the storage's Last-Modified time; Date accessed and Date created are null. Attributes holds Content Type, Kind and Size.
- A container's table has the same columns as
Folder.Files, so the steps that combine files work the same: filter the rows, read each Content, combine. - Names and addresses are checked first, with Power BI Desktop's messages: an account name is 3 to 24 lower case letters and digits, an address is https.
- Signed in as
AzureStorage.BlobContentsis.
Compared with Power Query
OpenBI also reads an Azure Storage emulator (Azurite) on this computer at its http://127.0.0.1 address; Power BI takes https addresses only.
Examples
One container's CSV files
let
Source = AzureStorage.Blobs("norwayanalytics"),
Exports = Source{[Name = "exports"]}[Data],
Csv = Table.SelectRows(Exports, each [Extension] = ".csv")
in
Table.Combine(List.Transform(Csv[Content], each Table.PromoteHeaders(Csv.Document(_))))
Result: not shown here: it needs an Azure storage account and a sign-in.
An account name that can't be one
AzureStorage.Blobs("Sales_Data")
Result: an error.
[Reason = "DataFormat.Error", Message = "The Account name must be 3 to 24 lower case letters and numbers.", Detail = null]
Capitals and underscores aren't allowed in a storage account's name.
Related functions
AzureStorage.BlobContents, AzureStorage.DataLake, Folder.Files, Csv.Document, Table.Combine.