SlideShare a Scribd company logo
Deploying to Azure Web Sites
Introduction
ThisdocumentdescribeshowtosetupanEPiServerCMSsite to run onAzure WebSites.Formore
informationsee Azure WebSites.Here anemptysite iscreatedfromVisual Studiointegrationbut
the most stepsdescribedappliestoothersitesaswell.
Create site
In Visual Studioselectcreate newProjectandchose EPiServerWebsite (eitherMVCor WebForms).
Note that thisrequiresEPiServerVisual Studioadd-ontobe installed.
Project references
Install NuGetpackagesEPiServer.Azure andEPiServer.CMS.Core tothe project(the referencesforthe
projectwill automaticallybe updatedtouse the NuGetpackagesinsteadof GACinstalledassemblies
whichisrequiredforpublishingthe site).
Create Azure resources
Create Azure Web Site
Openthe Azure managementportal andselectoption“WEBSITES” inthe leftmenu.Select“NEW”in
the bottomleftcornerand inthe dialogselect“CUSTOMCREATE”. Give an URL foryour website and
selectaRegionof your choice.Selectalsotocreate a new SQL database.Indatabase settingseither
selectanexistingseverorcreate a newone and give a login userandpassword.
Create Azure Storage
WhenrunningonAzure the media(forexample images) shouldbe storedinAzure blobstorage to
enable elasticscaling.Tocreate a blobstorage account go to the Azure Managementportal and
select“STORAGE”from the leftmenu.Select“NEW”in the bottomleftcornerandin the dialogselect
“QUICK CREATE”. Give an URL forthe storage andselecttocreate the storage account.
Tip: Create twoblobstorage accounts, one fordevelopmentandone forproduction,tomake iteasy
to switchbetweenthemusingjustthe connectionstring.
Create Service Bus
To be able toscale the site to run on several instanceswe needtosetupa Service Busto handle
messagesbetweenthe site instances.Tocreate a service busgo to Azure Managementportal and
select“SERVICEBUS” fromthe leftmenu.Select“CREATE”inthe bottommenuandin the dialog
selectanamespace name anda region.
Tip: Create twoservice busaccounts,one for developmentandone forproduction,tomake iteasy
to switchbetweenthemusingjustthe connectionstring.
Install database schema
OpenDeploymentCenterandchoose option“InstallSQLServerdatabase”.Inthe dialogthatopens
enterthe name of the SQL serverinAzure,the database userandpassword.The settingscanbe
foundinAzure Managementportal underthe createdAzure WebSite tothe right under“View
connectionstrings”.Indropdownselectthe database thatwascreatedduringcreationof Azure Web
Site.
Update configuration
EPiServer.Framework.config
OpenupEPiServer.Framework.configandaddthe followingblocktomapblobandeventprovidersto
Azure:
<blob defaultProvider="azureblobs">
<providers>
<add name="azureblobs"
type="EPiServer.Azure.Blobs.AzureBlobProvider,EPiServer.Azure"
connectionStringName="EPiServerAzureBlobs" container="MySiteMedia"/>
</providers>
</blob>
<event defaultProvider="azureevents">
<providers>
<add name="azureevents"
type="EPiServer.Azure.Events.AzureEventProvider,EPiServer.Azure"
connectionStringName="EPiServerAzureEvents" topic="MySiteEvents"/>
</providers>
</event>
Attribute containerforblobproviderand topicforeventprovidershouldbe unique persite within
the same storage or service busaccount.
connectionStrings.config
In connectionStrings.configchange connectionstringEPiServerDBtothe connectionstringfrom
Azure Managementportal (see Install databaseschema).Rememberthoughtokeepsetting
MultipleActiveResultSets=true.
Adda connectionstringnamed“EPiServerAzureBlobs”(aname thatmatchesthe settingin
EPiServer.Framework.configforthe provider).The connectionstringtothe blobstorage shouldbe in
format:
connectionString="DefaultEndpointsProtocol=https;AccountName=<name>;AccountKey=<key>"
where <name>iswhat wasgiveninsection“Create Azure Storage”.<key>can be foundinAzure
Managementportal under“Storage”if youselectthe name and thenselect“MANAGEACCESSKEYS”
inthe bottommenu.
Adda connectionstringnamed “EPiServerAzureEvents”(aname thatmatchesthe settingin
EPiServer.Framework.configforthe provider).The connectionstringtoService Buscanbe foundin
Azure Managementportal under“SERVICEBUS” if you selectthe name thatwas giveninsection
“Create Service Bus”and select“ACCESSKEY”in the bottommenu.
Tip: Connectionstringscanbe definedonanAzure WebSite underthe tab “CONFIGURE”whichis a
convenientwaytohave differentconnectionstringsforstagingandproduction.
episerver.config
In episerver.configchange the settingsiteUrl onelementepiserver/sites/site/siteSettingstothe site
that wascreatedundersection“Create Azure WebSite”.The URL can be foundinAzure
Managementportal under“WEB SITES” if you selectthe createdwebsite andselectdashboardin
the top menu.Thenthe site URL is giveninrightcolumn.
Web.config
The database schemafor Workflow3.5 (thatis the versionEPiServerCMScurrentlyuse) isnot
supportedinAzure database.Therefore the configurationforWorkflow persistence service mustbe
removed(thatisthe entrywithtype SqlWorkflowPersistanceService under
workflowServices/runtime).
The ASP.NETbuilt-inschemaformembership,role andprofile providersare notsupportedonSQL
Azure,therefore the configurationforthose SQLprovidersshouldbe changedtouse ASP.NET
Universal Providers(those are addedautomaticallytothe projectwheninstallingthe EPiServer.Azure
package).Change the providerstothe followingnew typesinweb.config:
System.Web.Providers.DefaultRoleProvider, System.Web.Providers
System.Web.Providers.DefaultMembershipProvider, System.Web.Providers
System.Web.Providers.DefaultProfileProvider, System.Web.Providers
Create an admin/edit user
Before deployingtoAzure create auserthat have access to adminandeditmode.Youdo thisby
configuringMultiplexingRoleProviderandMultiplexingMembershipProviderasdefaultprovidersto
enable Windowsauthenticationlocallyonyourmachine.Thenbrowse the site locallybutwiththe
database connectionstringsetupagainstthe database inAzure.Thengotoadminmode and under
“AdministerGroups”create twogroups WebAdminsandWebEditors.Thencreate auserthat is
memberof boththe createdgroups.Configure the site withSQLmembership/roleprovidersas
defaultprovidersandensure thatthe createdusercan loginandaccess adminmode.
Deployment using FTP
In Azure Managementportal youcan downloadapublishprofile forthe website byselectingthe site
and dashboardfromtop menu.Thenyoufind“Downloadthe publishprofile”inthe rightmenu.You
can use thisprofile lateronto publishyourtemplatesdirectlyforwithinVisualStudio.
If you openthe settingsfile youcanfindFTPaccesssettingsthere.OpenupaFTP client(forexample
FileZilla) andconnecttoyourAzure WebSite usingthe settings.
Navigate intowwwrootfolderonthe ftphostand sendoverfilesfromyourlocal site root(itis
enoughtosendfilesnecessarytorunsite like forexample bin,modulesbinetc.if youare uncertain
youcan sendall files).
Thennavigate one level uponftphost(foldercalledsite) anduploadappdatafoldertothat location.
Tip: Increase the numberof maximumparalleluploadsinFileZillatothe maximumof 10 to increase
uploadperformance whenyouuploadalarge amountof filessuchasappdata.
Deploying Content
The recommendedwaytotransferdatato an EPiServersite runningonAzure WebSitesistouse
EPiServerCMSExport/Importfunctionality.There are howeverotheroptionslike the migration
wizardto migrate an existingSQLServerdatabase.
Deployment through source control
It ispossible toconfigure Azure WebSitessoitusesacontinuousdeploymentfromsource code
control.It supportsforexample Git,GitHubandTFS. Fora full descriptionsee PublishfromSource
control.
Basicallyitworksinthe way that whenyoudoa committo yoursource control WindowsAzure will
getthe latestcode fromthe source control builditand deploy the outputtothe website(when
workingwithalocal git repositoryyoucaninsteadpushyourchangesto Azure WebSites).
Azure will buildyourprojectandpublishthe filesreferencedbythe projectinthe same wayas a
publishfromvisual studioworks.ForanEPiServerCMSsite there are some additional resourceslike
folderappdata (containsforexampleprotectedadd-ons) andfoldersmodules/modulesbin(that
containpublicadd-ons) thatare neededtobe able torun the site.
Here there are some optionsonhowto handle this additional resources.The synchronizationof files
whenAzure deploysfilestothe Azure WebSite worksso that it keepstrackof filesthatare inthe
code repositoryandonlythose filesare changedduringdeployment.Thatmeansthatmanually
transferredfileswillnotbe modified/deletedduringcontinuousdeployment.
No modules in source control
One optionisto not include those additionalfoldersinthe source code repositoryandinsteaduse
FTP to transferthe files. Additional add-onscanthenbe installeddirectlyonthe site runningon
Azure.
Modules included in source control
The other optionistohave the resourcesincludedinthe source code repository.Thenadd-onscould
be handledinthe waythat theyare firstinstalledonalocal site.Thenwhenverifiedthatthe add-on
workas expectedthe resource folderis committedandthendeployedtothe site runninginAzure.
Since the deploymenttothe website inazure onlyincludesfilesreferencedbythe projecta
modificationtothe deploymentneedstobe done sothe additional resourcesare includedinthe
deployment.
Duringthe deploymentprocesstoAzure website the “deployer”willlookforafile named
.deployment,if itexistitwill use itfordeploymentotherwise itwillcreate adefault.deploymentfile.
To be able tohandle additional resourcesthe .deploymentfile(oractuallythe dependent
deploy.cmd) needstobe modified.The firststeptodois to generate the fileslocally,how todothat
isdescribed here.The files.deploymentanddeploy.cmdshouldbe addedtosource control inthe
root (fora normal CMS projectthe source code repositoryrootshouldbe the foldercontaining
wwwrootandappdata).
Afterthat the deploy.cmdneedstobe modifiedsoitincludessynchronizationof appdata,modules
and modulesbinfolders. Asanexampleof amodifieddeploy.cmdfirstsome variablesare addedin
the setuppart afterthe onesalreadyinthe file,like:
SET NEXT_APPDATA_MANIFEST_PATH=%NEXT_MANIFEST_PATH%appdata
SET PREVIOUS_APPDATA_MANIFEST_PATH=%PREVIOUS_MANIFEST_PATH%appdata
SET NEXT_MODULESBIN_MANIFEST_PATH=%NEXT_MANIFEST_PATH%modulesbin
SET PREVIOUS_MODULESBIN_MANIFEST_PATH=%PREVIOUS_MANIFEST_PATH%modulesbin
SET NEXT_MODULES_MANIFEST_PATH=%NEXT_MANIFEST_PATH%modules
SET PREVIOUS_MODULES_MANIFEST_PATH=%PREVIOUS_MANIFEST_PATH%modules
setcurrent=%DEPLOYMENT_TARGET%
pushd..
setDEPLOYMENT_ROOT=%cd%
popd
Andin the deploymentpartsome additionaldeploymentcallsare addedlike:
call %KUDU_SYNC_CMD% -v 50 -f "%DEPLOYMENT_SOURCE%<wwwroot>modulesbin"-t
"%DEPLOYMENT_TARGET%modulesbin"-n"%NEXT_MODULESBIN_MANIFEST_PATH%" -p
"%PREVIOUS_MODULESBIN_MANIFEST_PATH%"
call %KUDU_SYNC_CMD% -v 50 -f "%DEPLOYMENT_SOURCE%<wwwroot>modules"-t
"%DEPLOYMENT_TARGET%modules"-n"%NEXT_MODULES_MANIFEST_PATH%" -p
"%PREVIOUS_MODULES_MANIFEST_PATH%"
call %KUDU_SYNC_CMD% -v 50 -f "%DEPLOYMENT_SOURCE%appdata"-t
"%DEPLOYMENT_ROOT%appdata"-n"%NEXT_APPDATA_MANIFEST_PATH%" -p
"%PREVIOUS_APPDATA_MANIFEST_PATH%"
Note that itusesa tool kuduSyncinsteadof forexample xcopy.kuduSyncwilluse manifestfilesto
keeptrack of whichfilesthatare presentina deployment.Thenatnextdeploymentitwill compare
the current state withthe previousmanifestfile andcanthendetermine whichfilesthathave been
added/deletedetc.

