Ctrip's Apollo configuration center is quickly integrated in the. NET Core project.
. NET Core support documentation for general reference documentation. Net client User Guide: https://github.com/ctripcorp/apollo/wiki/.Net%E5% AE %A2%E6%88%B7%E7% AB %AF%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97
Log on to Apollo to create an App and related configuration items. You can refer to the following Configuration:
Introduce the dependency of Com. Ctrip. Framework. Apollo. Configuration on Nuget.
Configure the app. id set above on the project. Note that this is achieved by creating the appsettings. json file.
{
"Apollo ":{
"AppId": "SampleApp ",
"MetaServer": "http: // 111.230.101.173: 8080"
}
}
AppId is the unique id used to identify an application.
The Apollo client obtains the configuration from different servers for different environments. MetaServer is the server configuration that the client obtains the configuration.
These two are required parameters, and optional parameters can be set.
Our. NET Core configuration system is perfect, and the. NET Core component of Apollo also uses this configuration system.
Let's take a look at the program running effect: