-
Notifications
You must be signed in to change notification settings - Fork 426
Open
Description
I have the following in my yaml pipeline:
- task: IISWebAppManagementOnMachineGroup@0
displayName: 'Deploy base website with binding: ${{ binding }}'
inputs:
IISDeploymentType: 'IISWebsite'
ActionIISWebsite: 'CreateOrUpdateWebsite'
#... snipped
AddBinding: true
Protocol: 'https'
IPAddress: '*'
Port: 443
ServerNameIndication: true
HostNameWithSNI: '${{ binding }}'It works the first time but fails on repeat deployments on Server 2022 machines.
The issue doesn't occur on our Server 2019 and older machines.
I think the issue is due to some additional lines in the netsh output

Looking at
Line 186 in 78bf251
| $isItSameBinding = $result.Get(4).Contains([string]::Format("{0}:{1}", $hostname, $port)) |
Line 201 in 78bf251
| $isItSameCert = $result.Get(5).ToLower().Contains($certhash.ToLower()) |
On Server 2022 the checks always fail so it tries to add a new binding, which fails with the error
SSL Certificate add failed, Error: 183
Cannot create a file when that file already exists.
##[error]Process 'netsh' exited with code '1'.
neumann1990 and colhouse-hakh
Metadata
Metadata
Assignees
Labels
No labels