c# - Correctly deploying multiple sites in a single Azure role -
i can deploy multiple c# .net 4.5 websites single azure web role, want know whether it's correct way physicaldirectory
attribute in .csdef
file points \websitex\bin\release
directory of each website being deployed :
<?xml version="1.0" encoding="utf-8"?> <servicedefinition name="cloudservice" xmlns="http://schemas.microsoft.com/servicehosting/2008/10/servicedefinition" schemaversion="2015-04.2.6"> <webrole name="mywebrole" vmsize="small"> <sites> <site name="websitex" physicaldirectory="..\..\..\websitex\bin\release"> <bindings> <binding name="http" endpointname="http" hostheader="websitex.cloudapp.net" /> </bindings> </site> <site name="websitey" physicaldirectory="..\..\..\websitey\bin\release"> <bindings> <binding name="http" endpointname="http" hostheader="websitey.cloudapp.net" /> </bindings> </site> </sites> <endpoints> <inputendpoint name="http" protocol="http" port="80" /> </endpoints> </webrole> </servicedefinition>
i have seen in posts these : can deploy multiple webapps on 1 windows azure instance? / http://www.wadewegner.com/2011/02/running-multiple-websites-in-a-windows-azure-web-role physicaldirectory
attribute points towards looks root directory of website deployed (just \websitex
.csproj
file resides, if i'm not mistaken?)
however when point .csdef
physicaldirectory
location (\websitex
) , deploy azure, process deploys in directory. every folder , file gets copied as-is azure.
here .csdef
use seems cleaner , used in many examples on web. note lack of \bin\release
.
<?xml version="1.0" encoding="utf-8"?> <servicedefinition name="cloudservice" xmlns="http://schemas.microsoft.com/servicehosting/2008/10/servicedefinition" schemaversion="2015-04.2.6"> <webrole name="mywebrole" vmsize="small"> <sites> <site name="websitex" physicaldirectory="..\..\..\websitex"> <bindings> <binding name="http" endpointname="http" hostheader="websitex.cloudapp.net" /> </bindings> </site> <site name="websitey" physicaldirectory="..\..\..\websitey"> <bindings> <binding name="http" endpointname="http" hostheader="websitey.cloudapp.net" /> </bindings> </site> </sites> <endpoints> <inputendpoint name="http" protocol="http" port="80" /> </endpoints> </webrole> </servicedefinition>
what doing wrong cannot use second .csdef
file ? why deployment second .csdef
deploy whole project directory azure rather website's binaries ? there out-of-the-box missing, or custom post-build scripts needed ?
Comments
Post a Comment