---
title: AzureStorage.DataLake – เข้าถึง Azure Data Lake
url: https://www.thepexcel.com/functions/power-query/accessing-data-functions/azurestorage-datalake/
type: function-explainer
program: Power Query
syntax: "= AzureStorage.DataLake(endpoint as text, optional options as nullable record) as table"
date: 2025-12-12
updated: 2025-12-24
scores:
  popularity: 5
  difficulty: 5
  usefulness: 5
---

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

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

## คำอธิบาย

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

## Syntax

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

## Arguments

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

## ตัวอย่าง

### 1. เชื่อมต่อพื้นฐานกับ Azure Data Lake

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

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

ส่งคืนตาราง navigational ของไฟล์ในระบบไฟล์โดยใช้ตั้งค่า default

### 2. ใช้ options เพื่อปรับแต่งขนาดบล็อก

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

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

เพิ่ม BlockSize เป็น 8 MB (8388608 bytes) สำหรับไฟล์ขนาดใหญ่

### 3. ใช้ HierarchicalNavigation เพื่อมูลโครงสร้างโฟลเดอร์

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

**ผลลัพธ์:** `ตารางนำทางแสดงไฟล์เป็นต้นไม้โครงสร้าง (tree view)`

ตั้ง HierarchicalNavigation = true เพื่อแสดงไฟล์แบบต้นไม้แทนรายการแบน

### 4. ตั้งค่า ConcurrentRequests สำหรับการดาวน์โหลดเร็ว

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

**ผลลัพธ์:** `ตารางสำหรับการดาวน์โหลดหลายไฟล์ขนานกัน (parallel)`

เพิ่ม ConcurrentRequests เป็น 32 สำหรับการดาวน์โหลดขนานกัน (ระวังหน่วยความจำ)

## หมายเหตุเพิ่มเติม

- ตั้ง HierarchicalNavigation = true ถ้าต้องแยกไฟล์ตามโครงสร้างโฟลเดอร์

- ปรับ ConcurrentRequests หลังจากวัดประสิทธิภาพจริง

- ตั้งค่า BlockSize และ RequestSize เดียวกันมักจะดีกว่า

- ใช้ Table.RenameColumns หรือ Table.SelectColumns เพื่อปรับแต่งคอลัมน์ที่ส่งคืนมา

## คำถามที่พบบ่อย

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

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

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

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

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

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

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

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

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

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

## แหล่งข้อมูลเพิ่มเติม

- [Microsoft Learn: AzureStorage.DataLake](https://learn.microsoft.com/en-us/powerquery-m/azurestorage-datalake) _(official)_
- [Azure Data Lake Storage Gen2 Documentation](https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction) _(official)_
- [Power Query M Function Reference](https://learn.microsoft.com/en-us/powerquery-m/) _(official)_

---

_Source: [https://www.thepexcel.com/functions/power-query/accessing-data-functions/azurestorage-datalake/](https://www.thepexcel.com/functions/power-query/accessing-data-functions/azurestorage-datalake/)_
