Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7fdc43d
Update to lastest FrontDoor Nuget Package version
jessicl-ms Apr 3, 2020
a0f3e1e
Add private link to backend properties and add new rules engine PS ob…
jessicl-ms Apr 6, 2020
02c0ebc
Rename cmdlet files
jessicl-ms Apr 6, 2020
edf8e39
Update psObject <-> sdkObject converters
jessicl-ms Apr 6, 2020
a579549
Implement New-AzFrontDoorRulesEngine
jessicl-ms Apr 6, 2020
f7de47d
Implement Get-AzFrontDoorRulesEngine
jessicl-ms Apr 7, 2020
3dae189
Implement Set-AzFrontDoorRulesEngine
jessicl-ms Apr 7, 2020
e424a52
Implement New-AzFrontDoorRulesEngineRuleObject
jessicl-ms Apr 7, 2020
c46f5c3
And and implement helper cmdlets
jessicl-ms Apr 7, 2020
729e506
Update cmdlets
jessicl-ms Apr 7, 2020
206e440
Update New-AzFrontDoorRoutingRulesObject
jessicl-ms Apr 7, 2020
5252c42
Update and add cmdlet documentation; clean up code
jessicl-ms Apr 7, 2020
ec7cba9
Remove unnecessary PSArgCompleter
jessicl-ms Apr 16, 2020
91fb0f6
Update ChangeLog.md and module version
jessicl-ms Apr 16, 2020
caf75a1
Update scenario tests records
jessicl-ms Apr 22, 2020
33506a8
Small fix
jessicl-ms Apr 22, 2020
1eebd22
Add online version link for new cmdlets
jessicl-ms Apr 22, 2020
275bbac
Small fix
jessicl-ms Apr 22, 2020
7353cc1
Fix build error
jessicl-ms Apr 23, 2020
01bd4e4
Fix .md file
jessicl-ms Apr 23, 2020
9b29db8
Remove argument naming
jessicl-ms Apr 24, 2020
ca4632b
Fix SharedAssemblyConflict.csv by removing ref to Microsoft.Rest.Clie…
jessicl-ms Apr 24, 2020
8ba948b
Disable unrelated scenario test.
jessicl-ms Apr 29, 2020
64b8eb0
Address static anlysis errors
jessicl-ms Apr 30, 2020
8db94fa
Add exceptions to static analysis for rules engine cmdlets
jessicl-ms Apr 30, 2020
9568dcf
Add other exceptions
jessicl-ms May 1, 2020
4e95be4
More static analysis error exception
jessicl-ms May 1, 2020
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/FrontDoor/FrontDoor.Test/FrontDoor.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.FrontDoor" Version="2.0.0" />
<PackageReference Include="Microsoft.Azure.Management.FrontDoor" Version="2.1.0" />
</ItemGroup>

</Project>
13 changes: 6 additions & 7 deletions src/FrontDoor/FrontDoor.Test/ScenarioTests/FrontDoorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.FrontDoor.Test.ScenarioTests.ScenarioTest;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;

Expand Down Expand Up @@ -49,12 +48,12 @@ public void TestFrontDoorCrudWithPiping()
TestController.NewInstance.RunPowerShellTest(_logger, "Test-FrontDoorCrudWithPiping");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestFrontDoorEndpointCustomDomainHTTPSFrontDoor()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-FrontDoorEndpointCustomDomainHTTPS-FrontDoor");
}
//[Fact]
//[Trait(Category.AcceptanceType, Category.CheckIn)]
//public void TestFrontDoorEndpointCustomDomainHTTPSFrontDoor()
//{
// TestController.NewInstance.RunPowerShellTest(_logger, "Test-FrontDoorEndpointCustomDomainHTTPS-FrontDoor");
//}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
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.

14 changes: 11 additions & 3 deletions src/FrontDoor/FrontDoor/Az.FrontDoor.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# RootModule = ''

# Version number of this module.
ModuleVersion = '1.4.0'
ModuleVersion = '1.5.0'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
Expand Down Expand Up @@ -53,7 +53,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '1.7.4'; })
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '1.7.5'; })

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'Microsoft.Azure.Management.FrontDoor.dll'
Expand Down Expand Up @@ -92,7 +92,15 @@ CmdletsToExport = 'New-AzFrontDoor', 'Get-AzFrontDoor', 'Set-AzFrontDoor',
'Disable-AzFrontDoorCustomDomainHttps',
'Get-AzFrontDoorFrontendEndpoint',
'New-AzFrontDoorWafManagedRuleOverrideObject',
'New-AzFrontDoorWafManagedRuleExclusionObject'
'New-AzFrontDoorWafManagedRuleExclusionObject',
'New-AzFrontDoorRulesEngine',
'New-AzFrontDoorRulesEngineRuleObject',
'New-AzFrontDoorRulesEngineActionObject',
'New-AzFrontDoorHeaderActionObject',
'New-AzFrontDoorRulesEngineMatchConditionObject',
'Get-AzFrontDoorRulesEngine',
'Set-AzFrontDoorRulesEngine',
'Remove-AzFrontDoorRulesEngine'

