Manage organization feature flags
Add, update, or delete feature flags for an organization.
Read time 3 minutesLast updated 12 hours ago
Feature flags toggle Self-Hosted Deployment capabilities such as a preview of UI functionality or a temporary workaround for a customer-specific issue. They're scoped to one organization at a time: a flag set in organization A has no effect on organization B.
The upc-cli tool exposes the four operations needed to administer feature flags end-to-end:
|
|
|---|---|
| Shows all feature flags currently set for an organization. |
| Creates a new feature flag and sets its value. |
| Changes the value of an existing feature flag. |
| Removes a feature flag entirely (reverts to the platform default). |
Before you start
To work with feature flags, you need:
- The ID of the target organization (a UUID-formatted string, like ). Find it with the
00000000-0000-0000-0000-000000000000command or in the organization properties in the Dashboard (go to Administration > Settings).orgs list - No explicit authentication is required - the tool runs in-cluster and calls relevant APIs directly. Anyone who can execute in the solution namespace can change feature flags; treat
kubectl runaccess as the only access boundary.kubectl - The commands on this page work in a Unix-based shell (Linux, MacOS, WSL on Windows, Git Bash on Windows). If you need to run them in a Windows shell:
- Use PowerShell 7.3 or newer, not Windows PowerShell 5.x.
- Replace line continuation characters () with backticks (
\).`
Use cases
These examples cover:
- Listing current feature flags.
- Enabling and disabling a feature flag.
- Changing the value of an existing feature flag.
- Removing a feature flag.
- Previewing a flag change without applying it.
List the current feature flags
This command lists all feature flags set for an organization.
Replace the string with the ID of the target organization.
<organizationId>kubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions \ --restart=Never \ --overrides='{"spec":{"imagePullSecrets":[{"name":"acr-unity-registry"}]}}' \ -- \ --fqdn http://mini-usf:8080 \ --path-prefix="" \ --no-auth \ flags list --organization-id <organizationId>
The response is a JSON array of feature flag objects. Each entry includes:
- The feature name.
- The flag's boolean value.
- The flag's internal ID for the particular organization.
- When the flag was created and last updated.
Only feature flags that have been explicitly set for the organization appear in the list. Platform defaults aren't listed.
Enable or disable a feature flag
To turn on a flag for the first time run the following command:
-
Replace thestring with the ID of the target organization.
<organizationId> -
Replace thestring with the feature flag name.
<flag-name> -
Accepted literals for(case-insensitive):
--value- For enabling a flag: ,
true,yes, andon1 - For disabling a flag: ,
false,no, andoff0
Any other input is rejected before an HTTP call is made. - For enabling a flag:
kubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions \ --restart=Never \ --overrides='{"spec":{"imagePullSecrets":[{"name":"acr-unity-registry"}]}}' \ -- \ --fqdn http://mini-usf:8080 \ --path-prefix="" \ --no-auth \ flags add --organization-id <organizationId> --name <flag-name> --value true
Change a flag's value
To change the value of a feature flag that's already set for an organization, (in this example, to ):
falsekubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions \ --restart=Never \ --overrides='{"spec":{"imagePullSecrets":[{"name":"acr-unity-registry"}]}}' \ -- \ --fqdn http://mini-usf:8080 \ --path-prefix="" \ --no-auth \ flags update --organization-id <organizationId> --name <flag-name> --value false
The distinction between and matters:
addupdate- fails (HTTP 409) if a flag with the same name already exists for the organization. Use it for first-time enablement.
add - looks up the existing flag by name and changes its value. It fails if the flag is not yet set for the organization.
update
If you don't know whether the flag is already set, run first.
flags listRemove a feature flag
Removing a flag reverts the organization to the platform's default behavior for that feature. This is different from setting the flag to ; a removed flag is no longer overridden at the organization level at all.
falseUse the following command to remove a feature flag for an organization:
- Replace the string with the ID of the target organization.
<organizationId> - Replace the string with the feature flag name.
<flag-name>
kubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions \ --restart=Never \ --overrides='{"spec":{"imagePullSecrets":[{"name":"acr-unity-registry"}]}}' \ -- \ --fqdn http://mini-usf:8080 \ --path-prefix="" \ --no-auth \ flags delete --organization-id <organizationId> --name <flag-name>
Preview a change without applying it
To run a preview, add the parameter before the command. The upc-cli tool prints the HTTP method, URL, and request body it would have sent, and exits without contacting the API.
--dry-runflagsFor example, to preview adding a new flag:
kubectl run -it upc-cli --rm \ --image=uccmpprivatecloud.azurecr.io/docker/upc-cli:latest \ -n asset-solutions \ --restart=Never \ --overrides='{"spec":{"imagePullSecrets":[{"name":"acr-unity-registry"}]}}' \ -- \ --fqdn http://mini-usf:8080 \ --path-prefix="" \ --no-auth \ --dry-run \ flags add --organization-id <organizationId> --name <flag-name> --value true