🫙 fix: Azure Blob Storage Documentation (#289)

* fix: Update fileStrategy option to use "azure_blob" in configuration docs

* fix: Update CDN documentation for Azure Blob Storage and improve navigation
This commit is contained in:
Danny Avila
2025-04-25 13:08:50 -04:00
committed by GitHub
parent 54f77a1719
commit 0974015c57
3 changed files with 74 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
export default {
index: 'Intro',
s3: 'Amazon S3 CDN',
azure: 'Azure Blob Storage CDN',
firebase: 'Firebase CDN',
s3: 'Amazon S3',
azure: 'Azure Blob Storage',
firebase: 'Firebase',
}

View File

@@ -5,6 +5,17 @@ description: This document provides instructions for setting up Azure Blob Stora
# Azure Blob Storage CDN Setup
{/* Adding a table of contents for better navigation */}
<div className="mt-8 mb-16">
<h2 className="text-lg font-semibold mb-4">On this page</h2>
<ul className="space-y-2">
<li><a href="#production-setup">Production Setup</a></li>
<li><a href="#local-development-with-azurite">Local Development with Azurite</a></li>
</ul>
</div>
## Production Setup
Azure Blob Storage offers scalable, secure object storage that can be used as a CDN for your static assets such as images, CSS, and JavaScript. Follow these steps to configure your Azure Blob Storage for LibreChat.
## 1. Create an Azure Storage Account
@@ -70,7 +81,7 @@ Update your LibreChat configuration file (`librechat.yaml`) to specify that the
```yaml filename="librechat.yaml"
version: 1.0.8
cache: true
fileStrategy: "azure"
fileStrategy: "azure_blob"
```
This setting tells LibreChat to use the Azure Blob Storage implementation provided in your code.
@@ -94,12 +105,65 @@ In your `.env` file, set either:
- `AZURE_CONTAINER_NAME`.
4. **Configure LibreChat:**
Set `fileStrategy` to `"azure"` in your `librechat.yaml` configuration file.
Set `fileStrategy` to `"azure_blob"` in your `librechat.yaml` configuration file.
With these steps, your LibreChat application will automatically create the container (if it doesnt exist) and manage file uploads, downloads, and deletions using Azure Blob Storage as your CDN. Managed Identity provides a secure alternative by eliminating the need for long-term credentials.
With these steps, your LibreChat application will automatically create the container (if it doesn't exist) and manage file uploads, downloads, and deletions using Azure Blob Storage as your CDN. Managed Identity provides a secure alternative by eliminating the need for long-term credentials.
---
## Local Development with Azurite
For local development and testing, you can use [Azurite](https://github.com/Azure/Azurite), an Azure Storage emulator that provides a local environment for testing your Azure Blob Storage integration without needing an actual Azure account.
### 1. Set Up Azurite
You can run Azurite in several ways:
#### Option A: Using VS Code Extension (Recommended for Development)
1. Install the [Azurite extension](https://marketplace.visualstudio.com/items?itemName=Azurite.azurite) for VS Code
2. Open the command palette (Ctrl+Shift+P or Cmd+Shift+P)
3. Search for and select "Azurite: Start"
This will start Azurite in the background with default settings.
#### Option B: Using Docker
```bash
docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite
```
#### Option C: Using npm
```bash
npm install -g azurite
azurite --silent --location /path/to/azurite/workspace --debug /path/to/debug/log
```
### 2. Configure Environment Variables for Local Development
Add the following environment variables to your `.env` file:
```bash filename=".env"
# Azurite connection string for local development
AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;"
AZURE_STORAGE_PUBLIC_ACCESS=true
AZURE_CONTAINER_NAME=files
```
Notes:
- The `AccountKey` value is the default development key used by Azurite
- The connection uses `http` protocol instead of `https` for local development
- The `BlobEndpoint` points to the local Azurite instance running on port 10000
### 3. Verify the Connection
To verify that your application can connect to the local Azurite instance:
1. Start your LibreChat application
2. Attempt to upload a file through the interface
3. Check the Azurite logs to confirm the connection and operations
If you're using the VS Code extension, you can view the Azurite logs in the Output panel by selecting "Azurite Blob" from the dropdown.
<Callout type="info" title="Note">
Always ensure that your connection string remains secure and never commit it to a public repository. Adjust the public access setting as needed based on your applications security requirements.
</Callout>
The default Azurite account key is a fixed value used for development purposes only. Never use this key in production environments. Always ensure that your connection string remains secure and never commit it to a public repository.
</Callout>

View File

@@ -21,7 +21,7 @@
## fileStrategy
- **Options**: "local" | "firebase" | "s3" | "azure"
- **Options**: "local" | "firebase" | "s3" | "azure_blob"
<OptionTable
options={[