FeatureFlagClient.SetFeatureFlagAsync Method

Definition

Overloads

Name Description
SetFeatureFlagAsync(FeatureFlag, Boolean, CancellationToken)

Creates a FeatureFlag if it doesn't exist or overwrites the existing feature flag in the configuration store.

SetFeatureFlagAsync(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.

SetFeatureFlagAsync(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 System.Threading.Tasks.Task<Azure.Response<Azure.Data.AppConfiguration.FeatureFlag>> SetFeatureFlagAsync(Azure.Data.AppConfiguration.FeatureFlag flag, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default);
abstract member SetFeatureFlagAsync : Azure.Data.AppConfiguration.FeatureFlag * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Data.AppConfiguration.FeatureFlag>>
override this.SetFeatureFlagAsync : Azure.Data.AppConfiguration.FeatureFlag * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Data.AppConfiguration.FeatureFlag>>
Public Overridable Function SetFeatureFlagAsync (flag As FeatureFlag, Optional onlyIfUnchanged As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of FeatureFlag))

Parameters

flag
FeatureFlag

The FeatureFlag body to create or overwrite. The feature flag is identified by its Name and Label.

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

SetFeatureFlagAsync(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 System.Threading.Tasks.Task<Azure.Response<Azure.Data.AppConfiguration.FeatureFlag>> SetFeatureFlagAsync(string name, bool enabled, string label = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SetFeatureFlagAsync : string * bool * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Data.AppConfiguration.FeatureFlag>>
override this.SetFeatureFlagAsync : string * bool * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Data.AppConfiguration.FeatureFlag>>
Public Overridable Function SetFeatureFlagAsync (name As String, enabled As Boolean, Optional label As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of 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.

Applies to