Skip to content

Commit

Permalink
docs: add data and persistence (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnc1997 authored Jun 9, 2024
1 parent 8be9bef commit 19c5389
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 19c5389

Please sign in to comment.