public async Task GetKeyValueTest() { ListKeyValueOptions listKeyValueOptions = new ListKeyValueOptions("Primary"); KeyValue keyValue = await ConfigStore.GetKeyValueAsync(listKeyValueOptions); Assert.IsTrue(keyValue.Key.Equals("Primary")); }
public virtual Response <KeyValue> GetKeyValue(ListKeyValueOptions listKeyValueOptions, CancellationToken cancellationToken = default) { Argument.AssertNotNull(listKeyValueOptions, nameof(listKeyValueOptions)); using var scope = _configurationStoreClientDiagnostics.CreateScope("ConfigurationStore.GetKeyValue"); scope.Start(); try { var response = _configurationStoreRestClient.ListKeyValue(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, listKeyValueOptions, cancellationToken); return(response); } catch (Exception e) { scope.Failed(e); throw; } }
public async virtual Task <Response <KeyValue> > GetKeyValueAsync(ListKeyValueOptions listKeyValueOptions, CancellationToken cancellationToken = default) { if (listKeyValueOptions == null) { throw new ArgumentNullException(nameof(listKeyValueOptions)); } using var scope = _clientDiagnostics.CreateScope("ConfigurationStore.GetKeyValue"); scope.Start(); try { var response = await _configurationStoresRestClient.ListKeyValueAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, listKeyValueOptions, cancellationToken).ConfigureAwait(false); return(response); } catch (Exception e) { scope.Failed(e); throw; } }