FeatureFlagClient.SetFeatureFlag Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| SetFeatureFlag(FeatureFlag, Boolean, CancellationToken) |
Creates a FeatureFlag if it doesn't exist or overwrites the existing feature flag in the configuration store. |
| SetFeatureFlag(String, Boolean, String, CancellationToken) |
Creates a FeatureFlag, uniquely identified by name and label, if it doesn't exist or overwrites the existing feature flag in the configuration store. |
SetFeatureFlag(FeatureFlag, Boolean, CancellationToken)
- Source:
- FeatureFlagClient.cs
Creates a FeatureFlag if it doesn't exist or overwrites the existing feature flag in the configuration store.
public virtual Azure.Response<Azure.Data.AppConfiguration.FeatureFlag> SetFeatureFlag(Azure.Data.AppConfiguration.FeatureFlag flag, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default);
abstract member SetFeatureFlag : Azure.Data.AppConfiguration.FeatureFlag * bool * System.Threading.CancellationToken -> Azure.Response<Azure.Data.AppConfiguration.FeatureFlag>
override this.SetFeatureFlag : Azure.Data.AppConfiguration.FeatureFlag * bool * System.Threading.CancellationToken -> Azure.Response<Azure.Data.AppConfiguration.FeatureFlag>
Public Overridable Function SetFeatureFlag (flag As FeatureFlag, Optional onlyIfUnchanged As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Response(Of FeatureFlag)
Parameters
- flag
- FeatureFlag
The FeatureFlag body to create or overwrite. The feature flag is identified by its Name.
- onlyIfUnchanged
- Boolean
If set to true and the feature flag exists in the configuration store, overwrite it only if the passed-in FeatureFlag is the same version as the one in the configuration store. The versions are the same if their Etag values match. If they differ, the service returns 412 (precondition failed) and a RequestFailedException is thrown.
- cancellationToken
- CancellationToken
A CancellationToken controlling the request lifetime.
Returns
A response containing the FeatureFlag written to the configuration store.
Applies to
SetFeatureFlag(String, Boolean, String, CancellationToken)
- Source:
- FeatureFlagClient.cs
Creates a FeatureFlag, uniquely identified by name and label, if it doesn't exist or overwrites the existing feature flag in the configuration store.
public virtual Azure.Response<Azure.Data.AppConfiguration.FeatureFlag> SetFeatureFlag(string name, bool enabled, string label = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SetFeatureFlag : string * bool * string * System.Threading.CancellationToken -> Azure.Response<Azure.Data.AppConfiguration.FeatureFlag>
override this.SetFeatureFlag : string * bool * string * System.Threading.CancellationToken -> Azure.Response<Azure.Data.AppConfiguration.FeatureFlag>
Public Overridable Function SetFeatureFlag (name As String, enabled As Boolean, Optional label As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of FeatureFlag)
Parameters
- name
- String
The name of the feature flag.
- enabled
- Boolean
The enabled state of the feature flag.
- label
- String
A label used to group this feature flag with others.
- cancellationToken
- CancellationToken
A CancellationToken controlling the request lifetime.
Returns
A response containing the FeatureFlag written to the configuration store.