More Related Content

PDF
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
ODP
An Overview of Node.js
PDF
JavaDo#09 Spring boot入門ハンズオン
PPTX
Sherlock Homepage - A detective story about running large web services - NDC ...
PDF
Apache spark with akka couchbase code by bhawani
PDF
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
PDF
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
ODP
CodeIgniter PHP MVC Framework
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
An Overview of Node.js
JavaDo#09 Spring boot入門ハンズオン
Sherlock Homepage - A detective story about running large web services - NDC ...
Apache spark with akka couchbase code by bhawani
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
CodeIgniter PHP MVC Framework

What's hot (20)

PDF
Azure powershell management
ODP
Puppet and Apache CloudStack
PPTX
How to customize Spring Boot?
PDF
Spring Boot Actuator
PPTX
Provisioning in Microsoft Azure
PDF
Micronaut For Single Page Apps
PPTX
Ansible & CloudStack - Configuration Management
PPTX
06 integrate elasticsearch
PDF
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
PDF
Felix HTTP - Paving the road to the future
PPTX
03 integrate webapisignalr
PDF
The JavaFX Ecosystem
PPTX
Spring Boot & WebSocket
KEY
Multi Client Development with Spring
PDF
New features of Azure Cloud Provider in OpenShift Container Platform 3.10
PDF
Java Web Application Security - UberConf 2011
PDF
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
PDF
New features of Azure Cloud Provider at OCP 3.10
PDF
Word press, the automated way
PPTX
Bugzilla Installation Process
Azure powershell management
Puppet and Apache CloudStack
How to customize Spring Boot?
Spring Boot Actuator
Provisioning in Microsoft Azure
Micronaut For Single Page Apps
Ansible & CloudStack - Configuration Management
06 integrate elasticsearch
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Felix HTTP - Paving the road to the future
03 integrate webapisignalr
The JavaFX Ecosystem
Spring Boot & WebSocket
Multi Client Development with Spring
New features of Azure Cloud Provider in OpenShift Container Platform 3.10
Java Web Application Security - UberConf 2011
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
New features of Azure Cloud Provider at OCP 3.10
Word press, the automated way
Bugzilla Installation Process
Ad

