public async Task GetIfExists() { #region Snippet:Managing_KeyVaults_GetAVaultIfExists VaultCollection vaultCollection = resourceGroup.GetVaults(); Vault vault = await vaultCollection.GetIfExistsAsync("foo"); if (vault != null) { Console.WriteLine(vault.Data.Name); } if (await vaultCollection.ExistsAsync("bar")) { Console.WriteLine("KeyVault 'bar' exists."); } #endregion }