Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
1 change: 0 additions & 1 deletion src/Network/Network.Test/Network.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<PackageReference Include="Microsoft.Azure.Management.Redis" Version="4.4.1" />
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.19.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.ManagedServiceIdentity" Version="0.10.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Sql" Version="1.37.0-preview" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ protected NetworkTestRunner(ITestOutputHelper output)
helper.GetRMModulePath("AzureRM.Network.psd1"),
helper.GetRMModulePath("AzureRM.Compute.psd1"),
helper.GetRMModulePath("AzureRM.Storage.psd1"),
helper.GetRMModulePath("AzureRM.Sql.psd1"),
helper.GetRMModulePath("AzureRM.ContainerInstance.psd1"),
helper.GetRMModulePath("AzureRM.OperationalInsights.psd1"),
helper.GetRMModulePath("AzureRM.ManagedServiceIdentity.psd1"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function Test-PrivateEndpointConnectionCRUD
# Setup
$rgname = Get-ResourceGroupName;
$rname = Get-ResourceName;
$location = Get-ProviderLocation "Microsoft.Network/privateLinkServices" "eastus2";
$location = Get-ProviderLocation "Microsoft.Network/privateLinkServices" "eastus";
# Dependency parameters
$IpConfigurationName = "IpConfigurationName";
$vnetName = Get-ResourceName;
Expand Down Expand Up @@ -186,12 +186,14 @@ function Test-PrivateEndpointConnectionCRUD
Assert-NotNull $pecApprove;
Assert-AreEqual "Approved" $pecApprove.PrivateLinkServiceConnectionState.Status

Start-TestSleep 30000
Start-TestSleep 20000

# Remove Private Endpoint Connection
$pecRemove = Remove-AzPrivateEndpointConnection -ResourceId $pecGet.Id -PassThru -Force
Assert-AreEqual true $pecRemove

Start-TestSleep 15000

# Get Private Endpoint Connection again
$pecGet2 = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $sqlResourceId
Assert-Null($pecGet2)
Expand Down

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions src/Network/Network.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManagedServiceIdentity", ".
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Storage", "..\Storage\Storage\Storage.csproj", "{A2591FA5-BF93-4358-9097-E6D58FE1DDC4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sql", "..\Sql\Sql\Sql.csproj", "{F5235941-9E3A-4C98-8D69-FBBDD0E8C6F0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Storage.Management", "..\Storage\Storage.Management\Storage.Management.csproj", "{3D03EFA7-4C10-480E-89E3-C2FDF0580AB5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}"
Expand Down Expand Up @@ -76,10 +74,6 @@ Global
{A2591FA5-BF93-4358-9097-E6D58FE1DDC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2591FA5-BF93-4358-9097-E6D58FE1DDC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2591FA5-BF93-4358-9097-E6D58FE1DDC4}.Release|Any CPU.Build.0 = Release|Any CPU
{F5235941-9E3A-4C98-8D69-FBBDD0E8C6F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5235941-9E3A-4C98-8D69-FBBDD0E8C6F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5235941-9E3A-4C98-8D69-FBBDD0E8C6F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5235941-9E3A-4C98-8D69-FBBDD0E8C6F0}.Release|Any CPU.Build.0 = Release|Any CPU
{3D03EFA7-4C10-480E-89E3-C2FDF0580AB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3D03EFA7-4C10-480E-89E3-C2FDF0580AB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D03EFA7-4C10-480E-89E3-C2FDF0580AB5}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
3 changes: 1 addition & 2 deletions src/Network/Network/Az.Network.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ DotNetFrameworkVersion = '4.7.2'
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '1.7.3'; })

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'AutoMapper.dll', 'Microsoft.Azure.Management.Network.dll',
'Microsoft.Azure.Management.Sql.dll'
RequiredAssemblies = 'AutoMapper.dll', 'Microsoft.Azure.Management.Network.dll'

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
Expand Down
1 change: 1 addition & 0 deletions src/Network/Network/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Update-AzVirtualHubVnetConnection
- New-AzVirtualHub
- Update-AzVirtualHub
* Removed Sql Management SDK dependency

## Version 2.3.2
* Updated Sql Management SDK.
Expand Down
19 changes: 0 additions & 19 deletions src/Network/Network/Common/NetworkClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@

using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
using Microsoft.Azure.Commands.Common.Authentication.Models;
using Microsoft.Azure.Management.Network;
using Microsoft.Azure.Management.Network.Models;
using Microsoft.Azure.Management.Sql;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Newtonsoft.Json;
Expand All @@ -37,23 +35,6 @@ public partial class NetworkClient
{
public INetworkManagementClient NetworkManagementClient { get; set; }

public ISqlManagementClient SqlManagementClient
{
get
{
if (sqlManagementClient == null)
{
sqlManagementClient = AzureSession.Instance.ClientFactory.CreateArmClient<SqlManagementClient>(azureContext, AzureEnvironment.Endpoint.ResourceManager);
}
return sqlManagementClient;
}
set
{
sqlManagementClient = value;
}
}
private ISqlManagementClient sqlManagementClient = null;

private IAzureContext azureContext;

public Action<string> VerboseLogger { get; set; }
Expand Down
1 change: 0 additions & 1 deletion src/Network/Network/Network.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<ItemGroup>
<PackageReference Include="AutoMapper" Version="6.2.2" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.19.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Sql" Version="1.41.0-preview" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.Network.Models;
using Microsoft.Azure.Commands.Network.Models;
using Microsoft.Azure.Management.Network;
using System.Collections.Generic;
using System.Management.Automation;
using Microsoft.Azure.Management.Network.Models;
using Microsoft.Rest.Azure;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;


namespace Microsoft.Azure.Commands.Network
{
Expand Down Expand Up @@ -75,7 +75,7 @@ public override void Execute()
}
else
{
IPage<PrivateLinkService> plsPage;
IPage<Microsoft.Azure.Management.Network.Models.PrivateLinkService> plsPage;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: suggest to use using namespace

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

using this one now.
using NM = Microsoft.Azure.Management.Network.Models;

if (ShouldListByResourceGroup(ResourceGroupName, Name))
{
plsPage = this.PrivateLinkServiceClient.List(this.ResourceGroupName);
Expand All @@ -86,7 +86,7 @@ public override void Execute()
}


var plsList = ListNextLink<PrivateLinkService>.GetAllResourcesByPollingNextLink(plsPage, this.PrivateLinkServiceClient.ListNext);
var plsList = ListNextLink<Microsoft.Azure.Management.Network.Models.PrivateLinkService>.GetAllResourcesByPollingNextLink(plsPage, this.PrivateLinkServiceClient.ListNext);
var psPLSs = new List<PSPrivateLinkService>();
foreach (var pls in plsList)
{
Expand Down
56 changes: 56 additions & 0 deletions src/Network/Network/PrivateLinkService/Models/Page.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Rest.Azure;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.Network.PrivateLinkService.Models
{
/// <summary>
/// Defines a page in Azure responses.
/// </summary>
/// <typeparam name="T">Type of the page content items</typeparam>
[JsonObject]
public class Page<T> : IPage<T>
{
/// <summary>
/// Gets the link to the next page.
/// </summary>
[JsonProperty("nextLink")]
public string NextPageLink { get; private set; }

[JsonProperty("value")]
private List<T> Items { get; set; }

/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>A an enumerator that can be used to iterate through the collection.</returns>
public IEnumerator<T> GetEnumerator()
{
return Items == null ? System.Linq.Enumerable.Empty<T>().GetEnumerator() : Items.GetEnumerator();
}

/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>A an enumerator that can be used to iterate through the collection.</returns>
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Newtonsoft.Json;

namespace Microsoft.Azure.Commands.Network.PrivateLinkService.Models
{
/// <summary>
/// A private endpoint connection
/// </summary>
[Rest.Serialization.JsonTransformation]
public partial class PrivateEndpointConnection : ProxyResource
{
/// <summary>
/// Initializes a new instance of the PrivateEndpointConnection class.
/// </summary>
public PrivateEndpointConnection()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the PrivateEndpointConnection class.
/// </summary>
/// <param name="id">Resource ID.</param>
/// <param name="name">Resource name.</param>
/// <param name="type">Resource type.</param>
/// <param name="privateEndpoint">Private endpoint which the connection
/// belongs to.</param>
/// <param name="privateLinkServiceConnectionState">Connection state of
/// the private endpoint connection.</param>
/// <param name="provisioningState">State of the private endpoint
/// connection.</param>
public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), PrivateEndpointProperty privateEndpoint = default(PrivateEndpointProperty), PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionStateProperty), string provisioningState = default(string))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: usually we use null as default value for reference object instead of default(xxx), I guess this is generated code, so should be fine.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

copied from generated code.

: base(id, name, type)
{
PrivateEndpoint = privateEndpoint;
PrivateLinkServiceConnectionState = privateLinkServiceConnectionState;
ProvisioningState = provisioningState;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets private endpoint which the connection belongs to.
/// </summary>
[JsonProperty(PropertyName = "properties.privateEndpoint")]
public PrivateEndpointProperty PrivateEndpoint { get; set; }

/// <summary>
/// Gets or sets connection state of the private endpoint connection.
/// </summary>
[JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")]
public PrivateLinkServiceConnectionStateProperty PrivateLinkServiceConnectionState { get; set; }

/// <summary>
/// Gets state of the private endpoint connection.
/// </summary>
[JsonProperty(PropertyName = "properties.provisioningState")]
public string ProvisioningState { get; private set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (PrivateLinkServiceConnectionState != null)
{
PrivateLinkServiceConnectionState.Validate();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Rest.Azure;
using Newtonsoft.Json;

namespace Microsoft.Azure.Commands.Network.PrivateLinkService.Models
{
public partial class PrivateEndpointProperty : IResource
{
/// <summary>
/// Initializes a new instance of the PrivateEndpointProperty class.
/// </summary>
public PrivateEndpointProperty()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the PrivateEndpointProperty class.
/// </summary>
/// <param name="id">Resource id of the private endpoint.</param>
public PrivateEndpointProperty(string id = default(string))
{
Id = id;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets resource id of the private endpoint.
/// </summary>
[JsonProperty(PropertyName = "id")]
public string Id { get; set; }

}
}
Loading