-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prepare keyvault for release (#24998)
- Loading branch information
Showing
3 changed files
with
64 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Samples/Changelog.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#region Snippet:Changelog_NewCode | ||
using Azure.Identity; | ||
using Azure.ResourceManager.KeyVault; | ||
using Azure.ResourceManager.KeyVault.Models; | ||
using Azure.ResourceManager.Resources; | ||
using Azure.ResourceManager.Resources.Models; | ||
using System; | ||
#if !SNIPPET | ||
using System.Threading.Tasks; | ||
using NUnit.Framework; | ||
|
||
namespace Azure.ResourceManager.KeyVault.Tests.Samples | ||
{ | ||
internal class Changelog | ||
{ | ||
[Test] | ||
[Ignore("Only verifying that the sample builds")] | ||
public async Task NewCode() | ||
{ | ||
#endif | ||
ArmClient armClient = new ArmClient(new DefaultAzureCredential()); | ||
Subscription subscription = await armClient.GetDefaultSubscriptionAsync(); | ||
ResourceGroup resourceGroup = await subscription.GetResourceGroups().GetAsync("myRgName"); | ||
|
||
VaultCollection vaultCollection = resourceGroup.GetVaults(); | ||
VaultCreateOrUpdateParameters parameters = new VaultCreateOrUpdateParameters(Location.WestUS2, new VaultProperties(Guid.NewGuid(), new Sku(SkuFamily.A, SkuName.Standard))); | ||
|
||
VaultCreateOrUpdateOperation lro = await vaultCollection.CreateOrUpdateAsync("myVaultName", parameters); | ||
Vault vault = lro.Value; | ||
#endregion | ||
} | ||
|
||
[Test] | ||
[Ignore("Only verifying that the sample builds")] | ||
public void CreateModel() | ||
{ | ||
#region Snippet:Changelog_CreateModel | ||
VaultProperties properties = new VaultProperties(Guid.NewGuid(), new Sku(SkuFamily.A, SkuName.Standard)); | ||
VaultCreateOrUpdateParameters parameters = new VaultCreateOrUpdateParameters(Location.WestUS2, properties); | ||
#endregion | ||
} | ||
} | ||
} |