---
title: AzureStorage.Blobs – ดึงรายชื่อ Azure Blobs จากคอนเทนเนอร์
url: https://www.thepexcel.com/functions/power-query/accessing-data-functions/azurestorage-blobs/
type: function-explainer
program: Power Query
syntax: "AzureStorage.Blobs(account 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.Blobs – ดึงรายชื่อ Azure Blobs จากคอนเทนเนอร์

> AzureStorage.Blobs ดึงรายชื่อของ blobs (ไฟล์) ที่มีอยู่ในคอนเทนเนอร์ Azure Storage และสร้างตารางนำทา

## คำอธิบาย

AzureStorage.Blobs ดึงรายชื่อของ blobs (ไฟล์) ที่มีอยู่ในคอนเทนเนอร์ Azure Storage และสร้างตารางนำทางเพื่อเข้าถึงไฟล์เหล่านั้น

## Syntax

```excel
AzureStorage.Blobs(account as text, optional options as nullable record) as table
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| account | Yes | text |  | URL ของบัญชี Azure Storage (เช่น https://mystorageaccount.blob.core.windows.net) |
| options | No | nullable record | null | ระเบียนที่เก็บตัวเลือกการตั้งค่า เช่น BlockSize, RequestSize, ConcurrentRequests |

## ตัวอย่าง

### 1. ดึงรายชื่อ Blobs พื้นฐาน

```excel
let
    AccountURL = "https://mystorageaccount.blob.core.windows.net",
    Blobs = AzureStorage.Blobs(AccountURL)
in
    Blobs
```

**ผลลัพธ์:** `ตารางนำทางแสดงคอนเทนเนอร์ทั้งหมดในบัญชี Azure Storage`

ใช้งาน AzureStorage.Blobs กับ URL ของบัญชี Azure Storage โดยใช้ค่าตั้งค่านี้เริ่มต้น

### 2. ตั้งค่า BlockSize และ ConcurrentRequests

```excel
let
    AccountURL = "https://mystorageaccount.blob.core.windows.net",
    Options = [BlockSize = 8 * 1024 * 1024, ConcurrentRequests = 32],
    Blobs = AzureStorage.Blobs(AccountURL, Options)
in
    Blobs
```

**ผลลัพธ์:** `ตารางที่ดึงมาด้วยการตั้งค่าที่ปรับแต่งแล้ว (ใช้ 8 MB blocks และ 32 requests ขนานกัน)`

เพิ่มขนาด BlockSize เป็น 8 MB และ ConcurrentRequests เป็น 32 เพื่อดาวน์โหลดเร็วขึ้น แต่ใช้หน่วยความจำมากขึ้น (256 MB)

### 3. ปรับแต่น RequestSize เพื่อควบคุมหน่วยความจำ

```excel
let
    AccountURL = "https://mystorageaccount.blob.core.windows.net",
    Options = [RequestSize = 2 * 1024 * 1024, ConcurrentRequests = 8],
    Blobs = AzureStorage.Blobs(AccountURL, Options)
in
    Blobs
```

**ผลลัพธ์:** `ตารางที่ดึงมาด้วยขนาด request ที่เล็กลง (2 MB) เพื่อประหยัดหน่วยความจำ`

ลดขนาด RequestSize เป็น 2 MB และ ConcurrentRequests เป็น 8 เพื่อควบคุมการใช้หน่วยความจำในสภาพแวดล้อมที่จำกัด

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

- เมื่อดาวน์โหลดไฟล์ขนาดใหญ่จำนวนมาก ให้เพิ่ม ConcurrentRequests เป็น 32-64 เพื่อความเร็วที่ดีขึ้น

- ระวังการใช้หน่วยความจำ สูตร: Memory = ConcurrentRequests × RequestSize

- เมื่อทำงานในสภาพแวดล้อมที่มีหน่วยความจำจำกัด ให้ลด ConcurrentRequests และ RequestSize

- ใช้ฟังก์ชันนี้ร่วมกับ Table.ExpandTableColumn() เพื่อขยายข้อมูล blob ลึกลงไป

- URL ต้องเป็นรูปแบบ https://accountname.blob.core.windows.net เท่านั้น

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

**Q: ฟังก์ชันนี้ส่งกลับข้อมูลประเภทไหน**

ส่งกลับ Table ที่เป็นตารางนำทาง โดยแต่ละแถวแสดงถึงคอนเทนเนอร์หนึ่ง และมีลิงก์ไปยัง blobs ในคอนเทนเนอร์นั้น

**Q: ฉันต้องมี access token หรือ connection string จากไหน**

คุณต้องใช้ URL ของบัญชี Azure Storage เท่านั้น Power Query จะจัดการการตรวจสอบสิทธิ์ผ่าน Azure AD หรือ connection settings

**Q: ConcurrentRequests มีค่าสูงสุดเท่าไหร่**

ไม่มีข้อจำกัดในตัวเอง แต่ต้องคำนึงถึงการใช้หน่วยความจำ (Memory = ConcurrentRequests × RequestSize) และข้อจำกัดของ Azure Storage API

**Q: สามารถใช้ฟังก์ชันนี้กับ Azure Data Lake Storage ได้ไหม**

ได้ เนื่องจากใช้ Blob Storage API ที่เป็นพื้นฐานของทั้ง Azure Blob Storage และ Azure Data Lake Storage

**Q: BlockSize และ RequestSize ต่างกันอย่างไร**

RequestSize คือขนาดของคำขอ HTTP เดี่ยว ส่วน BlockSize คือจำนวนข้อมูลที่เก็บไว้ก่อนส่งต่อให้ผู้บริโภค BlockSize ควรมากกว่าหรือเท่ากับ RequestSize

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

- [Microsoft Learn: AzureStorage.Blobs](https://learn.microsoft.com/en-us/powerquery-m/azurestorage-blobs) _(official)_
- [Azure Storage Documentation](https://learn.microsoft.com/en-us/azure/storage/) _(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-blobs/](https://www.thepexcel.com/functions/power-query/accessing-data-functions/azurestorage-blobs/)_
