Fix null hostnames in ApplicationGatewayHttpListener #1324
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a bug with the ApplicationGatewayHttpListenerInner resulting in null hostnames when utilizing the multiple hostnames and/or wildcard hostnames feature in an HTTP Listener.
Null hostnames results in the following error when applying any changes to an Application Gateway using this feature:
HostName must be specified if RequireServerNameIndication is true in Http Listener
StackTrace:
Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Exception while executing function: SetActiveDeploymentSlot ---> System.AggregateException: One or more errors occurred. (HostName must be specified if RequireServerNameIndication is true in Http Listener /subscriptions/REDACTED/resourceGroups/REDACTED/providers/Microsoft.Network/applicationGateways/REDACTED/httpListeners/REDACTED.) ---> Microsoft.Rest.Azure.CloudException: HostName must be specified if RequireServerNameIndication is true in Http Listener /subscriptions/REDACTED/resourceGroups/REDACTED/providers/Microsoft.Network/applicationGateways/REDACTED/httpListeners/REDACTED. at Microsoft.Azure.Management.Network.Fluent.ApplicationGatewaysOperations.BeginCreateOrUpdateWithHttpMessagesAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Dictionary`2 customHeaders, CancellationToken cancellationToken) at Microsoft.Azure.Management.Network.Fluent.ApplicationGatewaysOperations.CreateOrUpdateWithHttpMessagesAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Dictionary`2 customHeaders, CancellationToken cancellationToken) at Microsoft.Azure.Management.Network.Fluent.ApplicationGatewaysOperationsExtensions.CreateOrUpdateAsync(IApplicationGatewaysOperations operations, String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, CancellationToken cancellationToken) at Microsoft.Azure.Management.Network.Fluent.ApplicationGatewayImpl.CreateInnerAsync(CancellationToken cancellationToken) at Microsoft.Azure.Management.ResourceManager.Fluent.Core.GroupableParentResource`8.CreateResourceAsync(CancellationToken cancellationToken) at Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.Creatable`4.Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.IResourceCreator<IResourceT>.CreateResourceAsync(CancellationToken cancellationToken) at Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.CreatorTaskItem`1.ExecuteAsync(CancellationToken cancellationToken) at Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.TaskGroupBase`1.ExecuteNodeTaskAsync(DAGNode`1 node, CancellationToken cancellationToken) at Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.CreatableUpdatable`5.ApplyAsync(CancellationToken cancellationToken, Boolean multiThreaded) --- End of inner exception stack trace ---