We have a ASP.NET 5 web application in our solution.
Typically, we could right click on the Cloud Service "Roles" item and add a new role from an existing project in the solution.
But it cannot identity this project as a Web Role:
How are we able to host a ASP.NET 5 project in a Azure Web Role?
Edit: We are using Azure SDK 2.7
Sorry, we don't support WebRoles at the moment. You might* be able to hack your way around but officially there is no support. That means that any hack you do, will be in a text editor, not from tooling.
However, you can use an Azure WebSite instead. That's fully supported.
* it might not work at all. I am not aware of anyone who did this.
You probably have to build your package yourself using CSPack. Here an example using PowerShell and CSPack:
It also allows you to host multiple sites on a single web role.
It appears that it isn't officially supported as a web role at this time. It seems that it is only compatible with the web apps and not the older web role. The current work around is documented on this site: http://www.codeproject.com/Articles/331425/Running-an-EXE-in-a-WebRole-on-Windows-Azure
I've just blogged on how to do this (with VS tooling support!) here: https://oren.codes/2017/10/16/using-asp-net-core-with-azure-cloud-services/
Edit: Cannot be done with Azure Storage Emulator...
I really struggled with this as I found the documentation seriously poor with no proper examples, so here's a full example of my scripts and files for anyone else, based on Martin Brandl's answer. You do not need
webRoleEntryPoint
for only a web role. Only used for worker roles.Create a new empty cloud service in your project. This will generate empty
ServiceConfigiguration.Cloud.csfg
,ServiceConfigiguration.Cloud.csfg
andServiceDefinition.csdef
files for you as well as an empty roles folder. You could also add a web/worker role to let visual studio generate the configuration in them and then just modify them accordingly.Modify these files (change the
physicalDirectory
to your own):ServiceDefinition.csdef
:<Site name="Web" physicalDirectory="../SoundVast">
is the important line, thisphysicalDirectory
is relative to wherever your.csdef
file is located and I wanted to make my main projectSoundVast
the web role which was located one level up.ServiceConfiguration.Cloud.csfg
andServiceConfiguration.Local.csfg
(both can be the same):The important part is that the role name matches your
<Role name="WebRole1">
service definition files web role name.A
.cspkg
file should now have been generated at the location of your$PackagePath
.