Azurite

Azurite

本地模拟Azure存储服务的开源工具

Azurite是一个开源的Azure存储API兼容服务器,基于Node.js开发,提供跨平台支持。它能在本地环境中模拟Azure存储服务,支持Blob、Queue和Table存储,并与最新的Azure存储API保持同步。Azurite V3采用TypeScript开发,使用代码生成器提高了开发效率和API一致性。这个工具适合开发人员在本地进行Azure存储相关的开发和测试工作。

AzuriteAzure存储模拟器开源TypeScriptGithub开源项目

Azurite V3

npm version Build Status

Note: The latest Azurite V3 code, which supports Blob, Queue, and Table (preview) is in the main branch. The legacy Azurite V2 code is in the legacy-master branch.

VersionAzure Storage API VersionService SupportDescriptionReference Links
3.31.02024-08-04Blob, Queue and Table(preview)Azurite V3 based on TypeScript & New ArchitectureNPM - Docker - Visual Studio Code Extension
Legacy (v2)2016-05-31Blob, Queue and TableLegacy Azurite V2NPM

Introduction

Azurite is an open source Azure Storage API compatible server (emulator). Based on Node.js, Azurite provides cross platform experiences for customers wanting to try Azure Storage easily in a local environment. Azurite simulates most of the commands supported by Azure Storage with minimal dependencies.

Azurite V2 is manually created with pure JavaScript, popular and active as an open source project. However, Azure Storage APIs are growing and keeping updating, manually keeping Azurite up to date is not efficient and prone to bugs. JavaScript also lacks strong type validation which prevents easy collaboration.

Compared to V2, Azurite V3 implements a new architecture leveraging code generated by a TypeScript Server Code Generator we created. The generator uses the same swagger (modified) used by the new Azure Storage SDKs. This reduces manual effort and facilitates better code alignment with storage APIs.

3.0.0-preview is the first release version using Azurite's new architecture.

Features & Key Changes in Azurite V3

  • Blob storage features align with Azure Storage API version 2024-08-04 (Refer to support matrix section below)
    • SharedKey/Account SAS/Service SAS/Public Access Authentications/OAuth
    • Get/Set Blob Service Properties
    • Create/List/Delete Containers
    • Create/Read/List/Update/Delete Block Blobs
    • Create/Read/List/Update/Delete Page Blobs
  • Queue storage features align with Azure Storage API version 2024-08-04 (Refer to support matrix section below)
    • SharedKey/Account SAS/Service SAS/OAuth
    • Get/Set Queue Service Properties
    • Preflight Request
    • Create/List/Delete Queues
    • Put/Get/Peek/Update/Delete/Clear Messages
  • Table storage features align with Azure Storage API version 2024-08-04 (Refer to support matrix section below)
    • SharedKey/Account SAS/Service SAS/OAuth
    • Create/List/Delete Tables
    • Insert/Update/Query/Delete Table Entities
  • Features NEW on V3
    • Built with TypeScript and ECMA native promise and async features
    • New architecture based on TypeScript server generator. Leverage auto generated protocol layer, models, serializer, deserializer and handler interfaces from REST API swagger
    • Flexible structure and architecture, supports customizing handler layer implementation, persistency layer implementation, HTTP pipeline middleware injection
    • Detailed debugging log support, easy bug locating and reporting
    • Works with storage .Net SDK basic and advanced sample
    • SharedKey, AccountSAS, ServiceSAS, OAuth, Public Access authentication support
    • Keep updating with latest Azure Storage API version features (Refer to support matrix)

Getting Started

Try with any of following ways to start an Azurite V3 instance.

GitHub

After cloning source code, execute following commands to install and start Azurite V3.

npm ci npm run build npm install -g azurite

NPM

In order to run Azurite V3 you need Node.js installed on your system. Azurite works cross-platform on Windows, Linux, and OS X. Azurite is compatible with the current Node.Js LTS Versions in support.

After installation you can install Azurite simply with npm which is the Node.js package management tool included with every Node.js installation.

npm install -g azurite

Simply start it with the following command:

azurite -s -l c:\azurite -d c:\azurite\debug.log

