Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-AzureRmApplicationGateway throws "Object reference not set to an instance of an object" the first time it runs after "Add-AzureRmApplicationGatewayHttpListener" #3800

Closed
adityapenmetsa opened this issue Apr 19, 2017 · 10 comments
Assignees
Labels
Network - Application Gateway Network Service Attention This issue is responsible by Azure service team.

Comments

@adityapenmetsa
Copy link

Cmdlet(s)

$appgateway = Add-AzureRmApplicationGatewayHttpListener -ApplicationGateway $appgw -Name $backendAddressPoolName -FrontendIPConfiguration $fipconfig01 -FrontendPort $fp01 `
-Protocol Https -HostName $hostName -RequireServerNameIndication true -SslCertificate $cert

$UpdatedAppGw = Set-AzureRmApplicationGateway -ApplicationGateway $appgateway

PowerShell Version

5.1.14393.953

Module Version

OS Version

10.0.14393.953

Description

I am trying to add new HTTP listener to already existing Azure Application Gateway. After successfully running the cmdlet "Add-AzureRmApplicationGatewayHttpListener", the application gateway needs to be updated by running the cmdlet "Set-AzureRmApplicationGateway". It is here where the cmdlet throws "Object reference not set to an instance of an object" error the first time it is run. On retry, it successfully gets updated. I have tried the process repeatedly by deleting and adding the listeners, and this scenario is seen on every try.

Debug Output

Set-AzureRmApplicationGateway : Object reference not set to an instance of an object.
At line:94 char:29

  • ... atedAppGw = Set-AzureRmApplicationGateway -ApplicationGateway $appgat ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : CloseError: (:) [Set-AzureRmApplicationGateway], NullReferenceException
    • FullyQualifiedErrorId : Microsoft.Azure.Commands.Network.SetAzureApplicationGatewayCommand

Script/Steps for Reproduction

@markcowl
Copy link
Member

@DeepakRajendranMsft Can you take a look?

@blarsonrp
Copy link

I am also getting this error with trying to finalize my add-azurermapplicationgatewayrequestroutingrule changes with Set-AzureRmApplicationGateway -ApplicationGateway $AppGw1 on azurerm.netwrok version 4.2.1

@alexhisen
Copy link

Also happens after Set-AzureRmApplicationGatewayHttpListener -ApplicationGateway $agw -Name API -SslCertificate $cert -Protocol Https

@fogers777
Copy link

any update?

@DailyReminder
Copy link

I'm also experiencing this. Does anyone know of a solution or work around?

@parsoFish
Copy link

Also experiencing this after a AzureRmApplicationGatewayRequestRoutingRule is there any progress on this issue?

@maddieclayton
Copy link
Contributor

@akshaysngupta Can you take a look at this issue?

@akshaysngupta
Copy link
Member

akshaysngupta commented Aug 8, 2018

This is the sequence of cmdlets that reproduces this error

$fePort = New-AzureRmApplicationGatewayFrontendPort -Name "$name-FePort" -Port 443
$appgw = New-AzureRmApplicationGateway -FrontendPort $fePort ...
$appgw = Add-AzureRmApplicationGatewayHttpListener -ApplicationGateway $appgw -FrontendPort $fp01
Set-AzureRmApplicationGateway -ApplicationGateway $appgw

New-AzureRmApplicationGateway resets the $fePort.Id to an empty string which causes Null reference exception.

ApplicationGatewayChildResourceHelper.NormalizeChildResourcesId(applicationGateway);

httpListener.FrontendPort.Id = NormalizeApplicationGatewayNameChildResourceIds(

Workaround:
Before performing a set, use Get cmdlets to fetch the referenced resources like ex- port and ipconfig for httplistener

Will update the issue with fix timeline.

@bsiegel bsiegel added the Service Attention This issue is responsible by Azure service team. label Sep 26, 2018
@nun3r
Copy link

nun3r commented Oct 25, 2018

Any update on a fix for this?

@EvgenyAgafonchikov
Copy link
Contributor

Fixed by #8576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Network - Application Gateway Network Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests