Sto integrando MSDeploy nel mio processo di compilazione e avendo problemi di autenticazione. Il seguente comando funziona bene:MSDeploy.exe può connettersi come amministratore, ma nessun altro account di Windows
msdeploy -verb:sync -source:appHostConfig="KitchenPC",computerName=192.168.0.3,userName=Administrator,password=secret -dest:package=c:\DeployTest\KPC.zip
Tuttavia, questo non funziona:
msdeploy -verb:sync -source:appHostConfig="KitchenPC",computerName=192.168.0.3,userName=kpcpublish,password=secret -dest:package=c:\DeployTest\KPC.zip
e rendimenti l'errore:
Error Code: ERROR_USER_NOT_ADMIN
More Information: Connected to '192.168.0.11' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administ
rator on '192.168.0.11'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
Error: The remote server returned an error: (401) Unauthorized.
Error count: 1.
Ho seguito le istruzioni nel link qui sotto, e qualsiasi other docs I could find, che praticamente tutti dicono la stessa cosa:
- Ho creato un account chiamato kpcpublish
- ho aggiunto questo account a un gruppo chiamato MSDepSvcUsers - Heck, ho anche aggiunto l'account di amministratori
- ho ragione cliccato sul sito e selezionato Installare-> Configura Web Deploy Publishing e aggiunto kpcpublish all'elenco. Si dice quanto segue:
.
Publish enabled for 'SERVER\kpcpublish' Granted 'SERVER\kpcpublish' full control on 'C:\Website' Successfully created settings file 'C:\Users\Administrator\Desktop\SERVER_kpcpublish_KitchenPC.PublishSettings'
Ci deve essere qualche passo mi manca, ma io proprio non riesco a capire cosa potrebbe essere.
UPDATE:
Utilizzando il percorso HTTP completo per la proprietà computerName
, ottengo l'errore:
Error Code: ERROR_DESTINATION_NOT_REACHABLE More Information: Could not connect to the remote computer ("192.168.0.3"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DES TINATION_NOT_REACHABLE. Error: Unable to connect to the remote server Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection fa iled because connected host has failed to respond 192.168.0.3:8192 Error count: 1.
Ho controllato e il servizio di gestione Web è davvero in esecuzione.
Un altro aggiornamento:
ho completamente aperto il sistema e impostare di nuovo da zero. Non ho fatto nulla di straordinario, ho appena installato il ruolo IIS e mi sono assicurato di controllare "Servizio di gestione" in Strumenti di gestione, che è necessario per l'esecuzione di WMSVC. Ho quindi installato Web PI e installato "Configurazione consigliata per i provider di hosting", che installerà Web Deploy 3.0. Tuttavia, ho notato che c'era un errore durante l'installazione di questo (credo di aver ricevuto questo errore anche l'ultima volta). Sembra che:
Ho anche attaccato i file di log here.
Ho quindi provato a installare manualmente Web Deploy 3.0, tuttavia si dice che sia già installato. Successivamente, ho scaricato l'MSI direttamente da http://www.iis.net/download/webdeploy e l'ho eseguito in modalità "Ripara". Sembra che abbia funzionato. Ho anche notato che il servizio WMSVC è attivo e funzionante. Quindi questo sembra buono.
Ancora, MSDeploy non si connetterà. Ho pensato che potesse essere una sorta di problema con il firewall, quindi l'ho eseguito localmente. Ho provato a utilizzare sia HTTPS che HTTP per connettersi.HTTPS mi dà un errore, HTTP scade appena dopo 2-3 minuti.
HTTPS:
msdeploy -verb:sync -source:appHostConfig="Default Web Site",computerName=https://STAGING:8172/msdeploy.axd,userName=Administrator,password=Khorf123 -dest:package=c:\DeleteMe.zip
Info: Using ID 'f3a54096-adc4-4f54-9e4f-ad8fde12edb6' for connections to the remote server.
Error Code: ERROR_CERTIFICATE_VALIDATION_FAILED
More Information: Connected to the remote computer ("staging") using the specified process ("Web Management Service"), but could not verify the server's certifi
cate. If you trust the server, connect again and allow untrusted certificates.
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CERTIFICATE_VALIDATION_FAILED.
Error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Error: The remote certificate is invalid according to the validation procedure.
Error count: 1.
HTTP:
msdeploy -verb:sync -source:appHostConfig="Default Web Site",computerName=http://STAGING:8172/msdeploy.axd,userName=Administrator,password=Khorf123 -dest:package=c:\DeleteMe.zip
Info: Using ID 'ebee66f0-08e5-4d9d-98ea-0c2e59784895' for connections to the remote server.
Error: Could not complete the request to remote agent URL 'http://staging:8172/msdeploy.axd'.
Error: The operation has timed out
Error count: 1.
solo un pensiero: il file "SERVER_kpcpublish_KitchenPC.PublishSettings" non deve essere archiviato da qualche parte nella cartella di distribuzione e non sul desktop? – SearchAndResQ
@Flakes - Non segue. Per il momento, sto solo provando a sincronizzare dal server web a un archivio zip locale per assicurarmi che le cose funzionino. In realtà non sono sicuro di * cosa * fare con il file PublishSettings, pensavo che fosse solo così non dovevi digitare tutte le informazioni di connessione sulla riga di comando. –
Il file delle impostazioni è rilevante solo se lo si utilizza per iniettare valori nei file di configurazione al momento della distribuzione. – ulty4life