# Variables to export from this module
# VariablesToExport = @()
Expand Down
6 changes: 6 additions & 0 deletions src/FrontDoor/FrontDoor/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
-->
## Upcoming Release

## Version 1.5.0
* Add new cmdlets for creation, update, retreival, and deletion of Front Door Rules Engine object
* Add helper cmdlets for construction of Front Door Rules Engine object
* Add Rules Engine reference to Front Door Routing Rule object.
* Add Private Link parameters to Front Door Backend object

## Version 1.4.0
* Added cmdlet to get managed rule definitions that can be used in WAF

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,22 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Management.Automation;
using System.Net;
using Microsoft.Azure.Commands.FrontDoor.Common;
using Microsoft.Azure.Commands.FrontDoor.Helpers;
using Microsoft.Azure.Commands.FrontDoor.Models;
using Microsoft.Azure.Commands.FrontDoor.Properties;
using Microsoft.Azure.Management.FrontDoor;
using System.Linq;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.FrontDoor;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
{
/// <summary>
/// Defines the Enable-AzCustomDomainHttps cmdlet.
/// </summary>
[Cmdlet("Disable", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoorCustomDomainHttps", SupportsShouldProcess = true, DefaultParameterSetName = FieldsParameterSet), OutputType(typeof(PSFrontendEndpoint))]
public class DisableAzureRmFrontDoorCustomDomainHttps : AzureFrontDoorCmdletBase
public class DisableFrontDoorCustomDomainHttps : AzureFrontDoorCmdletBase
{
/// <summary>
/// The resource group to which the Front Door belongs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
/// Defines the Enable-AzCustomDomainHttps cmdlet.
/// </summary>
[Cmdlet("Enable", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoorCustomDomainHttps", SupportsShouldProcess = true, DefaultParameterSetName = FieldsParameterSet), OutputType(typeof(PSFrontendEndpoint))]
public class EnableAzureRmFrontDoorCustomDomainHttps : AzureFrontDoorCmdletBase
public class EnableFrontDoorCustomDomainHttps : AzureFrontDoorCmdletBase
{
/// <summary>
/// The resource group to which the Front Door belongs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,22 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Management.Automation;
using System.Net;
using Microsoft.Azure.Commands.FrontDoor.Common;
using Microsoft.Azure.Commands.FrontDoor.Helpers;
using Microsoft.Azure.Commands.FrontDoor.Models;
using Microsoft.Azure.Commands.FrontDoor.Properties;
using Microsoft.Azure.Management.FrontDoor;
using System.Linq;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using System.Management.Automation;
using System.Net;

namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
{
/// <summary>
/// Defines the Get-AzFrontDoor cmdlet.
/// </summary>
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoor"), OutputType(typeof(PSFrontDoor))]
public class GetAzureRmFrontDoor : AzureFrontDoorCmdletBase
public class GetFrontDoor : AzureFrontDoorCmdletBase
{
/// <summary>
/// The resource group name of the Front Door.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,23 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Management.Automation;
using System.Net;
using Microsoft.Azure.Commands.FrontDoor.Common;
using Microsoft.Azure.Commands.FrontDoor.Helpers;
using Microsoft.Azure.Commands.FrontDoor.Models;
using Microsoft.Azure.Commands.FrontDoor.Properties;
using Microsoft.Azure.Management.FrontDoor;
using System.Linq;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.FrontDoor;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using System.Linq;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
{
/// <summary>
/// Defines the Get-FrontDoorFrontendEndpoint cmdlet.
/// </summary>
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoorFrontendEndpoint", DefaultParameterSetName = FieldsParameterSet), OutputType(typeof(PSFrontendEndpoint))]
public class GetAzureRmFrontDoorFrontendEndpoint : AzureFrontDoorCmdletBase
public class GetFrontDoorFrontendEndpoint : AzureFrontDoorCmdletBase
{
/// <summary>
/// The resource group name of the Front Door.
Expand Down Expand Up @@ -73,13 +70,13 @@ public class GetAzureRmFrontDoorFrontendEndpoint : AzureFrontDoorCmdletBase

public override void ExecuteCmdlet()
{
if(ParameterSetName == ObjectParameterSet)
if (ParameterSetName == ObjectParameterSet)
{
ResourceIdentifier identifier = new ResourceIdentifier(FrontDoorObject.Id);
ResourceGroupName = identifier.ResourceGroupName;
FrontDoorName = identifier.ResourceName;
}
else if(ParameterSetName == ResourceIdParameterSet)
else if (ParameterSetName == ResourceIdParameterSet)
{
ResourceIdentifier identifier = new ResourceIdentifier(ResourceId);
if (!ResourceIdentifierExtensions.IsFrontendEndpointResourceType(identifier))
Expand Down
94 changes: 94 additions & 0 deletions src/FrontDoor/FrontDoor/Cmdlets/GetFrontDoorRulesEngine.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// ----------------------------------------------------------------------------------
//
// 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.Azure.Commands.FrontDoor.Common;
using Microsoft.Azure.Commands.FrontDoor.Helpers;
using Microsoft.Azure.Commands.FrontDoor.Models;
using Microsoft.Azure.Commands.FrontDoor.Properties;
using Microsoft.Azure.Management.FrontDoor;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System.Collections.Generic;
using System.Management.Automation;
using System.Net;

namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
{
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoor" + "RulesEngine"), OutputType(typeof(PSRulesEngine))]
public class GetFrontDoorRulesEngine : AzureFrontDoorCmdletBase
{
[Parameter(Mandatory = true, HelpMessage = "The resource group name that the Front Door will be created in.")]
[ValidateNotNullOrEmpty]
public string ResourceGroupName { get; set; }

[Parameter(Mandatory = true, HelpMessage = "Front Door name.")]
[ValidateNotNullOrEmpty]
public string FrontDoorName { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Rules engine name.")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

public override void ExecuteCmdlet()
{
if (this.IsParameterBound(c => c.Name))
{
// Retrieve specified Rules Engine
try
{
var rulesEngine = FrontDoorManagementClient.RulesEngines.Get(ResourceGroupName, FrontDoorName, Name);
WriteObject(rulesEngine.ToPSRulesEngine());
}
catch (Microsoft.Azure.Management.FrontDoor.Models.ErrorResponseException e)
{
if (e.Response.StatusCode.Equals(HttpStatusCode.NotFound))
{
throw new PSArgumentException(string.Format(Resources.Error_RulesEngineNotFound,
Name,
FrontDoorName));
}
}
}
else
{
// Retrieve all Rules Engines for specified FrontDoor
try
{
List<PSRulesEngine> allRulesEngines = new List<PSRulesEngine>();
string nextPageLink;
do
{
var pageResult = FrontDoorManagementClient.RulesEngines.ListByFrontDoor(ResourceGroupName, FrontDoorName);
foreach (var rulesEngine in pageResult)
{
allRulesEngines.Add(rulesEngine.ToPSRulesEngine());
}
nextPageLink = pageResult.NextPageLink;
}
while (!string.IsNullOrEmpty(nextPageLink));

WriteObject(allRulesEngines);
}
catch (Microsoft.Azure.Management.FrontDoor.Models.ErrorResponseException e)
{
if (e.Response.StatusCode.Equals(HttpStatusCode.NotFound))
{
throw new PSArgumentException(string.Format(Resources.Error_RulesEngineNotFound,
Name,
FrontDoorName));
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
/// Defines the Get-AzFrontDoorWafManagedRuleSetDefinition cmdlet.
/// </summary>
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoorWafManagedRuleSetDefinition"), OutputType(typeof(PSManagedRuleSetDefinition))]
public class GetAzureRmFrontDoorWafManagedRuleSetDefinition : AzureFrontDoorCmdletBase
public class GetFrontDoorWafManagedRuleSetDefinition : AzureFrontDoorCmdletBase
{
public override void ExecuteCmdlet()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
/// Defines the Get-AzFrontDoorFireWallPolicy cmdlet.
/// </summary>
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoorWafPolicy"), OutputType(typeof(PSPolicy))]
public class GetAzureRmFrontDoorWafPolicy : AzureFrontDoorCmdletBase
public class GetFrontDoorWafPolicy : AzureFrontDoorCmdletBase
{
/// <summary>
/// The resource group name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
/// Defines the New-AzFrontDoor cmdlet.
/// </summary>
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoor", DefaultParameterSetName = FieldsWithBackendPoolsSettingParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSFrontDoor))]
public class NewAzureRmFrontDoor : AzureFrontDoorCmdletBase
public class NewFrontDoor : AzureFrontDoorCmdletBase
{
/// <summary>
/// The resource group name of the Front Door.
Expand Down Expand Up @@ -107,7 +107,7 @@ public override void ExecuteCmdlet()

if (existingProfile.Count() != 0)
{
throw new PSArgumentException(string.Format(Resources.Error_CreateExistingFrontDoor,
throw new PSArgumentException(string.Format(Resources.Error_CreateExistingFrontDoor,
Name,
ResourceGroupName));
}
Expand All @@ -116,16 +116,16 @@ public override void ExecuteCmdlet()
switch (ParameterSetName)
{
case FieldsWithCertificateNameCheckParameterSet:
{
backendPoolsSettings = new Management.FrontDoor.Models.BackendPoolsSettings(
DisableCertificateNameCheck ? PSEnforceCertificateNameCheck.Disabled.ToString() : PSEnforceCertificateNameCheck.Enabled.ToString());
break;
}
{
backendPoolsSettings = new Management.FrontDoor.Models.BackendPoolsSettings(
DisableCertificateNameCheck ? PSEnforceCertificateNameCheck.Disabled.ToString() : PSEnforceCertificateNameCheck.Enabled.ToString());
break;
}
default:
{
backendPoolsSettings = BackendPoolsSetting?.ToSdkBackendPoolsSettings();
break;
}
{
backendPoolsSettings = BackendPoolsSetting?.ToSdkBackendPoolsSettings();
break;
}
}

var updateParameters = new Management.FrontDoor.Models.FrontDoorModel(
Expand Down
Loading