Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/Network/Network.Test/Network.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.1-preview" />
<PackageReference Include="Microsoft.Azure.Insights" Version="0.16.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="36.0.0" />
<PackageReference Include="Microsoft.Azure.Management.ContainerInstance" Version="2.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ function Test-LoadBalancerBackendAddressConfig

Assert-AreEqual $ipconfig1.Name $backendAddressConfigName1
Assert-AreEqual $ipconfig1.IpAddress $validIpAddress
Assert-AreEqual $ipconfig1.VirtualNetwork.Id $virtualNetwork.Id
Assert-AreEqual $ipconfig1.VirtualNetworkId.Id $virtualNetwork.Id

Assert-ThrowsLike { New-AzLoadBalancerBackendAddressConfig -IpAddress $invalidIpAddress2 -Name $backendAddressConfigName1 -VirtualNetworkId $virtualNetwork.Id} "*Invalid IPAddress*"

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public override void Execute()

var loadBalancerBackendAddress = new PSLoadBalancerBackendAddress();

loadBalancerBackendAddress.VirtualNetwork = new PSVirtualNetwork {
loadBalancerBackendAddress.VirtualNetworkId = new PSResourceId {
Id = VirtualNetworkId
};

Expand Down
16 changes: 4 additions & 12 deletions src/Network/Network/Models/PSLoadBalancerBackendAddress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,26 @@ public partial class PSLoadBalancerBackendAddress : PSChildResource
{
[JsonProperty(Order = 1)]
[Ps1Xml(Target = ViewControl.Table)]
public PSNetworkInterfaceIPConfiguration NetworkInterfaceIpConfiguration { get; set; }
public PSResourceId NetworkInterfaceIpConfigurationId { get; set; }

[JsonProperty(Order = 2)]
public PSVirtualNetwork VirtualNetwork { get; set; }
public PSResourceId VirtualNetworkId { get; set; }

[JsonProperty(Order = 3)]
public string IpAddress { get; set; }

[JsonIgnore]
public string NetworkInterfaceIpConfigurationText
{
get { return JsonConvert.SerializeObject(NetworkInterfaceIpConfiguration, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
get { return JsonConvert.SerializeObject(NetworkInterfaceIpConfigurationId, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
}

[JsonIgnore]
public string VirtualNetworkChildResourceText
{
get
{
// convert to child resource object to limit size of the output seen on the powershell console
var virtualNetworkChildResource = new PSChildResource
{
Name = VirtualNetwork?.Name,
Id = VirtualNetwork?.Id,
Etag = VirtualNetwork?.Etag
};

return JsonConvert.SerializeObject(virtualNetworkChildResource, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore });
return JsonConvert.SerializeObject(VirtualNetworkId, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore });
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Network/Network/Network.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="AutoMapper" Version="6.2.2" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.1-preview" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Network/Network/Network.format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -2526,11 +2526,11 @@
<PropertyName>IpAddress</PropertyName>
</ListItem>
<ListItem>
<Label>NetworkInterfaceIpConfiguration</Label>
<Label>NetworkInterfaceIpConfigurationId</Label>
<PropertyName>NetworkInterfaceIpConfigurationText</PropertyName>
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we change this to NetworkInterfaceIpConfigurationIdText?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, that label is what is printed on the powershell console. I think it would read kind of weird to add 'text' to the output console

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as the other comment.

</ListItem>
<ListItem>
<Label>VirtualNetwork</Label>
<Label>VirtualNetworkId</Label>
<PropertyName>VirtualNetworkChildResourceText</PropertyName>
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be VirtualNetworkIdText

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, that label is what is printed on the powershell console. I think it would read kind of weird to add 'text' to the output console

Copy link
Contributor Author

@aegal aegal Jun 11, 2020

Choose a reason for hiding this comment

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

Ohh sorry, you referring to VirtualNetworkChildResourceText property. Yeah that property name it isn't visible but I can update that for code readability.

</ListItem>
</ListItems>
Expand Down