Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update change log for KeyVault track 2 mgmt sdk #12272

Merged
merged 4 commits into from
Jun 8, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 84 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,87 @@

## 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
erich-wang marked this conversation as resolved.
Show resolved Hide resolved
- HTTP pipeline with custom policies
- Better Error-handling
- Support uniform telemetry across all languages

erich-wang marked this conversation as resolved.
Show resolved Hide resolved
> 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 Instace:
erich-wang marked this conversation as resolved.
Show resolved Hide resolved

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: SubscriptionId on separate line

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 KeyPermissions[] { new KeyPermissions("all") },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think keys = new [] { } should be sufficient.

Secrets = new SecretPermissions[] { new SecretPermissions("all") },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, does KeyPremissions has a constant value declared for "all" btw?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately no for "all", there're constant values for individuals, e.g. SecretPermissions.Purge, SecretPermissions.List

Certificates = new CertificatePermissions[] { new CertificatePermissions("all") },
Storage = new StoragePermissions[] { new StoragePermissions("all") },
};
```