Skip to content

Commit

Permalink
prepare release network (Azure#25001)
Browse files Browse the repository at this point in the history
* prepare release network

* remove unused field
  • Loading branch information
m-nash authored Oct 28, 2021
1 parent 8a12057 commit 55e8e56
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 28 deletions.
55 changes: 28 additions & 27 deletions sdk/network/Azure.ResourceManager.Network/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Release History

## 1.0.0-beta.3 (Unreleased)

### Features Added
## 1.0.0-beta.3 (2021-10-28)

### Breaking Changes

### Bugs Fixed

### Other Changes
- Renamed [Resource]Container to [Resource]Collection and added the IEnumerable<T> and IAsyncEnumerable<T> interfaces to them making it easier to iterate over the list in the simple case.

## 1.0.0-beta.2 (2021-09-14)

Expand Down Expand Up @@ -42,7 +38,7 @@ Example: Create a VNet:

Before upgrade:

```csharp
```C#
using Microsoft.Azure.Management.Network;
using Microsoft.Azure.Management.Network.Models;
using Microsoft.Rest;
Expand Down Expand Up @@ -72,27 +68,32 @@ vnet = await networkClient.VirtualNetworks

After upgrade:

```csharp
using Azure.Core;
```C# Snippet:Changelog_NewCode
using System;
using Azure.Identity;
using Azure.ResourceManager.Network;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;

var armClient = new ArmClient(new DefaultAzureCredential());
var resourceGroup = (await armClient.DefaultSubscription.GetResourceGroups().GetAsync("abc")).Value;
var virtualNetworkContainer = resourceGroup.GetVirtualNetworks();
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
Subscription subscription = await armClient.GetDefaultSubscriptionAsync();
ResourceGroup resourceGroup = await subscription.GetResourceGroups().GetAsync("abc");
VirtualNetworkCollection virtualNetworkContainer = resourceGroup.GetVirtualNetworks();

// Create VNet
var vnet = new VirtualNetworkData()
VirtualNetworkData vnet = new VirtualNetworkData()
{
Location = "westus",
};
vnet.AddressSpace.AddressPrefixes.Add("10.0.0.0/16");
vnet.Subnets.Add(new SubnetData {
vnet.Subnets.Add(new SubnetData
{
Name = "mySubnet",
AddressPrefix = "10.0.0.0/24",
});

var virtualNetwork = (await virtualNetworkContainer.CreateOrUpdateAsync("_vent", vnet)).Value;
VirtualNetworkCreateOrUpdateOperation vnetOperation = await virtualNetworkContainer.CreateOrUpdateAsync("_vent", vnet);
VirtualNetwork virtualNetwork = vnetOperation.Value;
```

#### Object Model Changes
Expand All @@ -101,7 +102,7 @@ Example: Create a IpsecPolicy Model

Before upgrade:

```csharp
```C#
var policy = new IpsecPolicy()
{
SaLifeTimeSeconds = 300,
Expand All @@ -117,14 +118,14 @@ var policy = new IpsecPolicy()

After upgrade:

```csharp
var policy = new IpsecPolicy(
300,
1024,
IpsecEncryption.AES128,
IpsecIntegrity.SHA256,
IkeEncryption.AES192,
IkeIntegrity.SHA1,
DhGroup.DHGroup2,
PfsGroup.PFS1)
```C# Snippet:Changelog_CreateModel
IpsecPolicy policy = new IpsecPolicy(
300,
1024,
IpsecEncryption.AES128,
IpsecIntegrity.SHA256,
IkeEncryption.AES192,
IkeIntegrity.SHA1,
DhGroup.DHGroup2,
PfsGroup.PFS1);
```
2 changes: 1 addition & 1 deletion sdk/network/Azure.ResourceManager.Network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur
Install the Azure Network management library for .NET with [NuGet](https://www.nuget.org/):

```PowerShell
Install-Package Azure.ResourceManager.Network -Version 1.0.0-beta.1
Install-Package Azure.ResourceManager.Network -Version 1.0.0-beta.3
```

### Prerequisites
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#region Snippet:Changelog_NewCode
using System;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;

#if !SNIPPET
using System.Threading.Tasks;
using NUnit.Framework;

namespace Azure.ResourceManager.Network.Tests.Samples
{
public 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("abc");
VirtualNetworkCollection virtualNetworkContainer = resourceGroup.GetVirtualNetworks();

// Create VNet
VirtualNetworkData vnet = new VirtualNetworkData()
{
Location = "westus",
};
vnet.AddressSpace.AddressPrefixes.Add("10.0.0.0/16");
vnet.Subnets.Add(new SubnetData
{
Name = "mySubnet",
AddressPrefix = "10.0.0.0/24",
});

VirtualNetworkCreateOrUpdateOperation vnetOperation = await virtualNetworkContainer.CreateOrUpdateAsync("_vent", vnet);
VirtualNetwork virtualNetwork = vnetOperation.Value;
#endregion
}

[Test]
[Ignore("Only verifying that the sample builds")]
public void CreateModel()
{
#region Snippet:Changelog_CreateModel
IpsecPolicy policy = new IpsecPolicy(
300,
1024,
IpsecEncryption.AES128,
IpsecIntegrity.SHA256,
IkeEncryption.AES192,
IkeIntegrity.SHA1,
DhGroup.DHGroup2,
PfsGroup.PFS1);
#endregion
}
}
}

0 comments on commit 55e8e56

Please sign in to comment.