IISWebAppManagementOnMachineGroup:SSL 证书添加失败,错误:183

问题描述 投票:0回答:1

我正在尝试使用 IISWebAppManagementOnMachineGroup@0 任务通过 Azure Pipelines 将 dotnet Web 应用程序部署到 Windows Server 2022。

  - task: IISWebAppManagementOnMachineGroup@0
    inputs:
      IISDeploymentType: 'IISWebsite'
      ActionIISWebsite: 'CreateOrUpdateWebsite'
      WebsiteName: '${{ parameters.websiteName }}'
      WebsitePhysicalPath: '${{ parameters.physicalPath }}'
      WebsitePhysicalPathAuth: 'WebsiteUserPassThrough'
      CreateOrUpdateAppPoolForWebsite: true
      AppPoolNameForWebsite: '${{ parameters.websitePoolName }}'
      DotNetVersionForWebsite: 'No Managed Code'
      PipeLineModeForWebsite: 'Integrated'
      AppPoolIdentityForWebsite: 'ApplicationPoolIdentity'
      AddBinding: true
      Bindings: |
          {
              bindings:[
                  {
                      "protocol":"https",
                      "ipAddress":"All Unassigned",
                      "hostname":"${{ parameters.hostname }}",
                      "port":"443",
                      "sslThumbprint":"${{ parameters.sslThumbprint }}",
                      "sniFlag":true
                  }
              ]
          }
      ServerNameIndication: true
      ConfigureAuthenticationForWebsite : true
      AnonymousAuthenticationForWebsite: false
      WindowsAuthenticationForWebsite: true

我第一次部署工作得很好,但下一次部署出现了这个错误:

SSL Certificate add failed, Error: 183
Cannot create a file when that file already exists.

我找到了一个解决方法,通过删除 ssl 证书来完成之前的任务,如下所示:

  - task: PowerShell@2
    displayName: Remove ssl certs
    continueOnError: true
    inputs:
      targetType: 'inline'
      script: |
        netsh http delete sslcert hostnameport=${{ parameters.hostname}}:443

有没有更好的解决方案来允许多个部署而不需要每次都删除 ssl 证书。

windows powershell iis azure-pipelines devops
1个回答
0
投票

您使用的解决方法是一个不错的选择。我注意到这是 bug,已于今年 2 月修复,但仍然有人遇到同样的问题。我将尝试联系产品团队并确认是否可以重新打开该票证。同时,您可以在此处创建新票证来报告您当前的问题。

© www.soinside.com 2019 - 2024. All rights reserved.