コード例 #1
0
        public async Task GetKeyValueTest()
        {
            ListKeyValueOptions listKeyValueOptions = new ListKeyValueOptions("Primary");
            KeyValue            keyValue            = await ConfigStore.GetKeyValueAsync(listKeyValueOptions);

            Assert.IsTrue(keyValue.Key.Equals("Primary"));
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        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;
            }
        }