Configuration: Service Module ‐ Database - ChrisMavrommatis/Binacle.Net GitHub Wiki

Contents

As previously mentioned, the Service Module requires a storage solution to save user data.

Supported Databases

Currently the Service module only supports the following database:

  • Azure Storage (Azure Tables)

To set up the database, you'll need the connection string. Once you have it, you can configure the Service Module in one of two ways:

  1. Environment Variable: Pass the connection string using the appropriate environment variable for your chosen provider.
  2. Configuration File: Alternatively, you can modify the ConnectionStrings.json file.

Ensure only one database provider is configured at a time, as each provider has its own environment variables and JSON configuration section.

Azure Storage (Azure Tables)

If you haven't already, create an Azure Storage account. The Service Module specifically utilizes Azure Tables and will automatically create a table named users. If a table with this name already exists, ensure there are no conflicts or use a different storage account.

Please note that the Service Module only interacts with the Azure Tables service and will not make use of any other features of the storage account.

Example Connection String:

A typical Azure Storage connection string looks like this:

DefaultEndpointsProtocol=https;AccountName=your_account_name;AccountKey=your_account_key;TableEndpoint=https://your_account_name.table.core.windows.net/;

Configuration Options:

Once you have the connection string, configure the Service Module by using one of these methods:

  1. Environment Variable: AZURESTORAGE_CONNECTION_STRING
  2. Configuration File: Update the ConnectionString.json file with your Azure Storage connection string:
    {
      "ConnectionStrings": {
        "AzureStorage": "your_connection_string_here"
      }
    }
    

[!WARNING]

Environment variables for connection strings do not take precedence over the configuration file. Instead, they act as fallback values if the configuration file does not provide them.