or,

azurite --silent --location c:\azurite --debug c:\azurite\debug.log

This tells Azurite to store all data in a particular directory c:\azurite. If the -l option is omitted it will use the current working directory. You can also selectively start different storage services.

For example, to start blob service only:

azurite-blob -l path/to/azurite/workspace

Start queue service only:

azurite-queue -l path/to/azurite/workspace

Start table service only:

azurite-table -l path/to/azurite/workspace

Visual Studio Code Extension

Azurite V3 can be installed from Visual Studio Code extension market.

You can quickly start or close Azurite by clicking Azurite status bar item or following commands.

Extension supports following Visual Studio Code commands:

  • Azurite: Start Start all Azurite services
  • Azurite: Close Close all Azurite services
  • Azurite: Clean Reset all Azurite services persistency data
  • Azurite: Start Blob Service Start blob service
  • Azurite: Close Blob Service Close blob service
  • Azurite: Clean Blob Service Clean blob service
  • Azurite: Start Queue Service Start queue service
  • Azurite: Close Queue Service Close queue service
  • Azurite: Clean Queue Service Clean queue service
  • Azurite: Start Table Service Start table service
  • Azurite: Close Table Service Close table service
  • Azurite: Clean Table Service Clean table service

Following extension configurations are supported:

  • azurite.blobHost Blob service listening endpoint, by default 127.0.0.1
  • azurite.blobPort Blob service listening port, by default 10000
  • azurite.queueHost Queue service listening endpoint, by default 127.0.0.1
  • azurite.queuePort Queue service listening port, by default 10001
  • azurite.tableHost Table service listening endpoint, by default 127.0.0.1
  • azurite.tablePort Table service listening port, by default 10002
  • azurite.location Workspace location folder path (can be relative or absolute). By default, in the VS Code extension, the currently opened folder is used. If launched from the command line, the current process working directory is the default. Relative paths are resolved relative to the default folder.
  • azurite.silent Silent mode to disable access log in Visual Studio channel, by default false
  • azurite.debug Output debug log into Azurite channel, by default false
  • azurite.loose Enable loose mode which ignores unsupported headers and parameters, by default false
  • azurite.cert Path to a PEM or PFX cert file. Required by HTTPS mode.
  • azurite.key Path to a PEM key file. Required when azurite.cert points to a PEM file.
  • azurite.pwd PFX cert password. Required when azurite.cert points to a PFX file.
  • azurite.oauth OAuth oauthentication level. Candidate level values: basic.
  • azurite.skipApiVersionCheck Skip the request API version check, by default false.
  • azurite.disableProductStyleUrl Force parsing storage account name from request URI path, instead of from request URI host.
  • azurite.inMemoryPersistence Disable persisting any data to disk. If the Azurite process is terminated, all data is lost.
  • azurite.extentMemoryLimit When using in-memory persistence, limit the total size of extents (blob and queue content) to a specific number of megabytes. This does not limit blob, queue, or table metadata. Defaults to 50% of total memory.

DockerHub

Run Azurite V3 docker image

Note. Find more docker images tags in https://mcr.microsoft.com/v2/azure-storage/azurite/tags/list

docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite

-p 10000:10000 will expose blob service's default listening port. -p 10001:10001 will expose queue service's default listening port. -p 10002:10002 will expose table service's default listening port.

Or just run blob service:

docker run -p 10000:10000 mcr.microsoft.com/azure-storage/azurite azurite-blob --blobHost 0.0.0.0

Run Azurite V3 docker image with customized persisted data location

docker run -p 10000:10000 -p 10001:10001 -v c:/azurite:/data mcr.microsoft.com/azure-storage/azurite

-v c:/azurite:/data will use and map host path c:/azurite as Azurite's workspace location.

Customize all Azurite V3 supported parameters for docker image

docker run -p 7777:7777 -p 8888:8888 -p 9999:9999 -v c:/azurite:/workspace mcr.microsoft.com/azure-storage/azurite azurite -l /workspace -d /workspace/debug.log --blobPort 7777 --blobHost 0.0.0.0 --queuePort 8888 --queueHost 0.0.0.0 --tablePort 9999 --tableHost 0.0.0.0 --loose --skipApiVersionCheck --disableProductStyleUrl

