Thep Excel

AzureStorage.DataLake – เข้าถึง Azure Data Lake

AzureStorage.DataLake ดึงข้อมูลจากเสถียร Azure Data Lake Storage (ADLS) โดยส่งคืนตารางนำทางของไฟล์ในระบบไฟล์

= AzureStorage.DataLake(endpoint as text, optional options as nullable record) as table

By ThepExcel AI Agent
12 December 2025

Function Metrics


Popularity
5/10

Difficulty
5/10

Usefulness
5/10

Syntax & Arguments

= AzureStorage.DataLake(endpoint as text, optional options as nullable record) as table

Argument Type Required Default Description
endpoint text Yes URL ของบัญชี Azure Data Lake Storage filesystem ในรูปแบบ https://youraccount.dfs.core.windows.net/container
options record Optional null Record ที่ควบคุมพฤติกรรมการอ่าน/คำขอ (BlockSize, RequestSize, ConcurrentRequests, HierarchicalNavigation)

Examples

เชื่อมต่อพื้นฐานกับ Azure Data Lake
AzureStorage.DataLake("https://myaccount.dfs.core.windows.net/mycontainer")
ส่งคืนตาราง navigational ของไฟล์ในระบบไฟล์โดยใช้ตั้งค่า default
Power Query Formula:

= AzureStorage.DataLake("https://myaccount.dfs.core.windows.net/mycontainer")

Result:

ตารางนำทางแสดงไฟล์ทั้งหมดในคอนเทนเนอร์ (flat list)

ใช้ options เพื่อปรับแต่งขนาดบล็อก
AzureStorage.DataLake( "https://myaccount.dfs.core.windows.net/mycontainer", [BlockSize = 8388608] )
เพิ่ม BlockSize เป็น 8 MB (8388608 bytes) สำหรับไฟล์ขนาดใหญ่
Power Query Formula:

= AzureStorage.DataLake(
    "https://myaccount.dfs.core.windows.net/mycontainer",
    [BlockSize = 8388608]
)

Result:

ตารางนำทางสำหรับไฟล์ขนาดใหญ่ด้วยบล็อก 8 MB

ใช้ HierarchicalNavigation เพื่อมูลโครงสร้างโฟลเดอร์
AzureStorage.DataLake( "https://myaccount.dfs.core.windows.net/mycontainer", [HierarchicalNavigation = true] )
ตั้ง HierarchicalNavigation = true เพื่อแสดงไฟล์แบบต้นไม้แทนรายการแบน
Power Query Formula:

= AzureStorage.DataLake(
    "https://myaccount.dfs.core.windows.net/mycontainer",
    [HierarchicalNavigation = true]
)

Result:

ตารางนำทางแสดงไฟล์เป็นต้นไม้โครงสร้าง (tree view)

ตั้งค่า ConcurrentRequests สำหรับการดาวน์โหลดเร็ว
let Source = AzureStorage.DataLake( "https://myaccount.dfs.core.windows.net/mycontainer", [ConcurrentRequests = 32, RequestSize = 4194304] ) in Source
เพิ่ม ConcurrentRequests เป็น 32 สำหรับการดาวน์โหลดขนานกัน (ระวังหน่วยความจำ)
Power Query Formula:

let
    Source = AzureStorage.DataLake(
        "https://myaccount.dfs.core.windows.net/mycontainer",
        [ConcurrentRequests = 32, RequestSize = 4194304]
    )
in
    Source

Result:

ตารางสำหรับการดาวน์โหลดหลายไฟล์ขนานกัน (parallel)

FAQs

ต้องเชื่อมต่อแบบไหน?

ใช้ฟังก์ชัน AzureStorage.DataLake ในขั้นตอน ‘เข้าถึงข้อมูล’ (Get Data) ของ Power Query Editor

BlockSize กับ RequestSize ต่างกันยังไง?

BlockSize = จำนวนไบต์ที่อ่านก่อนรอผู้ใช้ (default 4MB) | RequestSize = จำนวนไบต์ต่อคำขอ HTTP (default 4MB)

ใช้ ConcurrentRequests เท่าไหร่เหมาะ?

Default 16 ใช้ได้ดี แต่ถ้าไฟล์เล็ก ๆ อย่าง concurrent ต้องเฝ้าหน่วยความจำ (Memory = ConcurrentRequests × RequestSize)

HierarchicalNavigation ควรตั้ง true หรือ false?

ตั้ง true ถ้าโครงสร้างโฟลเดอร์สำคัญและต้องการเห็นต้นไม้ / false ถ้าต้องการแค่รายการไฟล์แบน

ส่วน endpoint ที่ถูก format คือ?

https://{StorageAccountName}.dfs.core.windows.net/{FilesystemName} (เช่น https://myaccount.dfs.core.windows.net/container)

Resources & Related

Additional Notes

ฟังก์ชัน AzureStorage.DataLake ใช้สำหรับเชื่อมต่อกับระบบจัดเก็บข้อมูล Azure Data Lake Storage (ADLS) และดึงรายการไฟล์พร้อมข้อมูลเมตาดาต้าทั้งหมด ฟังก์ชันนี้จะสร้างตารางนำทาง (navigational table) ที่แสดงโครงสร้างไฟล์และโฟลเดอร์

ที่น่าสนใจคือคุณสามารถควบคุมประสิทธิภาพการอ่านข้อมูลผ่านตัวเลือกต่างๆ เช่น BlockSize สำหรับกำหนดขนาดบล็อกข้อมูล, RequestSize สำหรับกำหนดขนาดคำขอ และ ConcurrentRequests สำหรับกำหนดจำนวนคำขอพร้อมกัน

ส่วนตัวผมชอบใช้ตัวเลือก HierarchicalNavigation เป็นพิเศษ เพราะเมื่อตั้งค่าเป็น true ข้อมูลจะแสดงในรูปแบบต้นไม้ (tree structure) แทนที่จะเป็นรายการแบน ทำให้สามารถจัดการโครงสร้างโฟลเดอร์ได้ง่ายและชัดเจนยิ่งขึ้น โดยเฉพาะเมื่อทำงานกับข้อมูลที่มีหลายระดับโฟลเดอร์

Leave a Reply

Your email address will not be published. Required fields are marked *