Similar to Deploying to azure web sites (20)

PDF
Building Real World Application with Azure
DOCX
Creating an nuget package for EPiServer
PPTX
Sitecore on Azure
PDF
Azure web apps
PPTX
Azure rev002
PPTX
Building & managing wa app wely
PPTX
Building & Managing Windows Azure
PPTX
Get Started with Azure
PPTX
BizSpark Startup Night Windows Azure March 29, 2011
PPTX
Microsoft Azure
PPTX
Microsoft Azure Platform-as-a-Service (PaaS)
PPTX
70 533 - Module 01 - Introduction to Azure
PPTX
Don't be afraid of moving infrastructure into Azure!
PPTX
Go…Running Kentico CMS on Windows Azure
PPTX
Drupal DevOps on Microsoft Azure Websites
PDF
Microsoft Azure Online Training.pdf
PPTX
Gab 2018 seguridad y escalado en azure service fabric
PPTX
Gab 2018 seguridad y escalado en azure service fabric
DOCX
App development and deployment in microsoft azure
PPTX
Real World Azure - Dev
Building Real World Application with Azure
Creating an nuget package for EPiServer
Sitecore on Azure
Azure web apps
Azure rev002
Building & managing wa app wely
Building & Managing Windows Azure
Get Started with Azure
BizSpark Startup Night Windows Azure March 29, 2011
Microsoft Azure
Microsoft Azure Platform-as-a-Service (PaaS)
70 533 - Module 01 - Introduction to Azure
Don't be afraid of moving infrastructure into Azure!
Go…Running Kentico CMS on Windows Azure
Drupal DevOps on Microsoft Azure Websites
Microsoft Azure Online Training.pdf
Gab 2018 seguridad y escalado en azure service fabric
Gab 2018 seguridad y escalado en azure service fabric
App development and deployment in microsoft azure
Real World Azure - Dev
Ad