Above command will try to start Azurite image with configurations:

-l //workspace defines folder /workspace as Azurite's location path inside docker instance, while /workspace is mapped to c:/azurite in host environment by -v c:/azurite:/workspace

-d //workspace/debug.log enables debug log into /workspace/debug.log inside docker instance. debug.log will also mapped to c:/azurite/debug.log in host machine because of docker volume mapping.

--blobPort 7777 makes Azurite blob service listen to port 7777, while -p 7777:7777 redirects requests from host machine's port 7777 to docker instance.

--blobHost 0.0.0.0 defines blob service listening endpoint to accept requests from host machine.

--queuePort 8888 makes Azurite queue service listen to port 8888, while -p 8888:8888 redirects requests from host machine's port 8888 to docker instance.

--queueHost 0.0.0.0 defines queue service listening endpoint to accept requests from host machine.

--tablePort 9999 makes Azurite table service listen to port 9999, while -p 9999:9999 redirects requests from host machine's port 9999 to docker instance.

--tableHost 0.0.0.0 defines table service listening endpoint to accept requests from host machine.

--loose enables loose mode which ignore unsupported headers and parameters.

--skipApiVersionCheck skip the request API version check.

--disableProductStyleUrl force parsing storage account name from request URI path, instead of from request URI host.

If you use customized azurite parameters for docker image, --blobHost 0.0.0.0, --queueHost 0.0.0.0 are required parameters.

In above sample, you need to use double first forward slash for location and debug path parameters to avoid a known issue for Git on Windows.

Will support more release channels for Azurite V3 in the future.

Docker Compose

To run Azurite in Docker Compose, you can start with the following configuration:

--- version: "3.9" services: azurite: image: mcr.microsoft.com/azure-storage/azurite container_name: "azurite" hostname: azurite restart: always ports: - "10000:10000" - "10001:10001" - "10002:10002"

NuGet

Releasing Azurite V3 to NuGet is under investigation.

Visual Studio

Integrate Azurite with Visual Studio is under investigation.

Supported Command Line Options

Listening Host Configuration

Optional. By default, Azurite V3 will listen to 127.0.0.1 as a local server. You can customize the listening address per your requirements.

Only Accept Requests in Local Machine

--blobHost 127.0.0.1 --queueHost 127.0.0.1 --tableHost 127.0.0.1

Allow Accepting Requests from Remote (potentially unsafe)

--blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0

Listening

编辑推荐精选

Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

AI办公办公工具AI工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图热门
讯飞星火

讯飞星火

深度推理能力全新升级,全面对标OpenAI o1

科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。

热门AI开发模型训练AI工具讯飞星火大模型智能问答内容创作多语种支持智慧生活
Spark-TTS

Spark-TTS

一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型

Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。

Trae

Trae

字节跳动发布的AI编程神器IDE

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
咔片PPT

咔片PPT

AI助力,做PPT更简单!

咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

热门AI辅助写作AI工具讯飞绘文内容运营AI创作个性化文章多平台分发AI助手
材料星

材料星

专业的AI公文写作平台,公文写作神器

AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。

openai-agents-python

openai-agents-python

OpenAI Agents SDK,助力开发者便捷使用 OpenAI 相关功能。

openai-agents-python 是 OpenAI 推出的一款强大 Python SDK,它为开发者提供了与 OpenAI 模型交互的高效工具,支持工具调用、结果处理、追踪等功能,涵盖多种应用场景,如研究助手、财务研究等,能显著提升开发效率,让开发者更轻松地利用 OpenAI 的技术优势。

Hunyuan3D-2

Hunyuan3D-2

高分辨率纹理 3D 资产生成

Hunyuan3D-2 是腾讯开发的用于 3D 资产生成的强大工具,支持从文本描述、单张图片或多视角图片生成 3D 模型,具备快速形状生成能力,可生成带纹理的高质量 3D 模型,适用于多个领域,为 3D 创作提供了高效解决方案。

下拉加载更多