How to deploy ASP.NET app to Amazon EC2 using MS WebDeploy?
Asked Answered
M

1

11

I have an ASP.NET MVC site that is hosted on an Amazon EC2 service. I want to establish auto deploy with MS WebDeploy to this site. I've found a great article about this: Automating Deployment with Microsoft Web Deploy.

I can't reach https://mySite:8172/MsDeploy.axd because port 8172 is closed on Amazon by default. I am not very familiar with EC2 service configuration so I can't find out how to open this port over https protocol. I've reconfigured IIS to use default port (433) and I was open this port on the Amazon security group that is used for my site.

Now I've tried to open https://mySite/MsDeploy.axd in a web browser. IE requests credentials, makes note of a certificate error (I clicked "Continue..") and forwards me to 404.

Just to be sure, I tried to deploy via VS 2010, and of course it doesn't work.

Can anybody who has experience using MS Web Deploy in Amazon EC2 tell me what I'm doing wrong?

Meri answered 9/7, 2012 at 14:50 Comment(5)
Two things. First: in order to open port 8172, you need to a)Open it in the security group of your EC2 instance, on the AWS Control Panel/EC2/Security Groups. b)Open Windows Firewall. Second: The certificate error happens because most likely there is no certificate on your instance, or because its Common Name does not match the instance FQDN. The 404 is a symptom that the deployment is no available on IIS.Resilient
About step one - I can't found how to specify port which I want to open. I can choose type of port, for instance: https and it opens me 433. But I can't find how to set number of port.Meri
In the Create a new rule dropdown, select Custom TCP rule. This way you will be able to specify which port you are opening. Then, choose port 8192 and enter the client IP address in the Source field.Resilient
@Resilient Thanks. You completely answer on my question. Unfortunatelyv I can't mark it as answer.Meri
I have added an answer, so others with similar problems might benefit of it too.Resilient
R
10

Two things.
First: in order to open port 8172, you need to
a)Open it in the security group of your EC2 instance, on the AWS Control Panel/EC2/Security Groups:
In the Create a new rule dropdown, select Custom TCP rule. This way you will be able to specify which port you are opening. Then, choose port 8172 and enter the client IP address in the Source field.
b)Open Windows Firewall.

Second: The certificate error happens because most likely there is no certificate on your instance, or because its Common Name does not match the instance FQDN. The 404 is a symptom that the deployment is not available on IIS.

Resilient answered 1/8, 2012 at 16:5 Comment(3)
My comment to this: I didn't do anything with Firewall - it works correct by default on Amazon (on my dedicated web server too). Related to certificate: I allowed untrusted certificate (marked my server as trusted). And now it works for me.Meri
The default port is 8172, rather than 8192.Lorrielorrimer
After doing this, I still had to update the Web Deployment package on my server before it would allow me to connect. I found instructions here: docs.aws.amazon.com/gettingstarted/latest/computebasics/…Sternutatory

© 2022 - 2024 — McMap. All rights reserved.