Skip to content

Commit

Permalink
update change log for KeyVault track 2 mgmt sdk (Azure#12272)
Browse files Browse the repository at this point in the history
* update change log for KeyVault track 2 mgmt sdk

* update change log

* refine change log

* refine code sample
  • Loading branch information
erich-wang authored Jun 8, 2020
1 parent 779ddcd commit 209260a
Showing 1 changed file with 85 additions and 2 deletions.
87 changes: 85 additions & 2 deletions sdk/keyvault/Azure.Management.KeyVault/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,88 @@

## 1.0.0-preview.1

### New Features
- Initial preview of Azure Management KeyVault SDK based on Azure.Core
This package follows the new Azure SDK guidelines which provide a number of core capabilities that are shared amongst all Azure SDKs, including the intuitive Azure Identity library, an HTTP Pipeline with custom policies, error-handling, distributed tracing, and much more.

This is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, please submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues).

### General New Features

- Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET
- Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing
- HTTP pipeline with custom policies
- Better error-handling
- Support uniform telemetry across all languages

> NOTE: For more information about unified authentication, please refer to [Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet)
### Migration from Previous Version of Azure Management SDK

#### Package Name
The package name has been changed from `Microsoft.Azure.Management.KeyVault` to `Azure.Management.KeyVault`

#### Management Client Changes

Example: Create a Key Vault Instance:

Before upgrade:
```csharp
using Microsoft.Azure.Management.KeyVault;
using Microsoft.Azure.Management.KeyVault.Models;
using Microsoft.Rest;

var tokenCredentials = new TokenCredentials("YOUR ACCESS TOKEN");
var keyVaultManagementClient = new KeyVaultManagementClient(tokenCredentials);
var vault = await keyVaultManagementClient.Vaults.BeginCreateOrUpdateAsync
(
resourceGroupName,
vaultName,
parameters
);
```

After upgrade:
```csharp
using Azure.Identity;
using Azure.Management.KeyVault;
using Azure.Management.KeyVault.Models;

var keyVaultManagementClient = new KeyVaultManagementClient(
SubscriptionId,
new DefaultAzureCredential(),
new KeyVaultManagementClientOptions());
var vaultsClient = keyVaultManagementClient.GetVaultsClient();

var vault = await vaultsClient.StartCreateOrUpdateAsync(
resourceGroupName,
vaultName,
parameters
);
var vaultValue = (await vault.WaitForCompletionAsync()).Value;

```

#### Object Model Changes

Example: Create a Permissions Model

Before upgrade:
```csharp
var permissions = new Permissions
{
Keys = new string[] { "all" },
Secrets = new string[] { "all" },
Certificates = new string[] { "all" },
Storage = new string[] { "all" },
}
```

After upgrade:
```csharp
var permissions = new Permissions
{
Keys = new [] { new KeyPermissions("all") },
Secrets = new [] { new SecretPermissions("all") },
Certificates = new [] { new CertificatePermissions("all") },
Storage = new [] { new StoragePermissions("all") },
};
```

0 comments on commit 209260a

Please sign in to comment.