public virtual Response <ConfigurationStore> Get(CancellationToken cancellationToken = default) { using var scope = _configurationStoreClientDiagnostics.CreateScope("ConfigurationStore.Get"); scope.Start(); try { var response = _configurationStoreRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new ConfigurationStore(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <ConfigurationStore> Get(string configStoreName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(configStoreName, nameof(configStoreName)); using var scope = _configurationStoreClientDiagnostics.CreateScope("ConfigurationStoreCollection.Get"); scope.Start(); try { var response = _configurationStoreRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, configStoreName, cancellationToken); if (response.Value == null) { throw _configurationStoreClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new ConfigurationStore(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }