ConfigurationsClient.DeleteAsync 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
DeleteAsync(String, CancellationToken) |
Deletes a configuration from IoT hub. |
DeleteAsync(Configuration, Boolean, CancellationToken) |
Deletes a configuration from IoT hub. |
DeleteAsync(String, CancellationToken)
Deletes a configuration from IoT hub.
public virtual System.Threading.Tasks.Task DeleteAsync (string configurationId, System.Threading.CancellationToken cancellationToken = default);
abstract member DeleteAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.DeleteAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function DeleteAsync (configurationId As String, Optional cancellationToken As CancellationToken = Nothing) As Task
Parameters
- configurationId
- String
The id of the configuration being deleted.
- cancellationToken
- CancellationToken
The token which allows the operation to be canceled.
Returns
Exceptions
Thrown when the provided configurationId
is null.
Thrown if the configurationId
is empty or whitespace.
Thrown if IoT hub responded to the request with a non-successful status code. For example, if the provided request was throttled, IotHubServiceException with ThrottlingException is thrown. For a complete list of possible error cases, see IotHubServiceErrorCode.
If the HTTP request fails due to an underlying issue such as network connectivity, DNS failure, or server certificate validation.
If the provided cancellationToken
has requested cancellation.
Applies to
DeleteAsync(Configuration, Boolean, CancellationToken)
Deletes a configuration from IoT hub.
public virtual System.Threading.Tasks.Task DeleteAsync (Microsoft.Azure.Devices.Configuration configuration, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default);
abstract member DeleteAsync : Microsoft.Azure.Devices.Configuration * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.DeleteAsync : Microsoft.Azure.Devices.Configuration * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function DeleteAsync (configuration As Configuration, Optional onlyIfUnchanged As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Task
Parameters
- configuration
- Configuration
The configuration being deleted.
- onlyIfUnchanged
- Boolean
If false, this delete operation will be performed even if the provided device identity has an out of date ETag. If true, the operation will throw a IotHubServiceException with PreconditionFailed if the provided configuration has an out of date ETag. An up-to-date ETag can be retrieved using GetAsync(String, CancellationToken).
- cancellationToken
- CancellationToken
The token which allows the operation to be canceled.
Returns
Exceptions
Thrown when the provided configuration
is null.
Thrown if IoT hub responded to the request with a non-successful status code. For example, if the provided request was throttled, IotHubServiceException with ThrottlingException is thrown. For a complete list of possible error cases, see IotHubServiceErrorCode.
If the HTTP request fails due to an underlying issue such as network connectivity, DNS failure, or server certificate validation.
If the provided cancellationToken
has requested cancellation.