Application gateway using Azure PowerShell
Steps to configure the Application gateway
1. Download and Install the Azure windows power-shell
2. Add your azure azzount using this command : Add-AzureAccount
3. Once login into your account, get the azure Subscriptions whatever available in your azure account
Command : Get-AzureSubscription
4.Select the particular azure Subscription, from where those instances are available for configure the
application gateway
Command : Get-AzureSubscription
5.Next, We have to create a new application gateway using below command
Command : New-AzureApplicationGateway -Name AppGw -VnetName uvnet-Subnets @(Subnet-1")
6.Should be validate, the created application gateway
Command : Get-AzureApplicationGateway AppGw
7.Next Step, We need to create the SslCert
Command : Add-AzureApplicationGatewaySslCertificate SslCert
8. The Step to add the application gateway certificate, We should copy our sslcertificate in
our local drive path for any name
Command : Add-AzureApplicationGatewaySslCertificate -Name AppGw -CertificateName SslCert -Password
password -CertificateFile d:/mention the ssl certificate copied path here
9.Validate the application gateway SslCertificate
Command : Get-AzureApplicationGatewaySslCertificate AppGw
you may get the Output like this
VERBOSE: 12:10:26 PM - Begin Operation: Get-AzureApplicationGatewaySslCertificate
VERBOSE: 12:10:29 PM - Completed Operation: Get-AzureApplicationGatewaySslCertificate
Name : SslCert
SubjectName : CN=*.test.com, OU=tesct Sys, O=Test Sys Ltd, L=Chennai, S=Tamil Nadu, C=IN
Thumbprint : DBAA15446ACF788BEA2CA555CFB69C69ECA09293
ThumbprintAlgo : sha256RSA
State : Provisioned
10.Then, we have configure the Configfile of application gateway
Below, I'm Sharing the sample xml fle for configuring the xml depends on your requirement, Can configure http, https listeners etc.
<ApplicationGatewayConfiguration xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<FrontendIPConfigurations>
<Name>fep1</Name>
<Port>80</Port>
<FrontendPort>
</FrontendPort>
<FrontendPorts>
</FrontendPorts>
<Name>pool1</Name>
<IPAddress>10.0.0.1</IPAddress>
<IPAddress>10.0.0.2</IPAddress>
<IPAddresses>
</IPAddresses>
<BackendAddressPool>
</BackendAddressPool>
<BackendAddressPools>
</BackendAddressPools>
<Name>setting1</Name>
<Port>80</Port>
<Protocol>Http</Protocol>
<CookieBasedAffinity>Enabled</CookieBasedAffinity>
<BackendHttpSettings>
</BackendHttpSettings>
<BackendHttpSettingsList>
</BackendHttpSettingsList>
<Name>listener1</Name>
<FrontendPort>port1</FrontendPort>
<Protocol>Http</Protocol>
<HttpListener>
</HttpListener>
<HttpListeners>
</HttpListeners>
<Name>rule1</Name>
<Type>Basic</Type>
<BackendHttpSettings>setting1</BackendHttpSettings>
<Listener>listener1</Listener>
<BackendAddressPool>pool1</BackendAddressPool>
<HttpLoadBalancingRule>
</HttpLoadBalancingRule>
<HttpLoadBalancingRules>
</HttpLoadBalancingRules>
</FrontendIPConfigurations>
</ApplicationGatewayConfiguration>
Once modifying the xml file, copied in to local drive path same as Certificate path.
11. Next Step, we should create config file using created config.xml file
Command : Set-AzureApplicationGatewayConfig -Name AppGw -ConfigFile c:/Mention the config.xml drive path
12. Atlast, we finished all the steps for configuring the application gateway. Then we need to start our application gateway
Command : Start-AzureApplicationGateway AppGw
13. Final Step, we have get the azure application gateway
Command : Get-AzureApplicationGateway AppGw
Steps to configure the Application gateway
1. Download and Install the Azure windows power-shell
2. Add your azure azzount using this command : Add-AzureAccount
3. Once login into your account, get the azure Subscriptions whatever available in your azure account
Command : Get-AzureSubscription
4.Select the particular azure Subscription, from where those instances are available for configure the
application gateway
Command : Get-AzureSubscription
5.Next, We have to create a new application gateway using below command
Command : New-AzureApplicationGateway -Name AppGw -VnetName uvnet-Subnets @(Subnet-1")
6.Should be validate, the created application gateway
Command : Get-AzureApplicationGateway AppGw
7.Next Step, We need to create the SslCert
Command : Add-AzureApplicationGatewaySslCertificate SslCert
8. The Step to add the application gateway certificate, We should copy our sslcertificate in
our local drive path for any name
Command : Add-AzureApplicationGatewaySslCertificate -Name AppGw -CertificateName SslCert -Password
password -CertificateFile d:/mention the ssl certificate copied path here
9.Validate the application gateway SslCertificate
Command : Get-AzureApplicationGatewaySslCertificate AppGw
you may get the Output like this
VERBOSE: 12:10:26 PM - Begin Operation: Get-AzureApplicationGatewaySslCertificate
VERBOSE: 12:10:29 PM - Completed Operation: Get-AzureApplicationGatewaySslCertificate
Name : SslCert
SubjectName : CN=*.test.com, OU=tesct Sys, O=Test Sys Ltd, L=Chennai, S=Tamil Nadu, C=IN
Thumbprint : DBAA15446ACF788BEA2CA555CFB69C69ECA09293
ThumbprintAlgo : sha256RSA
State : Provisioned
10.Then, we have configure the Configfile of application gateway
Below, I'm Sharing the sample xml fle for configuring the xml depends on your requirement, Can configure http, https listeners etc.
<ApplicationGatewayConfiguration xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<FrontendIPConfigurations>
<Name>fep1</Name>
<Port>80</Port>
<FrontendPort>
</FrontendPort>
<FrontendPorts>
</FrontendPorts>
<Name>pool1</Name>
<IPAddress>10.0.0.1</IPAddress>
<IPAddress>10.0.0.2</IPAddress>
<IPAddresses>
</IPAddresses>
<BackendAddressPool>
</BackendAddressPool>
<BackendAddressPools>
</BackendAddressPools>
<Name>setting1</Name>
<Port>80</Port>
<Protocol>Http</Protocol>
<CookieBasedAffinity>Enabled</CookieBasedAffinity>
<BackendHttpSettings>
</BackendHttpSettings>
<BackendHttpSettingsList>
</BackendHttpSettingsList>
<Name>listener1</Name>
<FrontendPort>port1</FrontendPort>
<Protocol>Http</Protocol>
<HttpListener>
</HttpListener>
<HttpListeners>
</HttpListeners>
<Name>rule1</Name>
<Type>Basic</Type>
<BackendHttpSettings>setting1</BackendHttpSettings>
<Listener>listener1</Listener>
<BackendAddressPool>pool1</BackendAddressPool>
<HttpLoadBalancingRule>
</HttpLoadBalancingRule>
<HttpLoadBalancingRules>
</HttpLoadBalancingRules>
</FrontendIPConfigurations>
</ApplicationGatewayConfiguration>
Once modifying the xml file, copied in to local drive path same as Certificate path.
11. Next Step, we should create config file using created config.xml file
Command : Set-AzureApplicationGatewayConfig -Name AppGw -ConfigFile c:/Mention the config.xml drive path
12. Atlast, we finished all the steps for configuring the application gateway. Then we need to start our application gateway
Command : Start-AzureApplicationGateway AppGw
13. Final Step, we have get the azure application gateway
Command : Get-AzureApplicationGateway AppGw
No comments:
Post a Comment