简体   繁体   中英

Azure Deploy [error]Process 'appcmd.exe' exited with code '4312'

I am trying to do deploy on azure vm but getting below error in the log. Any help will be appreciated.

2019-02-25T14:02:55.2630391Z ##[section]Starting: Manage IISWebsite 2019-02-25T14:02:55.2638264Z ============================================================================== 2019-02-25T14:02:55.2638352Z Task : IIS Web App Manage 2019-02-25T14:02:55.2638426Z Description : Create or update a Website, Web App, Virtual Directories, and Application Pool 2019-02-25T14:02:55.2638480Z Version : 0.5.9 2019-02-25T14:02:55.2638542Z Author : Microsoft Corporation 2019-02-25T14:02:55.2638599Z Help : More Information 2019-02-25T14:02:55.2638661Z ============================================================================== 2019-02-25T14:02:56.5249594Z ##[command]"C:\\Windows\\system32\\inetsrv\\appcmd.exe" list apppool /name:"azure2" 2019-02-25T14:02:56.5894950Z ##[command]"C:\\Windows\\system32\\inetsrv\\appcmd.exe" set apppool /apppool.name:"azure2" -managedRuntimeVersion:v4.0 -managedPipelineMode:Integrated -processModel.identityType:ApplicationPoolIdentity 2019-02-25T14:02:56.6765646Z APPPOOL object " azure2" changed 2019-02-25T14:02:56.6880351Z ##[command]"C:\\Windows\\system32\\inetsrv\\appcmd.exe" list site /name:"azure2.desap.net" 2019-02-25T14:02:56.7391199Z ##[command]"C:\\Windows\\system32\\inetsrv\\appcmd.exe" add site /name:"azure2.desap.net" /physicalPath:"C:\\inetpub\\wwwroot\\net.desap.azure2" 2019-02-25T14:02:56.8221558Z SITE object "azure2.desap.net" added 2019-02-25T14:02:56.8254882Z APP object "azure2.desap.net/" added 2019-02-25T14:02:56.8255141Z VDIR object "azure2.desap.net/" added 2019-02-25T14:02:56.8450318Z ##[command]"C:\\Windows\\system32\\inetsrv\\appcmd.exe" set site /site.name:"azure2.desap.net" -applicationDefaults.applicationPool:"azure2" -[path='/'].[path='/'].physicalPath:"C:\\inetpub\\wwwroot\\net.desap.azure2" -[path='/'].[path='/'].userName: -[path='/'].[path='/'].password: 2019-02-25T14:02:56.9132304Z SITE object "azure2.desap.net" changed 2019-02-25T14:02:56.9421865Z ##[command]"C:\\Windows\\system32\\inetsrv\\appcmd.exe" list sites 2019-02-25T14:02:57.0211736Z ##[comm and]"netsh" http show sslcert hostnameport=azure2.desap.net:443 2019-02-25T14:02:57.0749939Z ##[command]"netsh" http add sslcert hostnameport=azure2.desap.net:443 certhash=*** appid={27113a38-e64f-45dd-8078-c551f0cd842e} certstorename=MY 2019-02-25T14:02:57.1144820Z 2019-02-25T14:02:57.1145068Z SSL Certificate successfully added 2019-02-25T14:02:57.1145124Z 2019-02-25T14:02:57.1319852Z ##[command]"C:\\Windows\\system32\\inetsrv\\appcmd.exe" set site /site.name:"azure2.desap.net" /bindings.[protocol='https',bindingInformation='*:443:azure2.desap.net'].sslFlags:"1" 2019-02-25T14:02:57.1773238Z ERROR ( message:Cannot find requested collection element. ) 2019-02-25T14:02:57.3415435Z ##[error]Process 'appcmd.exe' exited with code '4312'. 2019-02-25T14:02:57.3731371Z ##[section]Finishing: Manage IISWebsite

The reason for this error message was that there where no artifacts generated, I added this line at the end of my .yaml code and it got fixed.

- task: PublishBuildArtifacts@1    
  displayName: 'Publish Artifact: drop'
  inputs:
    PathtoPublish: '$(build.artifactstagingdirectory)'

I had encountered the same error. Basically it didn't like changing the existing certificate attached to the site ie if your site's bindings in the IIS already had an existing certificate attached to it, which is different than your Release build; it will fail.

To correct it, I manually deleted (in order) the site and the Application Pool associated with it. And re ran the release, worked perfectly fine. Hope this helps someone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM