> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # AzureBlob파일 시스템 Azure Blob Storage 컨테이너에 파일을 저장합니다. 인터페이스에 대한 자세한 내용은 다음을 참조하세요.[WorkspaceFilesystem Interface](https://mastra.zisheng.pro/ko/reference/workspace/filesystem). ## 설치 **npm**: ```bash npm install @mastra/azure ``` **pnpm**: ```bash pnpm add @mastra/azure ``` **Yarn**: ```bash yarn add @mastra/azure ``` **Bun**: ```bash bun add @mastra/azure ``` ## 용법 Workspace에 `AzureBlobFilesystem`을 추가하고 Agent에 할당합니다: ```typescript import { Agent } from '@mastra/core/agent' import { Workspace } from '@mastra/core/workspace' import { AzureBlobFilesystem } from '@mastra/azure/blob' const workspace = new Workspace({ filesystem: new AzureBlobFilesystem({ container: 'my-container', connectionString: process.env.AZURE_STORAGE_CONNECTION_STRING, }), }) const agent = new Agent({ id: 'file-agent', name: 'file-agent', model: 'anthropic/claude-opus-4-7', workspace, }) ``` ### 계정 키 전체 연결 문자열을 전달하지 않으려면 계정 이름과 계정 키를 사용하세요. ```typescript import { AzureBlobFilesystem } from '@mastra/azure/blob' const filesystem = new AzureBlobFilesystem({ container: 'my-container', accountName: process.env.AZURE_STORAGE_ACCOUNT_NAME, accountKey: process.env.AZURE_STORAGE_ACCOUNT_KEY, }) ``` ### 공유 액세스 서명 토큰 SAS(공유 액세스 서명) 토큰을 `accountName` 또는 `endpoint`와 함께 사용합니다: ```typescript import { AzureBlobFilesystem } from '@mastra/azure/blob' const filesystem = new AzureBlobFilesystem({ container: 'my-container', accountName: process.env.AZURE_STORAGE_ACCOUNT_NAME, sasToken: process.env.AZURE_STORAGE_SAS_TOKEN, }) ``` ### 기본Azure 자격 증명 환경에서 Azure ID 자격 증명을 제공하는 경우 `DefaultAzureCredential`을 사용합니다: ```typescript import { AzureBlobFilesystem } from '@mastra/azure/blob' const filesystem = new AzureBlobFilesystem({ container: 'my-container', accountName: process.env.AZURE_STORAGE_ACCOUNT_NAME, useDefaultCredential: true, }) ``` `DefaultAzureCredential`을 사용할 때는 `@azure/identity`를 설치합니다: **npm**: ```bash npm install @azure/identity ``` **pnpm**: ```bash pnpm add @azure/identity ``` **Yarn**: ```bash yarn add @azure/identity ``` **Bun**: ```bash bun add @azure/identity ``` ## 생성자 매개변수 **container** (`string`): Azure Blob Storage 컨테이너 이름 **connectionString** (`string`): 전체 Azure Storage 연결 문자열입니다. 다른 인증 옵션보다 우선합니다. **accountName** (`string`): Azure Storage 계정 이름입니다. connectionString 또는 endpoint를 사용하지 않는 경우 필수입니다. **accountKey** (`string`): Azure Storage 계정 키입니다. **sasToken** (`string`): 공유 액세스 서명 토큰입니다. accountName 또는 endpoint가 필요합니다. **useDefaultCredential** (`boolean`): @azure/identity의 DefaultAzureCredential을 사용합니다. (Default: `false`) **endpoint** (`string`): 사용자 지정 Blob 서비스 엔드포인트 URL입니다. Azurite를 사용하는 로컬 개발에 사용됩니다. **prefix** (`string`): 모든 키에 적용할 선택적 접두사입니다(하위 디렉터리처럼 작동). **id** (`string`): 이 파일 시스템 인스턴스의 고유 식별자입니다. (Default: `자동 생성`) **displayName** (`string`): UI에 표시할 사용자 친화적인 이름입니다. **icon** (`FilesystemIcon`): UI에 사용할 아이콘 식별자입니다. **description** (`string`): UI에 표시할 이 파일 시스템의 짧은 설명입니다. **readOnly** (`boolean`): true이면 모든 쓰기 작업이 차단됩니다. (Default: `false`) ## 속성 **id** (`string`): 파일 시스템 인스턴스 식별자입니다. **name** (`string`): Provider 이름입니다('AzureBlobFilesystem'). **provider** (`string`): Provider 식별자입니다('azure-blob'). **readOnly** (`boolean | undefined`): 파일 시스템이 읽기 전용 모드인지 여부입니다. ## 행동 양식 AzureBlobFilesystem은 다음을 구현합니다.[WorkspaceFilesystem interface](https://mastra.zisheng.pro/ko/reference/workspace/filesystem), providing all standard filesystem methods: - `readFile(path, options?)`- 파일 내용 읽기 - `writeFile(path, content, options?)`- 파일에 콘텐츠 쓰기 - `appendFile(path, content)`- 파일에 콘텐츠 추가 - `deleteFile(path, options?)`- 파일 삭제 - `copyFile(src, dest, options?)`- 파일 복사 - `moveFile(src, dest, options?)`- 파일 이동 또는 이름 바꾸기 - `mkdir(path, options?)`- 디렉토리 생성 - `rmdir(path, options?)`- 디렉토리 제거 - `readdir(path, options?)`- 디렉토리 내용 나열 - `exists(path)`- 경로가 존재하는지 확인 - `stat(path)`- 파일 또는 디렉터리 메타데이터 가져오기 ### `init()` 파일 시스템을 초기화합니다. 컨테이너 액세스 및 자격 증명을 확인합니다. ```typescript await filesystem.init() ``` ### `getInfo()` 이 파일 시스템 인스턴스에 대한 메타데이터를 반환합니다. ```typescript const info = filesystem.getInfo() // { id: '...', name: 'AzureBlobFilesystem', provider: 'azure-blob', status: 'ready' } ``` ### `getContainer()` 기본 Azure Blob Storage를 반환합니다.`ContainerClient`. ```typescript const container = await filesystem.getContainer() ``` ### `getMountConfig()` Azure Blob 파일 시스템 탑재를 지원하는 샌드박스 공급자에 대한 탑재 구성을 반환합니다. ```typescript const config = filesystem.getMountConfig() // { type: 'azure-blob', container: 'my-container', ... } ``` > **노트:** Azure Blob Sandbox 마운트는 Sandbox Provider의 `azure-blob` 마운트 구성 지원 여부에 따라 달라집니다. Sandbox Provider가 Azure Blob 마운트를 지원하지 않으면 Workspace 파일을 직접 조작할 때 `filesystem`을 사용하세요. ## 관련된 - [WorkspaceFilesystem 인터페이스](https://mastra.zisheng.pro/ko/reference/workspace/filesystem) - [S3파일 시스템 참조](https://mastra.zisheng.pro/ko/reference/workspace/s3-filesystem) - [GCS파일 시스템 참조](https://mastra.zisheng.pro/ko/reference/workspace/gcs-filesystem) - [작업공간 개요](https://mastra.zisheng.pro/ko/docs/workspace/overview)