A lightweight, standalone Node.js service for handling Azure Blob Storage uploads with detailed logging and diagnostics.
- Health Check:
GET /health- Service status - Azure Test:
GET /test-azure- Test Azure connectivity and upload - Base64 Upload:
POST /upload-base64- Upload base64 encoded data - File Upload:
POST /upload-file- Upload multipart files - Detailed Logging: Comprehensive Azure SDK response logging
- Built for Railway: Ready-to-deploy with railway.json
# Clone the repo
git clone <your-repo-url>
cd azure-upload-service
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env with your Azure credentials
# Start service
npm start
# Development with auto-reload
npm run dev- Connect your GitHub repo to Railway
- Set environment variables in Railway dashboard:
AZURE_STORAGE_ACCOUNT_NAMEAZURE_STORAGE_ACCOUNT_KEYAZURE_STORAGE_CONTAINER
- Deploy automatically via Git push
| Variable | Description | Example |
|---|---|---|
AZURE_STORAGE_ACCOUNT_NAME |
Azure storage account name | mystorageaccount |
AZURE_STORAGE_ACCOUNT_KEY |
Azure storage account key | your-64-char-key== |
AZURE_STORAGE_CONTAINER |
Azure container name | uploads |
API_KEY |
API key for authentication | your-secure-api-key |
PORT |
Service port | 3000 |
curl -H "X-API-Key: your-api-key" http://localhost:3000/test-azurecurl -X POST http://localhost:3000/upload-base64 \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"filename": "test.png",
"base64Data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=",
"contentType": "image/png"
}'curl -X POST http://localhost:3000/upload-file \
-H "X-API-Key: your-api-key" \
-F "file=@test.png" \
-F "filename=test.png"All upload and test endpoints require API key authentication. Provide the API key via:
- X-API-Key header:
X-API-Key: your-api-key - Authorization header:
Authorization: Bearer your-api-key
The /health endpoint is public and doesn't require authentication.
Deploy to Railway using the included railway.json configuration:
railway login
railway upThis service helps isolate Azure upload issues by:
- Testing the same Azure SDK in a clean environment
- Providing detailed response logging
- Eliminating potential interference from the main application
- Allowing network-level debugging of Azure connectivity