Skip to content

Conversation

@gdhillon24
Copy link
Contributor

@gdhillon24 gdhillon24 commented Jun 14, 2022

Description

PS cmdlets for application gateway L4 properties -> Added new comdlets for Listeners , BackendSettings, RoutingRules
Modified cmdlets.
New-AzApplicationGateway , Set-AzApplicationGatewayProbeConfig ,Add-AzApplicationGatewayProbeConfig ,New-AzApplicationGatewayProbeConfig

Checklist

Add models and properties for TLS proxy
Add new ps cmdlets for TLS proxy
@gdhillon24 gdhillon24 changed the title Gdhillon app gw tls proxy PS cmdlets for application gateway L4 properties Jun 14, 2022
@VeryEarly VeryEarly self-assigned this Jun 14, 2022

namespace Microsoft.Azure.Commands.Network
{
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationGatewayBackendSetting"), OutputType(typeof(PSApplicationGatewayBackendSettings))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

this cmdlet will return ID like:
/subscriptions/{0}/resourceGroups/ResourceGroupNotSet/providers/Microsoft.Network/applicationGateways/ApplicationGatewayNameNotSet/{3}/{4}
can you please clarify in help message

Copy link
Contributor Author

Choose a reason for hiding this comment

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

New-AzApplicationGatewayBackendSetting it returns a PSApplicationGatewayBackendSettings Object
image

@VeryEarly
Copy link
Collaborator

It seems like backend setting related cmdlets only manipulate the in-memory PSApplicationGateway object without sending any request except Add-AzApplicationGatewayBackendSetting, can you please confirm why these cmdlets are needed.

@gdhillon24
Copy link
Contributor Author

It seems like backend setting related cmdlets only manipulate the in-memory PSApplicationGateway object without sending any request except Add-AzApplicationGatewayBackendSetting, can you please confirm why these cmdlets are needed.

Basically, the workflow to update BackendSettings would require to fetch the application gateway object and then use the new cmdlets to modify the backend settings in the application gateway object and at last update the Application Gateway Object using Set-AzApplicationGateway.

Same is true for Listeners and RoutingRules.

@gdhillon24
Copy link
Contributor Author

gdhillon24 commented Jun 15, 2022

It seems like backend setting related cmdlets only manipulate the in-memory PSApplicationGateway object without sending any request except Add-AzApplicationGatewayBackendSetting, can you please confirm why these cmdlets are needed.

Basically, the workflow to update BackendSettings would require to fetch the application gateway object and then use the new cmdlets to modify the backend settings in the application gateway object and at last update the Application Gateway Object using Set-AzApplicationGateway.

Same is true for Listeners and RoutingRules.

Example Commands:
$appgw = Get-AzApplicationGateway -Name $appgwName -ResourceGroupName $rgname

$backendSettingGet = Get-AzApplicationGatewayBackendSetting -ApplicationGateway $appgw -Name PoolSetting01Name

Add-AzApplicationGatewayBackendSetting -ApplicationGateway $appgw -Name $poolSetting02Name -Port 1234 -Protocol TCP -Timeout 42

Set-AzApplicationGatewayBackendSetting -ApplicationGateway $appgw -Name $poolSetting02Name -Port 123 -Protocol TCP -Timeout 40

Remove-AzApplicationGatewayBackendSetting -ApplicationGateway $appgw -Name $poolSetting02Name

$appgw = Set-AzApplicationGateway -ApplicationGateway $appgw

And For New-AzApplicationGatewayBackendSetting it Outputs a PSApplicationGatewayBackendSettings which can be used to create a new ApplicationGateway.

Below is an Example.

$poolSetting01 = New-AzApplicationGatewayBackendSetting -Name $poolSetting01Name -Port 443 -Protocol TCP -Timeout 20

$appgw = New-AzApplicationGateway -Name $appgwName -ResourceGroupName $rgname -Location $location -BackendAddressPools $pool -BackendSettingsCollection $poolSetting01 -FrontendIpConfigurations $fipconfig -GatewayIpConfigurations $gipconfig -FrontendPorts $fp01 -Listeners $listener01 -RoutingRules $rule01 -Sku $sku -AutoscaleConfiguration $autoscaleConfig -Probe $probe

@VeryEarly
Copy link
Collaborator

It seems like backend setting related cmdlets only manipulate the in-memory PSApplicationGateway object without sending any request except Add-AzApplicationGatewayBackendSetting, can you please confirm why these cmdlets are needed.

Basically, the workflow to update BackendSettings would require to fetch the application gateway object and then use the new cmdlets to modify the backend settings in the application gateway object and at last update the Application Gateway Object using Set-AzApplicationGateway.
Same is true for Listeners and RoutingRules.

Example Commands: $appgw = Get-AzApplicationGateway -Name $appgwName -ResourceGroupName $rgname

$backendSettingGet = Get-AzApplicationGatewayBackendSetting -ApplicationGateway $appgw -Name PoolSetting01Name

Add-AzApplicationGatewayBackendSetting -ApplicationGateway $appgw -Name $poolSetting02Name -Port 1234 -Protocol TCP -Timeout 42

Set-AzApplicationGatewayBackendSetting -ApplicationGateway $appgw -Name $poolSetting02Name -Port 123 -Protocol TCP -Timeout 40

Remove-AzApplicationGatewayBackendSetting -ApplicationGateway $appgw -Name $poolSetting02Name

$appgw = Set-AzApplicationGateway -ApplicationGateway $appgw

And For New-AzApplicationGatewayBackendSetting it Outputs a PSApplicationGatewayBackendSettings which can be used to create a new ApplicationGateway.

Below is an Example.

$poolSetting01 = New-AzApplicationGatewayBackendSetting -Name $poolSetting01Name -Port 443 -Protocol TCP -Timeout 20

$appgw = New-AzApplicationGateway -Name $appgwName -ResourceGroupName $rgname -Location $location -BackendAddressPools $pool -BackendSettingsCollection $poolSetting01 -FrontendIpConfigurations $fipconfig -GatewayIpConfigurations $gipconfig -FrontendPorts $fp01 -Listeners $listener01 -RoutingRules $rule01 -Sku $sku -AutoscaleConfiguration $autoscaleConfig -Probe $probe

make sense

@VeryEarly
Copy link
Collaborator

/azp run azure-powershell - security-tools

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@VeryEarly
Copy link
Collaborator

/azp run azure-powershell - security-tools

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants