Web/msdeploy sync from IIS to IISExpress fails - iis

I have a a web site on a IIS on a remote machine. I would like to sync the website on the remote server to a local IISExpress. Currently I do not have the site on my local IISExpress. I am using the following msdeploy.exe command line (Here I formatted it in several lines, but of course the actual command is a single line):
msdeploy.exe
-verb:sync
-source:webApp="mysubdomain.mydomain.com",computername=mycomputer,userName=myuser,password=mypassword
-dest:auto
-apphostconfigdir=C:\Users\steen\Documents\IISExpress\config
-webserverdir="c:\program files (x86)\IIS Express"
I get following error returned:
Error: Application Definition with path 'mysubdomain.mydomain.com' does not exist.
Am I doing it wrong?
Do I need to have the site on my local IISExpress before I can sync (is there any workaround if I must have it locally first?)?

In the -source argument, try using the name of the web application for webApp (e.g. webApp="wordpress") and specifying the URL for your server in the computername argument. I don't think you need to have the site locally to begin with, but of course you'll need to have whatever web application the site uses installed locally.
Links: webApp: Web Deploy webApp Provider; computername: Web Deploy Provider Settings.

Related

Unable to complete Kudu deployments on Azure Websites

I have set up a deployment following the guidelines here:
https://learn.microsoft.com/en-us/azure/app-service/deploy-continuous-deployment?tabs=github
The deployment was working successfully when first set up. Today I made changes to my code for a redeploy and it stopped working.
I get the following error:
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment with MSBuild16.7.0.
Access is denied.
Failed exitCode=1, command="D:\Program Files (x86)\MSBuilds\16.8.3\MSBuild\Current\Bin\MSBuild.exe" /restore "D:\home\site\repository\myproject\myproject.Web.csproj" /p:DeployOnBuild=true /p:configuration=Release /p:publishurl="D:\local\Temp\8d8f7e05bbfa782"
An error has occurred during web site deployment.
Access is denied.\r\nD:\Program Files (x86)\SiteExtensions\Kudu\92.30310.5111\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
I then connected to the Kudu debug portal and attempted to run the command myself. It failed. Then I attempted to navigate to D:\Program Files (x86)\MSBuilds\16.8.3\MSBuild\Current\Bin
That version of MSBuild is missing. The only versions present are:
03/27/2021 09:33 AM <DIR> MSBuild-15.3.409.57025
03/27/2021 09:33 AM <DIR> MSBuild-15.9.21.664
03/27/2021 09:33 AM <DIR> MSBuild-16.4
How do I get 16.8.3 installed?
Azure web app is run in a sandbox environment, and the contents of the folder under D:/home have read and write permissions. All other folders have read-only permissions.
Azure web app has a web environment that supports deployment in various languages, so there is no need to install the 16.8.3 version of MSBuild.
For your question, I can only provide the following troubleshooting steps:
Check what version of your project is. Net framework, .net core 2.2 or 3.1, .net5 ?
Check if the Stack settings of your azure web app is consistent with the project.
(Optional step) Set the Stack settings to .Net5, and modify any file in github, such as a new file. Check the deployment results.
Download your project and run it locally to see if it can run normally.
Create a test slot, redeploy to see if it can be deployed normally, and set the traffic to temporarily not affect your web operation. See if the problem will recur. If the problem persists, please contact Microsoft.
Related Posts:
1. Error - Access is denied - deployment to Azure App Services

How to deploy shield with Kibana on Bluemix

I am trying to deploy Kibana on Bluemix PaaS. Because Kibana is a Node.js application, it can be deployed as such on Bluemix. All i have to do:
Provide a simple manifest.yml file that details the app name and a couple of other things
Provide a Procfile that has just one line as web: bin/kibana --port=$PORT
Thus, I can run Kibana on Bluemix. Note that this is pushed via Cloud Foundry.
Also, I was able to install the marvel and sense plugins for Kibana.
Now, I installed the shield plugin. This plugin requires an ssl key and an ssl cert file to run. The path to these files must be provided in the kibana.yml file.
After installation, I tested the shield plugin natively and it worked just fine.
Here is the layout of the directory structure:
bin(d)
config(d)
installedPlugins(d)
node_modules(d)
sslFiles(d)
manifest.yml
Procfile
(d) represents directories. The sslFiles folder contains the ssl key and ssl cert files.
Before I could push to Bluemix, I knew that the paths to the SSL files would have to be relative to the app in Bluemix. Thus, in the kibana.yml file, I specified them as:
kibana.ssl.key:app/sslFiles/kibana.key
kibana.ssl.cert:app/sslFiles/kibana.cert
I did this as in Bluemix, I could see the following directory structure:
app(d)
bin(d)
config(d)
installedPlugins(d)
node_modules(d)
sslFiles(d)
manifest.yml
Procfile
Indentation represents containment. So, I pushed it to Bluemi using Cloud Foundry, but now I get a 502 Bad Gateway: Registered endpoint failed to handle the request error. I tried changing the paths to sslFiles/kibana.key but then I got a cannot find path sslFiles/kibana.key staging error.
What is responsible for my 502 error? Is it the path to the sslFiles? If so, how can I properly provide the paths?

msdeploy stop working, getting error Code: ERROR_USER_NOT_ADMIN

