diff --git a/docs/v5.0.0/RELEASE_NOTES_v5.0.0.md b/docs/v5.0.0/RELEASE_NOTES_v5.0.0.md index 3719bd0a..a4c909ab 100644 --- a/docs/v5.0.0/RELEASE_NOTES_v5.0.0.md +++ b/docs/v5.0.0/RELEASE_NOTES_v5.0.0.md @@ -24,6 +24,7 @@ Version 5.0.0 is a major release featuring .NET 10.0 framework upgrade, modern d - Improved visual hierarchy and card-based design ### SQLite Database Support +- **Optional upgrade** - SQLite available for enhanced performance (not default) - **Enhanced performance** with faster data access and queries - **Better scalability** for larger configurations - **Improved reliability** with transactional support and data integrity @@ -31,7 +32,8 @@ Version 5.0.0 is a major release featuring .NET 10.0 framework upgrade, modern d - **One-click migration** with automatic backup creation - **Rollback support** if migration issues occur - Admin UI for easy storage provider management -- Maintains backward compatibility with file-based JSON storage +- **Default remains JSON file-based storage** for maximum compatibility +- ⚠️ **IMPORTANT**: SQLite not recommended for Azure Container Apps with File Share mounts (use FileSystem storage instead) ### Azure Tenant Name Validation - **Validate generated names against your Azure tenant** before deployment diff --git a/docs/v5.0.0/V5.0.0_MIGRATION_GUIDE.md b/docs/v5.0.0/V5.0.0_MIGRATION_GUIDE.md index e9594ca0..d27e3c69 100644 --- a/docs/v5.0.0/V5.0.0_MIGRATION_GUIDE.md +++ b/docs/v5.0.0/V5.0.0_MIGRATION_GUIDE.md @@ -1,5 +1,3 @@ -# Azure Naming Tool v5.0.0 Migration Guide - ## Overview Version 5.0.0 of the Azure Naming Tool introduces significant enhancements including a modern redesigned UI, SQLite database storage option, and Azure resource name validation capabilities. This guide will help you successfully migrate from previous versions to v5.0.0. @@ -279,7 +277,23 @@ v5.0.0 requires .NET 10.0 runtime. You **MUST** update your App Service runtime **⚠️ IMPORTANT: .NET 10.0 Docker Image Required** -v5.0.0 uses a new Docker image based on .NET 10.0 runtime. +v5.0.0 uses a new Docker image based on .NET 10.0 runtime. You need to build the image locally from source. + +**🚨 CRITICAL - Azure Container Apps Users:** + +If you are deploying to **Azure Container Apps with Azure File Share** for persistent storage: + +> **DO NOT use SQLite storage!** +> +> SQLite does not work with Azure File Share (SMB/CIFS network mounts) due to file locking issues. Your container will fail to start with `"database is locked"` errors. +> +> **Solution:** Use FileSystem (JSON) storage instead: +> - In `appsettings.json`, ensure: `"StorageProvider": "FileSystem"` +> - This is the default for fresh Docker installations +> - JSON files work perfectly with Azure File Share mounts +> - You can still use all v5.0.0 features except Azure Tenant Name Validation (which requires SQLite) + +**For other Docker deployments:** SQLite works fine with local Docker volumes. 1. **STOP the current container (if running):** ```bash @@ -287,12 +301,18 @@ v5.0.0 uses a new Docker image based on .NET 10.0 runtime. docker rm azurenamingtool ``` -2. **Pull the latest v5.0.0 image:** +2. **Clone the repository and build the v5.0.0 image:** ```bash - # Pull the .NET 10.0-based image - docker pull ghcr.io/mspnp/azurenamingtool:v5.0.0 - # Or use latest tag (ensure it's v5.0.0 or higher) - docker pull ghcr.io/mspnp/azurenamingtool:latest + # Clone the repository (if not already cloned) + git clone https://github.com/mspnp/AzureNamingTool.git + cd AzureNamingTool + + # Checkout the v5.0.0 release tag + git checkout v5.0.0 + + # Build the Docker image from the src directory + cd src + docker build -t azurenamingtool:v5.0.0 . ``` 3. **Run with persistent storage:** @@ -303,7 +323,7 @@ v5.0.0 uses a new Docker image based on .NET 10.0 runtime. -v $(pwd)/settings:/app/settings \ --name azurenamingtool \ --restart unless-stopped \ - ghcr.io/mspnp/azurenamingtool:v5.0.0 + azurenamingtool:v5.0.0 ``` **Windows PowerShell:** @@ -314,10 +334,10 @@ v5.0.0 uses a new Docker image based on .NET 10.0 runtime. -v ${PWD}/settings:/app/settings ` --name azurenamingtool ` --restart unless-stopped ` - ghcr.io/mspnp/azurenamingtool:v5.0.0 + azurenamingtool:v5.0.0 ``` -4. **Verify container started:** +5. **Verify container started:** ```bash # Check container is running docker ps @@ -328,11 +348,11 @@ v5.0.0 uses a new Docker image based on .NET 10.0 runtime. # Should see: "Now listening on: http://[::]:80" ``` -5. Wait 30-60 seconds, then access the application at `http://localhost` +6. Access the application at `http://localhost:8081` (or your chosen port) -6. **VERIFY DEPLOYMENT:** - - Check container logs: `docker logs azurenamingtool | grep "Application started"` - - Access http://localhost and verify v5.0.0 loads +7. **VERIFY DEPLOYMENT:** + - Check container logs: `docker logs azurenamingtool` + - Access http://localhost:8081 and verify v5.0.0 loads - Check footer for version "5.0.0" **Docker Compose Example:** @@ -340,13 +360,13 @@ v5.0.0 uses a new Docker image based on .NET 10.0 runtime. version: '3.8' services: azurenamingtool: - image: ghcr.io/mspnp/azurenamingtool:v5.0.0 + build: . # Build from local Dockerfile + image: azurenamingtool:latest container_name: azurenamingtool ports: - - "80:80" + - "8081:80" # Map host port 8081 to container port 80 volumes: - - ./repository:/app/repository - - ./settings:/app/settings + - azurenamingtoolvol:/app/settings # Use Docker volume for persistence restart: unless-stopped environment: - ASPNETCORE_ENVIRONMENT=Production @@ -574,6 +594,25 @@ v5.0.0 introduces SQLite database support for improved performance and reliabili > - The application **MUST BE RESTARTED** after migration completes > - Ensure you have adequate disk space (at least 2x your current data size) +> **🚨 CRITICAL - Azure Container Apps & File Share Users:** +> +> **DO NOT migrate to SQLite if you are using:** +> - **Azure Container Apps with Azure File Share** mounted volumes +> - **Any network file system** (SMB/CIFS/NFS) for persistent storage +> - **Docker with bind mounts to network drives** +> +> **Why:** SQLite does not support network file systems due to file locking limitations. The database file will become locked and your container will fail to start with error: `"database is locked"`. +> +> **Solution:** Keep using **FileSystem (JSON)** storage provider for these scenarios. JSON file storage works perfectly with network mounts. +> +> **When SQLite works:** +> - ✅ Azure App Service (local disk) +> - ✅ Docker with Docker volumes (local) +> - ✅ Standalone installations (local disk) +> - ✅ Kubernetes with local persistent volumes +> - ❌ Azure Container Apps with File Share +> - ❌ Any network-based storage + #### Prerequisites 1. **Complete Steps 1-5** (Deploy v5.0.0 and restore configuration) @@ -746,6 +785,44 @@ If you need to rollback from SQLite to file-based storage: 4. Try rollback procedure (see Step 6) 5. Restore from pre-migration backup +#### Container Fails with "Database is Locked" Error +**Symptom:** Docker container or Azure Container App fails to start with SQLite error: `"SQLite Error 5: 'database is locked'"` or `"Microsoft.Data.Sqlite.SqliteException (0x80004005)"` + +**Root Cause:** SQLite does not support network file systems (Azure File Share uses SMB/CIFS protocol). File locking doesn't work correctly over network mounts. + +**Solution:** +1. **Immediate Fix - Switch to FileSystem Storage:** + ```bash + # Stop the container + docker stop azurenamingtool + docker rm azurenamingtool + + # Edit settings/appsettings.json and change: + "StorageProvider": "FileSystem" # Change from "SQLite" + + # Delete the SQLite database file (optional, but recommended) + rm settings/azurenamingtool.db + + # Restart container + docker run -d \ + -p 8081:80 \ + --mount source=azurenamingtoolvol,target=/app/settings \ + --name azurenamingtool \ + azurenamingtool:latest + ``` + +2. **For Azure Container Apps:** + - Keep using FileSystem (JSON) storage + - Do NOT migrate to SQLite + - JSON files work perfectly with Azure File Share + +3. **Long-term Solution:** + - Use FileSystem storage for Azure Container Apps with File Share + - OR migrate to Azure App Service with local disk for SQLite support + - OR use Azure SQL Database (future enhancement) + +**Prevention:** Always check deployment platform before migrating to SQLite (see warning in Step 6). + #### Azure Validation Not Working **Symptom:** Azure validation features are not available diff --git a/docs/v5.0.0/wiki/V5.0.0_MIGRATION_GUIDE.md b/docs/v5.0.0/wiki/V5.0.0_MIGRATION_GUIDE.md index b4b3ce9a..dc1e72a6 100644 --- a/docs/v5.0.0/wiki/V5.0.0_MIGRATION_GUIDE.md +++ b/docs/v5.0.0/wiki/V5.0.0_MIGRATION_GUIDE.md @@ -279,7 +279,7 @@ v5.0.0 requires .NET 10.0 runtime. You **MUST** update your App Service runtime **⚠️ IMPORTANT: .NET 10.0 Docker Image Required** -v5.0.0 uses a new Docker image based on .NET 10.0 runtime. +v5.0.0 uses a new Docker image based on .NET 10.0 runtime. You must build the image from source. 1. **STOP the current container (if running):** ```bash @@ -287,37 +287,44 @@ v5.0.0 uses a new Docker image based on .NET 10.0 runtime. docker rm azurenamingtool ``` -2. **Pull the latest v5.0.0 image:** +2. **Download and extract v5.0.0 release:** + - Navigate to the [Releases page](https://github.com/mspnp/AzureNamingTool/releases) + - Download **AzureNamingTool.zip** from the v5.0.0 release assets + - Extract the ZIP file to a folder + - Verify the extracted files match the repository contents + +3. **Build the v5.0.0 Docker image:** ```bash - # Pull the .NET 10.0-based image - docker pull ghcr.io/mspnp/azurenamingtool:v5.0.0 - # Or use latest tag (ensure it's v5.0.0 or higher) - docker pull ghcr.io/mspnp/azurenamingtool:latest + # Navigate to the extracted folder + cd path/to/extracted/AzureNamingTool + + # Build the Docker image + docker build -t azurenamingtool . ``` + + > **NOTE:** Ensure the '.' is included in the command -3. **Run with persistent storage:** +4. **Run with persistent storage using a Docker volume:** ```bash docker run -d \ - -p 80:80 \ - -v $(pwd)/repository:/app/repository \ - -v $(pwd)/settings:/app/settings \ + -p 8081:80 \ + --mount source=azurenamingtoolvol,target=/app/settings \ --name azurenamingtool \ --restart unless-stopped \ - ghcr.io/mspnp/azurenamingtool:v5.0.0 + azurenamingtool:latest ``` - **Windows PowerShell:** - ```powershell - docker run -d ` - -p 80:80 ` - -v ${PWD}/repository:/app/repository ` - -v ${PWD}/settings:/app/settings ` - --name azurenamingtool ` - --restart unless-stopped ` - ghcr.io/mspnp/azurenamingtool:v5.0.0 + **Windows Command Prompt:** + ```cmd + docker run -d -p 8081:80 --mount source=azurenamingtoolvol,target=/app/settings --name azurenamingtool --restart unless-stopped azurenamingtool:latest ``` + + > **NOTES:** + > - Substitute 8081 for any port not in use on your machine + > - The volume mount ensures settings persist across container restarts + > - You may see warnings about DataProtection keys - these are normal and indicate keys are local to the container -4. **Verify container started:** +5. **Verify container started:** ```bash # Check container is running docker ps @@ -328,11 +335,11 @@ v5.0.0 uses a new Docker image based on .NET 10.0 runtime. # Should see: "Now listening on: http://[::]:80" ``` -5. Wait 30-60 seconds, then access the application at `http://localhost` +6. Access the application at `http://localhost:8081` (or your chosen port) -6. **VERIFY DEPLOYMENT:** - - Check container logs: `docker logs azurenamingtool | grep "Application started"` - - Access http://localhost and verify v5.0.0 loads +7. **VERIFY DEPLOYMENT:** + - Check container logs: `docker logs azurenamingtool` + - Access http://localhost:8081 and verify v5.0.0 loads - Check footer for version "5.0.0" **Docker Compose Example:** @@ -340,13 +347,13 @@ v5.0.0 uses a new Docker image based on .NET 10.0 runtime. version: '3.8' services: azurenamingtool: - image: ghcr.io/mspnp/azurenamingtool:v5.0.0 + build: . # Build from local Dockerfile + image: azurenamingtool:latest container_name: azurenamingtool ports: - - "80:80" + - "8081:80" # Map host port 8081 to container port 80 volumes: - - ./repository:/app/repository - - ./settings:/app/settings + - azurenamingtoolvol:/app/settings # Use Docker volume for persistence restart: unless-stopped environment: - ASPNETCORE_ENVIRONMENT=Production diff --git a/src/Components/Modals/MigrationPromptModal.razor b/src/Components/Modals/MigrationPromptModal.razor index 8f290a1f..2155978c 100644 --- a/src/Components/Modals/MigrationPromptModal.razor +++ b/src/Components/Modals/MigrationPromptModal.razor @@ -41,6 +41,20 @@ +
+ DO NOT migrate to SQLite if you are using Azure Container Apps with Azure File Share for persistent storage. + SQLite does not work with network file systems (Azure File Share uses SMB/CIFS) and will cause "database is locked" errors. +
++ Keep using JSON (FileSystem) storage for Azure Container Apps deployments with File Share. +
+