Skip to content

Commit 6bf3661

Browse files
Add support for Azure Blob Storage integration alongside S3 storage, … (#27)
* Add support for Azure Blob Storage integration alongside S3 storage, including provider selection logic and configuration validation * Add shim to ensure Web Crypto API compatibility on Node.js 18 and older * refactor S3 upload logic and add azure envs to .env.example --------- Co-authored-by: Dilushan <dilushan@meetrix.io>
1 parent bd91cf3 commit 6bf3661

File tree

14 files changed

+988
-131
lines changed

14 files changed

+988
-131
lines changed

.env.example

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ REDIS_PASSWORD=
2828
UPLOADER_FILE_EXTENSION=.webm
2929
UPLOADER_TYPE=s3
3030

31+
# Storage provider selection: 's3' (default) or 'azure'
32+
STORAGE_PROVIDER=s3
33+
3134
# S3 compatible storage for recording upload
3235
S3_ACCESS_KEY_ID=
3336
S3_SECRET_ACCESS_KEY=
@@ -36,6 +39,24 @@ S3_ENDPOINT=
3639
S3_BUCKET_NAME=
3740
S3_USE_MINIO_COMPATIBILITY=false
3841

42+
# Azure Blob Storage (when STORAGE_PROVIDER=azure)
43+
# Provide ONE of the following auth methods:
44+
# 1. Connection string
45+
AZURE_STORAGE_CONNECTION_STRING=
46+
# 2. Account + Key
47+
AZURE_STORAGE_ACCOUNT=
48+
AZURE_STORAGE_ACCOUNT_KEY=
49+
# 3. Account + SAS Token (starts with ?sv=)
50+
AZURE_STORAGE_SAS_TOKEN=
51+
# 4. Managed Identity (requires AZURE_STORAGE_ACCOUNT)
52+
AZURE_USE_MANAGED_IDENTITY=false
53+
# Required for Azure
54+
AZURE_STORAGE_CONTAINER=
55+
# Optional Azure settings
56+
AZURE_BLOB_PREFIX=
57+
AZURE_SIGNED_URL_TTL_SECONDS=3600
58+
AZURE_UPLOAD_CONCURRENCY=4
59+
3960
# Notification service (optional) - triggers after recording upload completes
4061
# Webhook notifications
4162
NOTIFY_WEBHOOK_ENABLED=false

.idea/.gitignore

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,26 @@ The following environment variables configure Redis connectivity:
317317

318318
### Recording Upload Configuration
319319

320-
Meeting Bot automatically uploads meeting recording to S3-compatible bucket storage when a meeting end. This feature is enabled by default and supports various cloud storage providers:
320+
Meeting Bot automatically uploads the meeting recording to object storage when a meeting ends. You can choose between S3-compatible storage and Microsoft Azure Blob Storage at runtime using a configuration flag.
321321

322322
- **AWS S3** - Amazon Web Services Simple Storage Service
323323
- **GCP Cloud Storage** - Google Cloud Platform S3-compatible storage
324324
- **MinIO** - Self-hosted S3-compatible object storage
325325
- **Other S3-compatible services** - Any service that implements the S3 API
326+
- **Azure Blob Storage** - Native Azure object storage
326327

327-
#### Environment Variables for Upload Configuration
328+
#### Storage Provider Selection
329+
330+
Select the storage backend without code changes:
331+
332+
```bash
333+
# s3 (default) or azure
334+
STORAGE_PROVIDER=s3
335+
```
336+
337+
When `STORAGE_PROVIDER` is not set, it defaults to `s3` to preserve backward compatibility.
338+
339+
#### Environment Variables for S3-Compatible Upload Configuration
328340

329341
| Variable | Description | Default | Required |
330342
|----------|-------------|---------|----------|
@@ -365,14 +377,65 @@ S3_REGION=us-west-2
365377
S3_USE_MINIO_COMPATIBILITY=true
366378
```
367379

380+
#### Azure Blob Storage Configuration
381+
382+
If you prefer Azure Blob Storage, set `STORAGE_PROVIDER=azure` and configure one of the supported authentication methods below. The bot will preserve the same folder structure and naming used by S3.
383+
384+
Required:
385+
386+
- `AZURE_STORAGE_CONTAINER` — Target container name
387+
- One of the following auth options:
388+
- `AZURE_STORAGE_CONNECTION_STRING`
389+
- `AZURE_STORAGE_ACCOUNT` + `AZURE_STORAGE_ACCOUNT_KEY`
390+
- `AZURE_STORAGE_ACCOUNT` + `AZURE_STORAGE_SAS_TOKEN` (starts with `?sv=`)
391+
- `AZURE_STORAGE_ACCOUNT` + `AZURE_USE_MANAGED_IDENTITY=true` (requires appropriate RBAC on the container)
392+
393+
Optional:
394+
395+
- `AZURE_SIGNED_URL_TTL_SECONDS` — Expiry for generated SAS URLs (default: `3600`)
396+
- `AZURE_UPLOAD_CONCURRENCY` — Parallelism for uploads (default: `4`)
397+
- `AZURE_BLOB_PREFIX` — Optional prefix path within the container (defaults to none; the bot already includes a `meeting-bot/...` path in object keys)
398+
399+
Examples
400+
401+
Connection string:
402+
403+
```bash
404+
STORAGE_PROVIDER=azure
405+
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=example;AccountKey=redacted;EndpointSuffix=core.windows.net
406+
AZURE_STORAGE_CONTAINER=meeting-recordings
407+
```
408+
409+
Account + Key:
410+
411+
```bash
412+
STORAGE_PROVIDER=azure
413+
AZURE_STORAGE_ACCOUNT=example
414+
AZURE_STORAGE_ACCOUNT_KEY=redacted
415+
AZURE_STORAGE_CONTAINER=meeting-recordings
416+
```
417+
418+
Managed Identity (AAD):
419+
420+
```bash
421+
STORAGE_PROVIDER=azure
422+
AZURE_STORAGE_ACCOUNT=example
423+
AZURE_USE_MANAGED_IDENTITY=true
424+
AZURE_STORAGE_CONTAINER=meeting-recordings
425+
```
426+
368427
#### How Upload Works
369428

370-
1. **Automatic Upload**: When a meeting recording completes, the bot automatically uploads the file to the configured S3-compatible bucket
429+
1. **Automatic Upload**: When a meeting recording completes, the bot automatically uploads the file to the configured object storage (S3-compatible or Azure Blob)
371430
2. **File Naming**: Recordings are uploaded with descriptive names including meeting details and timestamps
372431
3. **Error Handling**: If upload fails, the bot will automatically retry upload
373432
4. **Cleanup**: Local recording files are cleaned up after successful upload
374433

375-
**Note**: The upload feature is enabled by default when S3 environment variables are configured. No additional configuration is required.
434+
Notes:
435+
436+
- The default object key layout is: `meeting-bot/{userId}/{fileName}{extension}` (e.g., `meeting-bot/1234/My Meeting - 2025-11-13 14-42.webm`). This same layout is used for both S3 and Azure to ensure parity.
437+
- When `STORAGE_PROVIDER=azure` is set and Azure environment variables are provided, the upload will go to Azure Blob Storage instead of S3.
438+
- Signed URL generation for Azure uses SAS tokens with a configurable TTL via `AZURE_SIGNED_URL_TTL_SECONDS`.
376439

377440
## ⚙️ Configuration
378441

0 commit comments

Comments
 (0)