github Azure/azure-sdk-for-net Azure.ResourceManager.Storage_1.0.0-beta.1

latest releases: Azure.AI.Translation.Document_2.0.0, Azure.Storage.Blobs.Batch_12.20.0, Azure.Storage.Files.DataLake_12.21.0...
pre-release3 years ago

1.0.0-beta.1 (2021-09-01)

This package follows the Azure SDK Design Guidelines for .NET 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.

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

Package Name

The package name has been changed from Microsoft.Azure.Management.Storage to Azure.ResourceManager.Storage

Management Client Changes

Example: Create a storage account:

Before upgrade:

using Microsoft.Azure.Management.Storage;
using Microsoft.Azure.Management.Storage.Models;
using Microsoft.Rest;

var credentials = new TokenCredentials("YOUR ACCESS TOKEN");
var storageManagementClient = new StorageManagementClient(credentials);
storageManagementClient.SubscriptionId = subscriptionId;

StorageAccountCreateParameters parameters = new StorageAccountCreateParameters
{
    Location = "westus",
    Tags = new Dictionary<string, string>
            {
                {"key1","value1"},
                {"key2","value2"}
            },
    Sku = new Sku { Name = SkuName.StandardGRS },
    Kind = Kind.Storage,
};
storageManagementClient.StorageAccounts.Create(resourceGroupName, accountName, parameters);

After upgrade:

using System.Collections.Generic;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Storage.Models;
string accountName = "myaccount";
string resourceGropuName = "myResourceGroup";
ArmClient client = new ArmClient(new DefaultAzureCredential());
ResourceGroup resourceGroup = client.DefaultSubscription.GetResourceGroups().Get(resourceGropuName);
StorageAccountContainer storageAccountContainer = resourceGroup.GetStorageAccounts();
Sku sku = new Sku(SkuName.PremiumLRS);
StorageAccountCreateParameters parameters = new StorageAccountCreateParameters(new Sku(SkuName.StandardGRS), Kind.Storage, Location.WestUS);
parameters.Tags.Add("key1", "value1");
parameters.Tags.Add("key2", "value2");
StorageAccount account = storageAccountContainer.CreateOrUpdate(accountName, parameters).Value;

Object Model Changes

Example: Create one Encryption Model

Before upgrade:

var encryption = new Encryption()
     {
         Services = new EncryptionServices { Blob = new EncryptionService { Enabled = true }, File = new EncryptionService { Enabled = true } },
         KeySource = KeySource.MicrosoftStorage
     };

After upgrade:

var encryption = new Encryption(KeySource.MicrosoftStorage)
    {
        Services = new EncryptionServices { Blob = new EncryptionService { Enabled = true }, File = new EncryptionService { Enabled = true } }
    };

Don't miss a new azure-sdk-for-net release

NewReleases is sending notifications on new releases.