Website Projects in Azure Web Role

前端 未结 2 1608
孤城傲影
孤城傲影 2021-02-04 09:34

I am researching a new ASP.Net project that we would like to host in a Windows Azure Web Role. One of the technical requirements of this project is to make use of the full pre-c

相关标签:
2条回答
  • 2021-02-04 09:45

    Okay, I was struggling with the same problem for couple of days, here is the step-by-step guide

    (1) Publish your website project to a folder (for my case is "PrecompiledWeb\WebSite1", which resides in the sub folder of my azure project)

    (2) Modify your service definition(.csdef), adding a webrole

    <WebRole name="WebSite1" enableNativeCodeExecution="true">
    <InputEndpoints>
      <InputEndpoint name="HttpIn" protocol="http" port="80" />
    </InputEndpoints>
    <ConfigurationSettings />
    </WebRole>
    

    (3) Run the following command(CSPack) at command prompt

    cspack CloudService1\ServiceDefinition.csdef /role:WebRole4;WebRole4 /role:WorkerRole1;WorkerRole1\bin\Debug;WorkerRole1.dll /role:WebSite1;PrecompiledWeb\WebSite1 /out:CloudService1.cspkg /generateConfigurationFile:"ServiceConfig.cscfg"

    (4) Basically you are almost done!

    Good luck! ;)

    0 讨论(0)
  • 2021-02-04 09:51

    The short answer is yes, but it isn't easy.

    One of the cool things about Azure is that almost anything copy-deployable can be deployed to Azure. As such you web site project can be deployed. The difficult part is that the Visual Studio tools don't currently (and may not ever) support it. You'll need to use the CSPack command line tool to package your deployment.

    0 讨论(0)
提交回复
热议问题