Recently uploaded (20)

PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Cloud computing and distributed systems.
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
cuic standard and advanced reporting.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Electronic commerce courselecture one. Pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
A Presentation on Artificial Intelligence
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The Rise and Fall of 3GPP – Time for a Sabbatical?
sap open course for s4hana steps from ECC to s4
Cloud computing and distributed systems.
A comparative analysis of optical character recognition models for extracting...
Unlocking AI with Model Context Protocol (MCP)
cuic standard and advanced reporting.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Electronic commerce courselecture one. Pdf
The AUB Centre for AI in Media Proposal.docx
Advanced methodologies resolving dimensionality complications for autism neur...
20250228 LYD VKU AI Blended-Learning.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Mobile App Security Testing_ A Comprehensive Guide.pdf
MYSQL Presentation for SQL database connectivity
A Presentation on Artificial Intelligence
Profit Center Accounting in SAP S/4HANA, S4F28 Col11

Deploying to azure web sites

  • 1. Deploying to Azure Web Sites Introduction ThisdocumentdescribeshowtosetupanEPiServerCMSsite to run onAzure WebSites.Formore informationsee Azure WebSites.Here anemptysite iscreatedfromVisual Studiointegrationbut the most stepsdescribedappliestoothersitesaswell. Create site In Visual Studioselectcreate newProjectandchose EPiServerWebsite (eitherMVCor WebForms). Note that thisrequiresEPiServerVisual Studioadd-ontobe installed. Project references Install NuGetpackagesEPiServer.Azure andEPiServer.CMS.Core tothe project(the referencesforthe projectwill automaticallybe updatedtouse the NuGetpackagesinsteadof GACinstalledassemblies whichisrequiredforpublishingthe site). Create Azure resources Create Azure Web Site Openthe Azure managementportal andselectoption“WEBSITES” inthe leftmenu.Select“NEW”in the bottomleftcornerand inthe dialogselect“CUSTOMCREATE”. Give an URL foryour website and selectaRegionof your choice.Selectalsotocreate a new SQL database.Indatabase settingseither selectanexistingseverorcreate a newone and give a login userandpassword. Create Azure Storage WhenrunningonAzure the media(forexample images) shouldbe storedinAzure blobstorage to enable elasticscaling.Tocreate a blobstorage account go to the Azure Managementportal and select“STORAGE”from the leftmenu.Select“NEW”in the bottomleftcornerandin the dialogselect “QUICK CREATE”. Give an URL forthe storage andselecttocreate the storage account. Tip: Create twoblobstorage accounts, one fordevelopmentandone forproduction,tomake iteasy to switchbetweenthemusingjustthe connectionstring. Create Service Bus To be able toscale the site to run on several instanceswe needtosetupa Service Busto handle messagesbetweenthe site instances.Tocreate a service busgo to Azure Managementportal and select“SERVICEBUS” fromthe leftmenu.Select“CREATE”inthe bottommenuandin the dialog selectanamespace name anda region. Tip: Create twoservice busaccounts,one for developmentandone forproduction,tomake iteasy to switchbetweenthemusingjustthe connectionstring. Install database schema OpenDeploymentCenterandchoose option“InstallSQLServerdatabase”.Inthe dialogthatopens enterthe name of the SQL serverinAzure,the database userandpassword.The settingscanbe foundinAzure Managementportal underthe createdAzure WebSite tothe right under“View connectionstrings”.Indropdownselectthe database thatwascreatedduringcreationof Azure Web Site.
  • 2. Update configuration EPiServer.Framework.config OpenupEPiServer.Framework.configandaddthe followingblocktomapblobandeventprovidersto Azure: <blob defaultProvider="azureblobs"> <providers> <add name="azureblobs" type="EPiServer.Azure.Blobs.AzureBlobProvider,EPiServer.Azure" connectionStringName="EPiServerAzureBlobs" container="MySiteMedia"/> </providers> </blob> <event defaultProvider="azureevents"> <providers> <add name="azureevents" type="EPiServer.Azure.Events.AzureEventProvider,EPiServer.Azure" connectionStringName="EPiServerAzureEvents" topic="MySiteEvents"/> </providers> </event> Attribute containerforblobproviderand topicforeventprovidershouldbe unique persite within the same storage or service busaccount. connectionStrings.config In connectionStrings.configchange connectionstringEPiServerDBtothe connectionstringfrom Azure Managementportal (see Install databaseschema).Rememberthoughtokeepsetting MultipleActiveResultSets=true. Adda connectionstringnamed“EPiServerAzureBlobs”(aname thatmatchesthe settingin EPiServer.Framework.configforthe provider).The connectionstringtothe blobstorage shouldbe in format: connectionString="DefaultEndpointsProtocol=https;AccountName=<name>;AccountKey=<key>" where <name>iswhat wasgiveninsection“Create Azure Storage”.<key>can be foundinAzure Managementportal under“Storage”if youselectthe name and thenselect“MANAGEACCESSKEYS” inthe bottommenu. Adda connectionstringnamed “EPiServerAzureEvents”(aname thatmatchesthe settingin EPiServer.Framework.configforthe provider).The connectionstringtoService Buscanbe foundin Azure Managementportal under“SERVICEBUS” if you selectthe name thatwas giveninsection “Create Service Bus”and select“ACCESSKEY”in the bottommenu. Tip: Connectionstringscanbe definedonanAzure WebSite underthe tab “CONFIGURE”whichis a convenientwaytohave differentconnectionstringsforstagingandproduction. episerver.config In episerver.configchange the settingsiteUrl onelementepiserver/sites/site/siteSettingstothe site that wascreatedundersection“Create Azure WebSite”.The URL can be foundinAzure Managementportal under“WEB SITES” if you selectthe createdwebsite andselectdashboardin the top menu.Thenthe site URL is giveninrightcolumn. Web.config The database schemafor Workflow3.5 (thatis the versionEPiServerCMScurrentlyuse) isnot supportedinAzure database.Therefore the configurationforWorkflow persistence service mustbe
  • 3. removed(thatisthe entrywithtype SqlWorkflowPersistanceService under workflowServices/runtime). The ASP.NETbuilt-inschemaformembership,role andprofile providersare notsupportedonSQL Azure,therefore the configurationforthose SQLprovidersshouldbe changedtouse ASP.NET Universal Providers(those are addedautomaticallytothe projectwheninstallingthe EPiServer.Azure package).Change the providerstothe followingnew typesinweb.config: System.Web.Providers.DefaultRoleProvider, System.Web.Providers System.Web.Providers.DefaultMembershipProvider, System.Web.Providers System.Web.Providers.DefaultProfileProvider, System.Web.Providers Create an admin/edit user Before deployingtoAzure create auserthat have access to adminandeditmode.Youdo thisby configuringMultiplexingRoleProviderandMultiplexingMembershipProviderasdefaultprovidersto enable Windowsauthenticationlocallyonyourmachine.Thenbrowse the site locallybutwiththe database connectionstringsetupagainstthe database inAzure.Thengotoadminmode and under “AdministerGroups”create twogroups WebAdminsandWebEditors.Thencreate auserthat is memberof boththe createdgroups.Configure the site withSQLmembership/roleprovidersas defaultprovidersandensure thatthe createdusercan loginandaccess adminmode. Deployment using FTP In Azure Managementportal youcan downloadapublishprofile forthe website byselectingthe site and dashboardfromtop menu.Thenyoufind“Downloadthe publishprofile”inthe rightmenu.You can use thisprofile lateronto publishyourtemplatesdirectlyforwithinVisualStudio. If you openthe settingsfile youcanfindFTPaccesssettingsthere.OpenupaFTP client(forexample FileZilla) andconnecttoyourAzure WebSite usingthe settings. Navigate intowwwrootfolderonthe ftphostand sendoverfilesfromyourlocal site root(itis enoughtosendfilesnecessarytorunsite like forexample bin,modulesbinetc.if youare uncertain youcan sendall files). Thennavigate one level uponftphost(foldercalledsite) anduploadappdatafoldertothat location. Tip: Increase the numberof maximumparalleluploadsinFileZillatothe maximumof 10 to increase uploadperformance whenyouuploadalarge amountof filessuchasappdata. Deploying Content The recommendedwaytotransferdatato an EPiServersite runningonAzure WebSitesistouse EPiServerCMSExport/Importfunctionality.There are howeverotheroptionslike the migration wizardto migrate an existingSQLServerdatabase. Deployment through source control It ispossible toconfigure Azure WebSitessoitusesacontinuousdeploymentfromsource code control.It supportsforexample Git,GitHubandTFS. Fora full descriptionsee PublishfromSource control. Basicallyitworksinthe way that whenyoudoa committo yoursource control WindowsAzure will getthe latestcode fromthe source control builditand deploy the outputtothe website(when workingwithalocal git repositoryyoucaninsteadpushyourchangesto Azure WebSites).
  • 4. Azure will buildyourprojectandpublishthe filesreferencedbythe projectinthe same wayas a publishfromvisual studioworks.ForanEPiServerCMSsite there are some additional resourceslike folderappdata (containsforexampleprotectedadd-ons) andfoldersmodules/modulesbin(that containpublicadd-ons) thatare neededtobe able torun the site. Here there are some optionsonhowto handle this additional resources.The synchronizationof files whenAzure deploysfilestothe Azure WebSite worksso that it keepstrackof filesthatare inthe code repositoryandonlythose filesare changedduringdeployment.Thatmeansthatmanually transferredfileswillnotbe modified/deletedduringcontinuousdeployment. No modules in source control One optionisto not include those additionalfoldersinthe source code repositoryandinsteaduse FTP to transferthe files. Additional add-onscanthenbe installeddirectlyonthe site runningon Azure. Modules included in source control The other optionistohave the resourcesincludedinthe source code repository.Thenadd-onscould be handledinthe waythat theyare firstinstalledonalocal site.Thenwhenverifiedthatthe add-on workas expectedthe resource folderis committedandthendeployedtothe site runninginAzure. Since the deploymenttothe website inazure onlyincludesfilesreferencedbythe projecta modificationtothe deploymentneedstobe done sothe additional resourcesare includedinthe deployment. Duringthe deploymentprocesstoAzure website the “deployer”willlookforafile named .deployment,if itexistitwill use itfordeploymentotherwise itwillcreate adefault.deploymentfile. To be able tohandle additional resourcesthe .deploymentfile(oractuallythe dependent deploy.cmd) needstobe modified.The firststeptodois to generate the fileslocally,how todothat isdescribed here.The files.deploymentanddeploy.cmdshouldbe addedtosource control inthe root (fora normal CMS projectthe source code repositoryrootshouldbe the foldercontaining wwwrootandappdata). Afterthat the deploy.cmdneedstobe modifiedsoitincludessynchronizationof appdata,modules and modulesbinfolders. Asanexampleof amodifieddeploy.cmdfirstsome variablesare addedin the setuppart afterthe onesalreadyinthe file,like: SET NEXT_APPDATA_MANIFEST_PATH=%NEXT_MANIFEST_PATH%appdata SET PREVIOUS_APPDATA_MANIFEST_PATH=%PREVIOUS_MANIFEST_PATH%appdata SET NEXT_MODULESBIN_MANIFEST_PATH=%NEXT_MANIFEST_PATH%modulesbin SET PREVIOUS_MODULESBIN_MANIFEST_PATH=%PREVIOUS_MANIFEST_PATH%modulesbin SET NEXT_MODULES_MANIFEST_PATH=%NEXT_MANIFEST_PATH%modules SET PREVIOUS_MODULES_MANIFEST_PATH=%PREVIOUS_MANIFEST_PATH%modules setcurrent=%DEPLOYMENT_TARGET% pushd.. setDEPLOYMENT_ROOT=%cd% popd
  • 5. Andin the deploymentpartsome additionaldeploymentcallsare addedlike: call %KUDU_SYNC_CMD% -v 50 -f "%DEPLOYMENT_SOURCE%<wwwroot>modulesbin"-t "%DEPLOYMENT_TARGET%modulesbin"-n"%NEXT_MODULESBIN_MANIFEST_PATH%" -p "%PREVIOUS_MODULESBIN_MANIFEST_PATH%" call %KUDU_SYNC_CMD% -v 50 -f "%DEPLOYMENT_SOURCE%<wwwroot>modules"-t "%DEPLOYMENT_TARGET%modules"-n"%NEXT_MODULES_MANIFEST_PATH%" -p "%PREVIOUS_MODULES_MANIFEST_PATH%" call %KUDU_SYNC_CMD% -v 50 -f "%DEPLOYMENT_SOURCE%appdata"-t "%DEPLOYMENT_ROOT%appdata"-n"%NEXT_APPDATA_MANIFEST_PATH%" -p "%PREVIOUS_APPDATA_MANIFEST_PATH%" Note that itusesa tool kuduSyncinsteadof forexample xcopy.kuduSyncwilluse manifestfilesto keeptrack of whichfilesthatare presentina deployment.Thenatnextdeploymentitwill compare the current state withthe previousmanifestfile andcanthendetermine whichfilesthathave been added/deletedetc.