From 19c538937738861cbead7a4164e9c4b0506aa434 Mon Sep 17 00:00:00 2001 From: Thomas Clark Date: Sun, 9 Jun 2024 21:27:10 +0100 Subject: [PATCH] docs: add data and persistence (#83) --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.md b/README.md index 20c2f1e..783a60c 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,48 @@ The emulator is compatible with the following operations: | List (Select Fields) | ❌ | | List (Time-Based Access) | ❌ | +## Data + +The emulator stores configuration settings in a [SQLite](https://sqlite.org) database. + +The data that is generated by the emulator during a session may be persisted between sessions using a [volume](https://docs.docker.com/storage/volumes). + +```yaml +services: + azure-app-configuration-emulator: + build: + context: https://github.com/tnc1997/azure-app-configuration-emulator.git + dockerfile: ./src/AzureAppConfigurationEmulator/Dockerfile + volumes: + - azure-app-configuration-emulator:/var/lib/azureappconfigurationemulator +volumes: + azure-app-configuration-emulator: +``` + +The connection string for the database may be overridden using the environment variable `ConnectionStrings__DefaultConnection`. + +```yaml +services: + azure-app-configuration-emulator: + build: + context: https://github.com/tnc1997/azure-app-configuration-emulator.git + dockerfile: ./src/AzureAppConfigurationEmulator/Dockerfile + environment: + - ConnectionStrings__DefaultConnection=Data Source=/var/lib/azureappconfigurationemulator/emulator.db +``` + +The database may be seeded with data and mounted into the container however care should be taken to ensure that the database has the required schema. + +```yaml +services: + azure-app-configuration-emulator: + build: + context: https://github.com/tnc1997/azure-app-configuration-emulator.git + dockerfile: ./src/AzureAppConfigurationEmulator/Dockerfile + volumes: + - ./emulator.db:/var/lib/azureappconfigurationemulator/emulator.db +``` + ## Messaging The emulator integrates with Azure Event Grid to publish events using the [Event Grid event schema](https://learn.microsoft.com/en-us/azure/event-grid/custom-topics#event-grid-event-schema) when configuration settings are deleted or modified.