Configuring the Back Office
- 3-4 minutes to read
The BackOffice is an application developed in .NET Core 3.1 that does not require Windows. In Azure, you can use an App Service for Linux. This requires a Linux-based plan, at least P1V2.
Configuration
You can configure the BackOffice in the Settings > Configuration section for each slot separately. All keys must be bound to a slot, unless otherwise stated.
General Settings
Here, you need to select the following settings:
- Stack -
.NET Core
- Major version -
LTS
(or3.1
) - Minor version -
LTS
- Startup command -
dotnet BackOffice.Web.Host.dll
. Note: if you need to bring up the server on the local machine, you can execute this command from the command line.
Application Settings
You can also configure the application through the AppSettings.json file.
In this configuration, double underscores implement nesting in JSON format, for example, the {"App": {"ApiKey": "1234"}}
construct is equal to App__ApiKey = "1234"
.
General
App__ApiKey
- a unique alphanumeric string, at least 16 characters long.App__ClientRootAddress
- the address where you run the frontend service.App__CorsOrigins
- comma-separated backend addresses that the frontend should trust. List both HTTP and HTTPS addresses. If there are aliases for these addresses, they can also be listed.App__ServerRootAddress
- the backend address that the front end sends requests to.Authentication__JwtBearer__SecurityKey
- the private key for the authorization server. For example,BackOffice_<random string of 16 characters>
.
Integration with Shopify
To connect the BackOffice to Shopify, you need a public and a secret keys for authorization in Shopify.
App__ShopifyApiKey
- the public key.App__ShopifySecret
- the private key.
Integration with Application Insights
ApplicationInsights__InstrumentationKey
- the Instrumentation Key for AppInsights defined in theAppSettings.config
.APPINSIGHTS_INSTRUMENTATIONKEY
- the Instrumentation Key for AppInsights that is common to the entire environment. If this key is defined, it has a higher priority over the key from the config.ApplicationInsights__RoleInstance
- the instance name, for example,BackOffice main
.ApplicationInsights__RoleName
- the service name, for example,BackOffice
.
Configuring the Avatar Container
AzureStorageAccount__ConnectionString
- the connection string for the Blob Storage. It is recommended to place this account in the same resource group as the BackOffice.AzureStorageAccount__UserAvatarContainerName
- the name of the container inside this Blob Storage. These containers allow you to store avatars from all environments in one repository.
Integration with Other Services
CustomersCanvasFarmApi__ApiUrl
- the path to the farm.CustomersCanvasFarmApi__ApiKey
- the Farm API Key.DesignManagerApi__ApiUrl
- the path to the Design Manager.DesignManagerApi__ApiKey
- the Design Manager API key.ProjectsBufferApi
- the path to Project Buffer. You can specify the path through API Gateway, for example, https://cc-api-gateway.azurewebsites.net/api/buffer/v1.
SQL Server
At the bottom of the Application Settings, there is a special subsection Connection Strings. Here, you must create a Connection String with the name Default
and the type SQLServer
.
AppSettings.json
In the root folder of the BackOffice application, you can find appsettings.json
. This file may look as follows:
{
"ConnectionStrings": {
"Default": "Server=(local)\\SQLEXPRESS; Database=BackOffice; Trusted_Connection=True;"
},
"App": {
"ServerRootAddress": "http://localhost:21021/",
"ClientRootAddress": "http://localhost:4200/",
"CorsOrigins": "http://localhost:4200,http://localhost:8080,http://localhost:8081,http://localhost:3000",
"ApiKey": "string",
"ShopifyApiKey": "string",
"ShopifySecret": "string"
},
"Authentication": {
"JwtBearer": {
"IsEnabled": "true",
"SecurityKey": "BackOffice_XYZABC",
"Issuer": "BackOffice",
"Audience": "BackOffice"
}
},
"DesignManagerApi": {
"ApiUrl": "http://localhost:84/",
"ApiKey": "ApiKey"
}
}
ConnectionStrings
Here, you can define the connection String to the SQL server, where the BackOffice stores its data.
App
Here, you can define the application settings:
ServerRootAddress
- the URL to the back end.ClientRootAddress
- the URL to the front end.CorsOrigins
- the URLs that will be included in all requests in theAllow-Control-Allow-Origin
header. You can list them separated by commas or put an asterisk. Attention: If at the same time add the appropriate settings on the web server, there is a danger of duplicating the header in the request and breaking everything.ApiKey
- a unique key that needs to be included in requests to the BackOffice.ShopifyApiKey
/ShopifySecret
- the keys obtained in your Shopify account on the Apps tab.
DesignManagerApi
Here, you can define settings for interaction with the Design Manager.
ApiUrl
- the URL that links to the Design Manager. Note: This link must be accessible from the server where BackOffice is installed. if they are deployed on the same server, you can specifylocahost
.ApiKey
- a key that will accompany requests to the Design Manager. Must match theApiKey
defined in the Design Manager's config. See Configuring the Design Manager.