Witsml Explorer requires a database to store application data. One option is to use a Cosmos database in Azure.
- If not already installed, install Azure CLI on your computer Azure CLI, and then login
az login - Copy
config-example.cfginto a new fileconfig.cfgin folderScripts/Azureand fill insubscriptionIdandresourceGroupNamefrom your Azure subscription and resourcegroup. - There exist some scripts that may simplify setting up the necessary infrastructure for this project in folder
Scripts/Azure.
Script to create Cosmos DB:./create-cosmos-db.sh
Script to run all together:./run-azure-scripts.sh - In file
config.cfgenterdatabaseAccountNameand a name (container) for your database indatabaseName. - Run
./create-cosmos-db.sh(prerequisite azure cli installed, and that your are logged in)
If you have a CosmosDB setup and ready, follow these steps to configure the backend properly.
#From project root.
cd Src/WitsmlExplorer.Api
# If you do not have a mysettings.json file, create it:
cp appsettings.json mysettings.json
Add the following "CosmosDb" configuration to mysettings.json
{
{...},
"CosmosDb": {
"Uri": "<...>", (Uri from relevant Azure Database => Overview => Uri )
"Name": "<...>", (Container name from relevant Azure Database => DataExplorer || databaseName from config.cfg)
"AuthKey": "<...>" (PrimaryKey from relevant Azure Database => Setting => Keys )
},
{...}
}