Use this example application to integrate with CloudBees Unify and test feature management. After integrating, observe changes in the application UI as you update flag values in the CloudBees Unify.
In this example, the Rox SDK is already set up, and feature flags are implemented in the code.
Get started with the .NET Core project
To get started with the dotnetCore-fm-example project, follow these steps:
-
Using Git, clone the repository to your local machine:
git clone git@github.com:cloudbees-io/dotnetCore-fm-example.git -
In your IDE (for example, Visual Studio, Rider, or Visual Studio Code), open the cloned repository as a .NET Core solution or project. You will revisit this project in your IDE later to run the application.
-
Locate and copy the SDK key:
-
Navigate to .
-
Select an application.
-
Select
next to the SDK key on the page.If no SDK key is available:
-
Navigate to .
-
Select
on the upper-right. -
Follow the installation steps. The SDK key appears once an application is linked to an environment.
-
Close the installation instructions and copy the SDK key.
-
-
-
Add the SDK key to the application:
Open the
Demo/Program.csfile:Demo/Program.csLocate the SDK key placeholder in the file and replace it with your SDK key. For example:
var sdkKey = "<YOUR-SDK-KEY>"; -
Save the updated file.
-
Run the application from the repository root directory:
dotnet run --project=Demo -
To view the application running, go to:
View the imported flags
Now that your application is running:
-
In the CloudBees Unify, select Feature management.
-
Select your example application to display the available flags as shown in the table below.
| Flag name | Flag type | Description |
|---|---|---|
ShowMessage |
Boolean |
Turns the message on or off. |
Message |
String |
Sets the message text. |
FontSize |
Number |
Sets the message font size in pixels. Values: |
FontColor |
String |
Sets the message font color. Values: |
If no flags are displayed, verify that the environment-specific SDK key is correctly added in Demo/Program.cs.
Save the file, and restart the application.
|
To update flags in CloudBees Unify UI:
-
Select Feature management.
-
Select the application.
-
Select
next to the flag you want to configure. -
Select Configure.
-
Select the Environment for the SDK key.
-
Update a flag value and save your changes.
-
Set the Configuration status to On.
The updated flag value is reflected in the application display shortly.
Documentation reference
-
For more information about using multiple SDK keys, refer to: Manage multiple SDK keys in your application.
-
For .NET/C# SDK installation details, refer to: .NET/C# SDK installation.