diff --git a/Samples/Samples.csproj b/Samples/Samples.csproj index 0884dcd23..dc7ae8c01 100644 --- a/Samples/Samples.csproj +++ b/Samples/Samples.csproj @@ -28,7 +28,7 @@ - + diff --git a/Tests/AzSdk.test.reference.props b/Tests/AzSdk.test.reference.props index 02bc274fc..5eb06e3fa 100644 --- a/Tests/AzSdk.test.reference.props +++ b/Tests/AzSdk.test.reference.props @@ -6,7 +6,7 @@ - + diff --git a/src/AzSdk.reference.props b/src/AzSdk.reference.props index b21fd3d75..fb7ef7f12 100644 --- a/src/AzSdk.reference.props +++ b/src/AzSdk.reference.props @@ -6,7 +6,7 @@ - + diff --git a/src/ResourceManagement/KeyVault/Microsoft.Azure.Management.KeyVault.Fluent.csproj b/src/ResourceManagement/KeyVault/Microsoft.Azure.Management.KeyVault.Fluent.csproj index eb9ff08a6..38f060284 100644 --- a/src/ResourceManagement/KeyVault/Microsoft.Azure.Management.KeyVault.Fluent.csproj +++ b/src/ResourceManagement/KeyVault/Microsoft.Azure.Management.KeyVault.Fluent.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/ResourceManagement/KeyVault/VaultImpl.cs b/src/ResourceManagement/KeyVault/VaultImpl.cs index 20eb7d7ed..1269db8e1 100644 --- a/src/ResourceManagement/KeyVault/VaultImpl.cs +++ b/src/ResourceManagement/KeyVault/VaultImpl.cs @@ -31,7 +31,7 @@ internal partial class VaultImpl : IDefinition, IUpdate { - private IKeyVaultClient client; + private Lazy client; private IKeys keys; private ISecrets secrets; private IGraphRbacManager graphRbacManager; @@ -49,7 +49,7 @@ internal VaultImpl(string name, VaultInner innerObject, IKeyVaultManager manager this.accessPolicies.Add(new AccessPolicyImpl(entry, this)); } } - this.client = new KeyVaultClientInternal(Manager.RestClient.Credentials, Manager.RestClient.RootHttpHandler, Manager.RestClient.Handlers.ToArray()); + this.client = new Lazy(() => new KeyVaultClientInternal(Manager.RestClient.Credentials, Manager.RestClient.RootHttpHandler, Manager.RestClient.Handlers.ToArray())); } ///GENMHASH:FAAD3C3E07174E29B21DE058D968BBF7:A534A23FE2D228AC3080C1CF07E66439 @@ -149,7 +149,7 @@ public IKeys Keys { if (keys == null) { - keys = new KeysImpl(client, this); + keys = new KeysImpl(client.Value, this); } return keys; } @@ -161,13 +161,13 @@ public ISecrets Secrets { if (secrets == null) { - secrets = new SecretsImpl(client, this); + secrets = new SecretsImpl(client.Value, this); } return secrets; } } - IKeyVaultClient IVaultBeta.Client => client; + IKeyVaultClient IVaultBeta.Client => client.Value; ///GENMHASH:577E5E9CE0B513EB5189E6F44BB732C7:3949CE4CBC4994E8C88DF2E4815A8696 public VaultImpl WithEmptyAccessPolicy()