Skip to content

Commit 8efe01c

Browse files
liuh-80wyunchi-ms
andauthored
Add cmdlet for IpAllocation resource, and update Vnet/Subnet cmdlet f… (Azure#11585)
* Add cmdlet for IpAllocation resource, and update Vnet/Subnet cmdlet for IpAllocation resource. Co-authored-by: Yunchi Wang <[email protected]>
1 parent 65b4ffc commit 8efe01c

31 files changed

+1737
-58
lines changed

src/CosmosDB/CosmosDB.Test/CosmosDB.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.Test.props" />
66
<ItemGroup>
77
<PackageReference Include="Microsoft.Azure.Management.CosmosDB" Version="1.1.0" />
8-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.19.0-preview" />
8+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.20.0-preview" />
99
</ItemGroup>
1010
</Project>

src/CosmosDB/CosmosDB.Test/SessionRecords/Microsoft.Azure.Commands.CosmosDB.Test.ScenarioTests.ScenarioTest.AccountTests/TestPrivateEndpoint.json

Lines changed: 28 additions & 28 deletions
Large diffs are not rendered by default.

src/Monitor/Monitor.Test/Monitor.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.Monitor" Version="0.25.0-preview" />
1515
<PackageReference Include="Microsoft.Azure.Management.ApplicationInsights" Version="0.2.0-preview" />
16-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.19.0-preview" />
16+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.20.0-preview" />
1717
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.19.0-preview" />
1818
</ItemGroup>
1919

src/Monitor/Monitor.Test/SessionRecords/Microsoft.Azure.Commands.Insights.Test.ScenarioTests.PrivateLinkScopeTests/TestPrivateLinkScopeCRUD.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,8 +1003,8 @@
10031003
"StatusCode": 200
10041004
},
10051005
{
1006-
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2019-12-01",
1007-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDE5LTEyLTAx",
1006+
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2020-03-01",
1007+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDIwLTAzLTAx",
10081008
"RequestMethod": "GET",
10091009
"RequestBody": "",
10101010
"RequestHeaders": {
@@ -1063,8 +1063,8 @@
10631063
"StatusCode": 404
10641064
},
10651065
{
1066-
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2019-12-01",
1067-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDE5LTEyLTAx",
1066+
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2020-03-01",
1067+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDIwLTAzLTAx",
10681068
"RequestMethod": "GET",
10691069
"RequestBody": "",
10701070
"RequestHeaders": {
@@ -1127,8 +1127,8 @@
11271127
"StatusCode": 200
11281128
},
11291129
{
1130-
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2019-12-01",
1131-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDE5LTEyLTAx",
1130+
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2020-03-01",
1131+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDIwLTAzLTAx",
11321132
"RequestMethod": "GET",
11331133
"RequestBody": "",
11341134
"RequestHeaders": {
@@ -1197,8 +1197,8 @@
11971197
"StatusCode": 200
11981198
},
11991199
{
1200-
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2019-12-01",
1201-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDE5LTEyLTAx",
1200+
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2020-03-01",
1201+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDIwLTAzLTAx",
12021202
"RequestMethod": "GET",
12031203
"RequestBody": "",
12041204
"RequestHeaders": {
@@ -1267,8 +1267,8 @@
12671267
"StatusCode": 200
12681268
},
12691269
{
1270-
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2019-12-01",
1271-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDE5LTEyLTAx",
1270+
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2020-03-01",
1271+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDIwLTAzLTAx",
12721272
"RequestMethod": "PUT",
12731273
"RequestBody": "{\r\n \"properties\": {\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"11.0.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"properties\": {\r\n \"addressPrefix\": \"11.0.1.0/24\",\r\n \"addressPrefixes\": [],\r\n \"serviceEndpoints\": [],\r\n \"serviceEndpointPolicies\": [],\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"name\": \"ps1552\"\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": false\r\n },\r\n \"location\": \"eastus2euap\"\r\n}",
12741274
"RequestHeaders": {
@@ -1410,8 +1410,8 @@
14101410
"StatusCode": 200
14111411
},
14121412
{
1413-
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2019-12-01",
1414-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAxOS0xMi0wMQ==",
1413+
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2020-03-01",
1414+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAyMC0wMy0wMQ==",
14151415
"RequestMethod": "GET",
14161416
"RequestBody": "",
14171417
"RequestHeaders": {
@@ -1470,8 +1470,8 @@
14701470
"StatusCode": 404
14711471
},
14721472
{
1473-
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2019-12-01",
1474-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAxOS0xMi0wMQ==",
1473+
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2020-03-01",
1474+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAyMC0wMy0wMQ==",
14751475
"RequestMethod": "GET",
14761476
"RequestBody": "",
14771477
"RequestHeaders": {
@@ -1534,8 +1534,8 @@
15341534
"StatusCode": 200
15351535
},
15361536
{
1537-
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2019-12-01",
1538-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAxOS0xMi0wMQ==",
1537+
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2020-03-01",
1538+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAyMC0wMy0wMQ==",
15391539
"RequestMethod": "GET",
15401540
"RequestBody": "",
15411541
"RequestHeaders": {
@@ -1604,8 +1604,8 @@
16041604
"StatusCode": 200
16051605
},
16061606
{
1607-
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2019-12-01",
1608-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAxOS0xMi0wMQ==",
1607+
"RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2020-03-01",
1608+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAyMC0wMy0wMQ==",
16091609
"RequestMethod": "PUT",
16101610
"RequestBody": "{\r\n \"properties\": {\r\n \"subnet\": {\r\n \"properties\": {\r\n \"addressPrefix\": \"11.0.1.0/24\",\r\n \"addressPrefixes\": [],\r\n \"serviceEndpoints\": [],\r\n \"serviceEndpointPolicies\": [],\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"name\": \"ps1552\",\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953/subnets/ps1552\"\r\n },\r\n \"privateLinkServiceConnections\": [],\r\n \"manualPrivateLinkServiceConnections\": [\r\n {\r\n \"properties\": {\r\n \"privateLinkServiceId\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/microsoft.insights/privatelinkscopes/ps5901\",\r\n \"groupIds\": [\r\n \"azuremonitor\"\r\n ]\r\n },\r\n \"name\": \"ps5042\"\r\n }\r\n ]\r\n },\r\n \"location\": \"eastus2euap\"\r\n}",
16111611
"RequestHeaders": {

src/Network/Network.Test/NrpTeamAlias.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,8 @@ class NrpTeamAlias
5959

6060
// Azure NRP bastion dev team
6161
public const string bastion = "bastion";
62+
63+
// Azure Network IPAM dev team
64+
public const string ipam = "ipamdev";
6265
}
6366
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.Network.Test.ScenarioTests;
16+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
17+
using Xunit;
18+
19+
namespace Commands.Network.Test.ScenarioTests
20+
{
21+
public class IpAllocationTests : NetworkTestRunner
22+
{
23+
public IpAllocationTests(Xunit.Abstractions.ITestOutputHelper output)
24+
: base(output)
25+
{
26+
}
27+
28+
[Fact(Skip = "IpAllocation need manually onboard.")]
29+
[Trait(Category.AcceptanceType, Category.CheckIn)]
30+
[Trait(Category.Owner, NrpTeamAlias.ipam)]
31+
public void TestIpAllocationBasicOperations()
32+
{
33+
TestRunner.RunTestScript(string.Format("Test-IpAllocation"));
34+
}
35+
}
36+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
function Check-CmdletReturnType
16+
{
17+
param($cmdletName, $cmdletReturn)
18+
19+
$cmdletData = Get-Command $cmdletName
20+
Assert-NotNull $cmdletData
21+
[array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") }
22+
[array]$cmdletReturnTypes = $cmdletReturnTypes | Foreach-Object { return ($_ -replace "System.","") }
23+
$realReturnType = $cmdletReturn.GetType().Name -replace "Microsoft.Azure.Commands.Network.Models.",""
24+
return $cmdletReturnTypes -contains $realReturnType
25+
}
26+
27+
<#
28+
.SYNOPSIS
29+
Test creating new IpGroups
30+
#>
31+
function Test-IpAllocation
32+
{
33+
# Setup
34+
$rgname = Get-ResourceGroupName
35+
$rglocation = Get-ProviderLocation ResourceManagement "westus"
36+
$location = Get-ProviderLocation ResourceManagement "westus"
37+
$IpGroupsName = Get-ResourceName
38+
39+
try
40+
{
41+
# IpAllocation resource need manually onboard by subscription
42+
$subId = Get-SubscriptionIdFromResourceGroup $rgname;
43+
$vnetId = '/subscriptions/' + $subId + '/resourceGroups/' + $rgname + '/providers/Microsoft.Network/virtualNetworks/HypernetVnet1';
44+
45+
$ipAllocationName = 'testIpAllocation'
46+
New-AzIpAllocation -ResourceName $ipAllocationName -ResourceGroupName $rgname -Location $rglocation -IpAllocationType Hypernet -PrefixLength 29 -PrefixType IPV4 -IpAllocationTag @{"VNetID"=$vnetId;"SubnetName"="HypernetSubnet1"}
47+
48+
Set-AzIpAllocation -Name $ipAllocationName -ResourceGroupName $rgname -Tag @{'testtag'='tetsvalue'}
49+
50+
Remove-AzIpAllocation -Name $ipAllocationName -ResourceGroupName $rgname
51+
}
52+
finally
53+
{
54+
# Cleanup
55+
Clean-ResourceGroup $rgname
56+
}
57+
}

src/Network/Network/Az.Network.psd1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,12 @@ CmdletsToExport = 'Add-AzApplicationGatewayAuthenticationCertificate',
465465
'Get-AzVirtualRouter', 'Add-AzVirtualRouterPeer',
466466
'Update-AzVirtualRouterPeer', 'Remove-AzVirtualRouterPeer',
467467
'Get-AzVirtualRouterPeer', 'New-AzIpGroup', 'Remove-AzIpGroup',
468-
'Get-AzIpGroup', 'Set-AzIpGroup',
469-
'New-AzIpConfigurationBgpPeeringAddressObject'
468+
'Get-AzIpGroup', 'Set-AzIpGroup',
469+
'New-AzIpConfigurationBgpPeeringAddressObject',
470+
'New-AzIpAllocation',
471+
'Get-AzIpAllocation',
472+
'Remove-AzIpAllocation',
473+
'Set-AzIpAllocation'
470474

471475
# Variables to export from this module
472476
# VariablesToExport = @()

src/Network/Network/ChangeLog.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,25 @@
3737
* Updated cmdlets to enable setting of DPD Timeout on Virtual Network Gateway Connections.
3838
- New-AzVirtualNetworkGatewayConnection
3939
- Set-AzVirtualNetworkGatewayConnection
40+
* Added resource type IpAllocation
41+
* Added properties to Subnet
42+
- Added property 'IpAllocations' as type of PSResourceId to PSIpAllocation
43+
* Added properties to Virtual Network
44+
- Added property 'IpAllocations' as type of PSResourceId to PSIpAllocation
45+
* Added support for IpAllocation resource
46+
- New cmdlet added:
47+
- Get-AzIpAllocation
48+
- New-AzIpAllocation
49+
- Remove-AzIpAllocation
50+
- Get-AzIpAllocation
51+
- Updated `New-AzVirtualNetwork`
52+
- Added another optional parameter IpAllocations to specify the IpAllocation
53+
- Updated `New-AzVirtualNetworkSubnetConfig`
54+
- Added another optional parameter IpAllocations to specify the IpAllocation
55+
- Updated `Set-AzVirtualNetworkSubnetConfig`
56+
- Added another optional parameter IpAllocations to specify the IpAllocation
57+
- Updated `Add-AzVirtualNetworkSubnetConfig`
58+
- Added another optional parameter IpAllocations to specify the IpAllocation
4059

4160
## Version 2.4.0
4261
* Updated cmdlets to allow cross-tenant VirtualHubVnetConnections

src/Network/Network/Common/NetworkResourceManagerProfile.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,10 @@ private static void Initialize()
13231323
// IpGroup
13241324
cfg.CreateMap<CNM.PSIpGroup, MNM.IpGroup>();
13251325
cfg.CreateMap<MNM.IpGroup, CNM.PSIpGroup>();
1326+
1327+
// IpAllocation
1328+
cfg.CreateMap<CNM.PSIpAllocation, MNM.IpAllocation>();
1329+
cfg.CreateMap<MNM.IpAllocation, CNM.PSIpAllocation>();
13261330
});
13271331

13281332
_mapper = config.CreateMapper();

0 commit comments

Comments
 (0)