I am using msdeploy to deploy codes to dev server. this morning it stops working. and I am getting ERROR_USER_NOT_ADMIN. nothing changed, at least not that I know of.
abc\jqin, this user is a domain account, its a local admin. why am I still getting ERROR_USER_NOT_ADMIN
Deploy: "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
-verb:sync -source:package="C:\NetBuild\Packages\IRViewerSvc\IRViewerSvc.zip" -dest:iisApp=IRViewerSvc,computerName=tvw-irwebsvc,username="abc\jqin",password=********
Info: Using ID '51e98b9d-456e-4c7e-8f1a-c696c240f431' for
connections to the remote server. EXEC : error Code:
ERROR_USER_NOT_ADMIN [C:\NetBuild\BuildScript\IRViewerSvc.build]
More Information: Connected to 'tvw-irwebsvc' using the Web Deployment
Agent Service, but could not authorize. Make sure you are an
administrator on 'tvw-irwebsvc'. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
Error : The remote server returned an error : (401) Unauthorized.
[C:\NetBuild\BuildScript\IRViewerSvc.build] EXEC : error count: 1.
[C:\NetBuild\BuildScript\IRViewerSvc.build]
C:\NetBuild\BuildScript\IRViewerSvc.build(71,5): error MSB3073: The
command ""C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
-verb:sync -source:package="C:\NetBuild\Packages\IRViewerSvc\IRViewerSvc.zip" -dest:iisApp=IRViewerSvc,computerName=tvw-irwebsvc,username="abc\jqin",password=********"
exited with code -1. Done Building Project
"C:\NetBuild\BuildScript\IRViewerSvc.build" (deploy target(s)) --
FAILED.
Try search mmc and run it click on File add or remove snap-ins, select Local Users and Groups hit ok.
Click on the User uncheck everything and check only Password never expires.
Now go to Groups add new group if it does not exists MSDepSvcUsers, Double click on it and add your User as a member.
Go to Services and restart the Web Deployment Agent Service.
Now try and run your MSDeploy.
I hope this was helpful.
Trosago
The NetLogon solution posted here didn't work on our AWS EC2 Windows Server 2019 instances because of the following:
This computer is configured as a member of a workgroup, not as a member of a domain. The Netlogon service does not need to run in this configuration.
The MSDepSvcUsers solution posted here didn't work completely either:
[16:19:20] Error: (2/10/2020 5:19:20 PM) An error occurred when the request was processed on the remote computer.
[16:19:20] Error: An error occurred when reading the IIS Configuration File 'MACHINE/REDIRECTION'. The identity performing the operation was 'EC2AMAZ-ABCDEFG\SomeUserName'.
[16:19:20] Error: Filename: \\?\C:\Windows\system32\inetsrv\config\redirection.config
[16:19:20] Error: Cannot read configuration file due to insufficient permissions
As noted here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/083efb2e-d087-4a03-9f6a-662a218cacf8/machineredirection-error?forum=tfsgeneral
Adding the Read & execute and Read access to the folder containing the redirection.config file for the user doing the deploy didn't fix the issue, but adding read permissions for the NETWORK SERVICE user on that same folder did.
I recently encountered an interment problem where builds were failing with ERROR_USER_NOT_ADMIN.
This was after an OS upgrade to Windows 2016.
The error from MsDeploy was not entirely correct in our situation and we noticed that if the deployment user was remoted onto the server the deploy would complete successfully.
Upon looking at the event log I noticed that there was an error stating that the deployment account failed to logon with a reason 'The NetLogon component is not active.'
Sure enough, the NetLogon service was stopped. Starting it meant the deployments worked again.

How can I deploy an asp.net mvc2 app developed on SharpDevelop (windows 7 64bit) to the local iis 7.5?

I'm using SharpDevelop and can test/see the app using "Use IIS Express Web Server" selected in the project property. But when I try to change to "Use local IIS Web Server" and hit "Create application/virtual directory", an error message show up that said:
Filename: redirection.config
Error: Cannot read configuration file due to insufficient permissions
At end, what I need is deploy MVC 2 app to a IIS Server, first to a local server and then to a remote server.
The problem can be solved running SharpDevelop as Admin.

Debug Node.js - The iisnode module is unable to deploy supporting files necessary to initialize the debugger

I get the following error when I try to debug a node.js application using Azure SDK for Node.js:
The iisnode module is unable to deploy supporting files necessary to initialize the debugger. Please check that the identity of the IIS application pool running the node.js application has read and write access permissions to the directory on the server where the node.js application is located.
I have installed the full version of iisnode and added the config settings in web.config. Here is an example of what I type in the browser:
http://server:81/server.js/debug
. The application is using IIS Express to run that is provided in the latest Windows Azure SDK for Node.js - August 2012.
Any help will be appreciated!
There are two possible issues here, depending on which version of the Azure SDK for Node you are running:
(1) If you are running a version < 0.6, then this is almost certainly a permissions issue with your webrole directory. Note that, in IIS, it's the actual web role directory and not the directory in local_package.csx that is actually used in the web role. Make sure that iiS_IUSRS has write access to this directory and it should work.
(2) If you are running a version >= 0.6, then the problem is that you are using an iisnode version that isn't iis full inside iisexpress. You can get around this by editing setup_web.cmd to use the path to the iisnode dll in your iisnode directory (rather than the iisnode-dev directory or the SDK directory).

Resources