 Good morning everybody. Welcome or good afternoon. Welcome to my session. This is running Drupal on Microsoft's cloud platform, Windows Azure. My name is Mark Brown. I work for Microsoft. I am in the Windows Azure product team. My primary job is I oversee all the marketing and community work and I'm focused primarily around everything web workload. So I oversee a number of services that are related to web developers, building web applications and deploying them on Azure. Up on the screen is my email address. Feel free to send me an email if you have a question or anything you see from today's session or you can follow me or just harass me on Twitter if you want to. So this session is primarily all demo. So those are the slides. So I wanted to talk to you about running Drupal on Windows Azure and despite the name Windows in the name, you don't need Windows to run Drupal on it. You can use pretty much any operating system you want. I'm going to do all my demos here from a Mac so primarily everything you're going to see now is going to be in the shell or terminal window. So why don't we get started? So what I'm going to do is I'm going to navigate to... Whoops, that's the wrong one. I'm going to navigate to my map directory here and see I've got just a few websites up on here. So the first thing I want to do is I want to go and do a git clone for Drupal. So I'm going to type this in git clone, specify the branch here, 7.23 and Drupal.org slash Drupal.git and I'm going to put that in, I'll call it my Drupal 2 directory. What if I misspell here? I connected to Drupal.com, I am. What did I miss? gitdrupal.org Ah, I know what I missed. Project slash Drupal.git and that'll go into my Drupal 2 directory. So we'll give that just a moment. So let's let that run for just a second. While that's running, I'm going to go to my browser. So this is the portal for Windows Azure and I'll click all the items here. You can filter different services and accounts down the left side here. And you can see I've got a number of different storage accounts. This thing is full of videos. I have some virtual machine images in here that I'll have Drupal on them. A bunch of different stuff. I've got some website logs in there and here's a couple of VMs. These are a couple of Drupal sites running on Ubuntu and some cloud services and I've got some websites down here in the bottom. So the first thing I want to do while that's cloning into that directory is we'll go ahead and create a new empty shell. So I'm going to say new compute website and then I'll select say custom create and I'll call this one Drupal 2 as well and I will select it in the western US. So where I select the region is going to matter because the second thing that's of course after I create this web website is I'm also going to use MySQL but MySQL is a service and my instance for MySQL server is going to be in the western US. So of course I want my Drupal site to be in the same region or the same data center as my database. Next thing I do here is say publish from source control and then what happens next is I get a choice of different source code repositories I can publish from. So I can select an external one here. This supports for both Git and Macurial, Git, bucket, even Dropbox. God forbid you want to publish from Dropbox but some people may. I'll select Git, local Git repository here and then that will take a few minutes to get started. So let's run it. We'll go back here and this is almost done. Awesome. So now I'll do the directory and there's my Drupal site. So let's do a Git, create a new branch here, master, awesome, so let's check this. Okay, nothing to commit, that's great. Is that everything in here? No, fine. Okay, so let's go back to our website. There and that's all done. So let's go ahead and click into here and I'll come back and show you more of the dashboard later. What I want to do right now is I want to go get my Git remote out of here. So I'm going to click on the deployments tab and you can see it just has some directions on how to use Git to connect your site locally. So we'll go ahead and copy that and then we'll come back to here and then I'll add a remote and we'll call that remote azure and paste that in. Great. Okay, so we've got the new Drupal site cloned. We've got it all set up in Git. Next, let's go ahead and fire this thing up. Go quick install here. I have a database. I need to create a database. So let's call this, go into phpy admin here, select my local host and let's create a database. 2db, so of course, super secret username and password here. Maybe 20 bucks if you can guess what that is. All right, so we'll call this Drupal 02. My email address. Awesome. Okay, that's all done. So now I've got my site all set up, database is built out, everything's ready to go. Let's go back to here, commit it. All right, let's try it. All right, so now what I'm going to do is I'm going to go ahead and push this to the remote. So this is going to be the remote name is azure and then the branch here master. And I'll put in my password for my directory or my website. So this is the password I have up on here. So that's going to go ahead and push. So when you create a new website, actually when you create a new subscription, credentials that you can reset or set here. So I'm not going to do that here. Okay, so now I've got a deployment coming. So the scene is working. See how this is coming along almost there. This Wi-Fi at Drupal kind is amazingly fast, I have to say. So solid rock solid all week. Okay, keep pushing almost done. All right, we'll give that a minute. So while that's going, the next thing I want to show you is a remote database. So with windows azure, we provide windows or my SQL through a partner called clear DB. And the way you do that is you go to the azure store and you select add-ons. And we have a number of different add-ons in here. We have partners from App Dynamics, Engine Yard, Lucidworks that provide solar search, New Relics, SendGrid, Mongo Lab, which provides MongoDB. And these basically all provide services that run on azure. I'm going to select clear DB. So they provide my SQL as a service. And if you want, you can go and sign up for free or you can go and sign up and get different size databases so you can buy a one gig, five gig, ten gig, or any size you want. I'm going to log into my portal here. And here you can see I have a number of databases all set up. Click on this one here. And these databases all sit in the western US data center. Here's a little dashboard that just shows performance of this thing. The size is zero because I cleaned it out before then. These guys are really cool because they automatically manage all your backups, failovers, everything in there. So if you ever have any problems, you can go right in and just click on it, restore it in there. Everything's good. Just some more information. Here's the endpoints on these things here. Use the names and passwords. Of course, I'm not going to have to change that since you've all seen it. So that's that. So let's check on. Okay, this is all set. So next thing I want to do, I showed you my remote database here. I obviously have my local one here. Here's my Drupal 2 database. And then the other thing I want to show you is I have this setup to have multiple server connections. So this thing can also point. This is my database. The database is run by ClearDB that are sitting out in the Western U.S. Azure Data Center. And then here's the database I'm going to publish this into. And this is perfectly empty, so ready to go. So now what I want to do is what you would normally do when you're deploying your new site or deploying a site is do a backup and restore my database. So to do that, I am going to say my SQL dump. Told you that was super secure. And then let's do this in a single transaction. Drupal O2DB. And then what I want to do is I want to pipe this over to the remote database. So put a pipe in there. My SQL. And you and it's obnoxious. So I'm going to cut and paste that password. Where are you? I'll just cut and paste the rest of that because I hate typing. I'll just stick it right there. Nope, that didn't work. I just do that thing there. There we go. So a couple of things to keep in mind here. You notice I didn't use SSH. And the reason is because this MySQL as a service is actually running on Windows. What you can do is use SSL. So if I want to keep this secure, and you notice I didn't use SSL in there, but you can use dash dash SSL. And then use SSL to secure the traffic between the two there. So that's going to take a few minutes. Just let that run. So database has been backed up and restored. And let's just go give that a little quick check. Great. There's all my tables. So let's fire up our site. So Microsoft, in Azure, we have this really cool CLI tool. And if I just type back-back-azure, there you can see some pretty little ASCII art there. This is all written in Node.js. So it's pretty easy to install. Just install Node. And then just go npm install azure slash g. And you can install our CLI tools. So what I want to do is azure site, browse, Drupal 2. And this is my favorite thing to show, but I like opening a browser from the command line. All right. So the first thing it's going to do, I need to connect up my new site and my database. So I'll just start this here. And then plug in my database info. This will get going. Okay. So I've got that all saved here. Where are you? I'll do that. Database, username, password. And then I need to select my host and then save. Cool. And there it is. So there we are. Now running up on Azure websites, all from a Mac, pretty much all from the command line. So some other things. You notice I kind of did this in a rather amateurish way, I guess. The thing I wanted to point out is you can pretty much do it any way you want. I could have updated settings, PHP, and then push the whole thing and not had to go through and run the install again. One thing I can't do is I can't run Drush. So Azure websites is basically running on Windows, along with the MySQL database. So it doesn't support SSH, so you can't install Drush on there. So you miss out on all the cool things like being able to do R-sync and other stuff like that. But I think you can use get, and you can run it locally and do all your other stuff and just use get to do your push and scripts to do your backup of a restore. So it's relatively easy to use a Mac to go ahead and use this and use Azure websites to host your Drupal sites. So here's my active deployment. So I want to show you a couple things that I think, despite the fact that it's not running Unix, it's pretty cool about Azure websites. Right now, when I created this new site, it's running in our free shared environment. So this is, of course, running on one server with lots of other sites running with it as well. Scaling is really easy, and this is why Azure websites is really a path for web hosting. If I want to scale this, I can just click this here, and then I can select multiple instances. So running on Windows, this will fire up additional processes that I'll handle inbound requests and also load balance them automatically. So by one, I can select shared and I go selected three instances. And so now what Azure websites is doing is it's provisioning additional instances, and then those instances will go ahead and handle all my inbound requests. So we'll give that a second. Boom, now I'm done. So I can scale it out relatively easily just from using the slider here. If I want, I can scale this thing out to full VM. So we'll go ahead and I'll just select Drupal 2, my site here, and then I can select the instance size. So these are VM sizes, so I can select the small core or a medium size two cores or even a large four core seven gigs. So let's go ahead and we'll just select that. Click save. It'll ask me to confirm. I say yes. So now what's happening is Azure websites is provisioning a brand new VM and then it's going to take my site and it's going to deploy it right on that VM. So this is really easy. I don't have to pick up my code. I don't have to redeploy anything. I don't have to go to Git. I don't have to do anything. It's going to handle it for me. So it looked like I may have had an issue. We did not be saved. Let's figure out what's going on there. I've got it one more time. That's always embarrassing when you're... Let's try this. There's one. The demos don't work. So the nice thing is if you move... Awesome. All right. For some reason I'm not able to scale this up into its own VM. Not quite sure why. We'll try it again. So the nice thing here is once you scale this thing up into its own virtual machine... Oh, there it goes. No, I'm running it. Once you scale it up into its virtual machine you can deploy additional websites into it. So you saw here this little thing. I could have scaled up multiple sites into it. Well, in fact, I could scale or run up to 500 sites into this single VM, which is actually pretty cool. So I can create one virtual machine, run up to 500 sites on it, all connected to databases that are running in the same data center, and functionally it's all running as kind of a pass. Now the nice thing about that is you might think, well, or confusing thing is why would I run 500 sites on a single virtual machine? The reason is because I can set up autoscaling in here. So what I need to do is just select CPU. This is already selected to autoscale. Here's a little thing here that shows you kind of your performance for the site. And then I can say I want to run between 1 and 5 or maybe even up to 10 instances in there and then select the target CPU range. So once this thing starts to get up into between 60 and 80 and up into the 80s, it'll start provisioning additional VMs and load balancing across them. And then when it gets to 60 or below, it'll start deprovisioning them. So this is pretty cool. If you're like most agencies or Drupal shops, you have a lot of customers and most of them have websites that don't get a whole lot of traffic. And then you have a few numbers of websites that do get a lot of traffic. But even then their traffic may be somewhat spiky. So now what you've got is the ability to deploy and run only the number of websites you absolutely have to have or need. So this is great because you don't have to spend for what you're not using. And here it is. So I've set it up. I can run anywhere from 1 to 10. If I want, I can call support or you can call support and say, hey, I'd like more than 10 instances. Or if you want, you can set the bottom and say, I don't want to run at least four VMs and all the way up to 10 or more in there. So pretty flexible. You can set it to pretty much do it whatever you want. All right. So that's Azure website. So the next thing I want to show you is virtual machines. So while this runs on Windows, and so is the MySQL surface there, we also offer virtual machines in here. Here you see I have a couple of VMs running. These are both running on Ubuntu. And in fact, they're both running Drupal. I can kind of show you. I run a little community program called Windows Azure Insiders. And I have a Drupal site I've set up. And basically what this site does is it curates content. These guys create. So it goes through, runs a cron job every three or four hours and goes and cycles through all their blogs and says, hey, has anybody written a new blog post? And then it pulls it into a approval queue and I review and approve them. So here I've got a list of blog posts. Here's some events that I pull out of Lanyard. Here's some GitHub repos, some answers on Stack Overflow and some decks off of SlideShare. So basically this thing is just a big content curation engine. I chose Drupal because Drupal is really good at handling stuff like this. So that runs on a couple of Ubuntu VMs here. Why don't we go and create a new one? So I'll say, let's say that was maybe too fast, new and compute and virtual machine. And I can do a quick create or let's do one from the gallery. So as you might expect, we have multiple versions of Windows server in here and also other products too, like SharePoint server, SQL server, Biz Talk server. And then recently we just started putting up Oracle software. So we have their web server, Oracle database, Java and then further down we've got multiple flavors of Linux. So we've got a couple flavors of SUSE, Ubuntu, CentOS, here's Oracle Linux. And then at the bottom here I've got some pre-built images. So these in fact are images that I've created. So I've got a Drupal 7 one here. This is from Bitnami. These are basically AMIs that you would find in AWS. So we have the same thing in Windows Azure. Here's a, this is Drupal 8. I think this came out of a code sprint. And then I have just a plain old LAMP stack one here. So let me go back. If you're curious I can show you where those come from. So if you click on images in here, a new button comes up and that's Browse VM Depot. So this will take me out to where we have all these AMIs in here. And so within here you can select a different Linux server. I'll select Ubuntu. And then you've got a whole ton of different things. So here's Solar, CBCRM, Concrete, Scores, DocuWiki. And then you've got a whole ton of different flavors of Drupal in here. Going from versions of 6, 7.238.0. Here's this code sprint one that somebody uploaded. And then all I have to do is just select one of these. And then click Next. I have to copy the image. So it goes from being an image out on our virtual machine depot. And then I copy that into my storage account. So I'll say I want to put that image in the western US. I'll select my subscription. And then I have a storage account of just Drupal images. I'll go and stick it in there and then click Yes. And so that'll copy. And that takes some time. Man, I'm having a hell of a time with my demo today. Well, that's OK because I've already got a copy of Drupal 7 out here. So let's go ahead and create a new VM. I'll just do a gallery here. And then I'll select my images. I'll select Drupal 7. And we'll just call this NJVDrupalVM1. And I'll select a medium core. Give it a new name here. And if I want, I can upload SSH key for authentication. So I can use that. Or I can just provide a password next. So with Windows Azure, something that's new to people is the VMs themselves don't provide a DNS name. So you have to create what's called a cloud service. So for this, I'm going to create a new cloud service. And then I'll call it, oh, it doesn't like that name. So I'll call it VM11. So here it's resolving to make sure it'll fit. So this will be the DNS name for my VM. MJVDrupalVM11.cloudapp.net. Also below here, I can select a virtual network I want to run it in. Virtual networks allow you to do things like create site to site so I can connect a range of virtual machines into my local network or I can do a VPN into them. I'm just going to select a region here and then click Next. Next it's going to ask me what ports I want to open. So this is going to be a Drupal site. So I want to open up HTTP, port 80 and say HTTPS on 443. And then of course you want to open up SSH. And then just click Next. So that's going to start provisioning right now. Now I did this in the browser or yeah, in the browser. If I want, I can also do this in here as well. So I showed you a little earlier. We have the CLI tools and I just typed Azure. So I can go ahead and say Azure VM list. And then what this will do is it will list all the virtual machines I have in there. So you saw I had this one and this one that I showed you earlier and then here's the new one. And then it says ready roll state unknown, which means it's just getting started. So it's provisioning. So let's go ahead and create a VM from the command line. So I'll go ahead and type Azure VM create. We'll call this MJB Drupal 702. And then what I'm going to do is I'm going to use, here actually before I do that, I wanted to show you is Azure VM image list. So just in the portal as I showed you, we had all of those images in there. These are a whole bunch of Microsoft things and the Oracle things and all kinds of other stuff. My ones come up show up in here as well. So here's this Drupal 7 image that I went and provisioned earlier. It showed up in a list of my images. So I'm going to create a new VM using that. So Azure VM create MJB Drupal 702. And then the image name Drupal-7. And we'll give it my name. And I need to give it a password. We'll make it, yeah, super secure. I'll stick that in there. Nobody will ever guess that is my password. Then select the VM size and we'll make that small. I have to set a location West US. And then of course, go ahead and open that port. Right. So it's looking up the image, grabbing this one here. Look at the cloud service making sure that I can make a VM called MJB Drupal 702 because the full DNS name for that will be MJB Drupal 702.cloudapp.net. And now it's actually going and provisioning the VM. And if I go back to the portal here, I can see this one's still running. And then this one's also just getting started as well. So Azure VM list. And so here's my new list of Azure VMs. Here's the new one. This is ready state on roll state unknown. So it's just getting provisioned right now. And then the other one I created, the MJB Drupal VM1 is still provisioning. This has come back. So what I want to do is I need to want to load balance a couple of VMs here across it. So to do that, I'm going to create an endpoint, a load balance endpoint. What I'm going to do is I'm going to type Azure VM endpoint create. And then I'm going to give it the VM name. So that is going to be MJB Drupal 702. And then I want to say what port. So to specify that's the public IP, private IP. This is almost the same as what I was showing earlier. And then I need to give it in the portal when I was creating endpoints. Next, I want to give it an endpoint name and call that HTTP. And then I need to create a load balance set name. So I'm going to specify, whoops, LB set name. Let me just call this front end load balancer. Next thing is to specify a pro port. So pro port 80. And then a protocol, let's call that's TCP. If I type that right, it should create a new endpoint that I can then join another VM to so that it will load balance across both those VMs. Now, if I wanted to, I wouldn't have, I didn't, I didn't have to do that. I could provision another VM run engine X on it and then use that to do all the load balancing. But Windows Azure, we provide load balancing. So you can use it. We also provide load balancing that works across data centers. So if you want, you can use something called traffic manager. And so you can deploy a Drupal site and say our Northern data center and then another one in the US. And then customers that hit it or hit that end point or your URL will go through traffic manager and then traffic manager will figure out which is the closest data center to serve the request. You can also use it as a failover as well. So if your site goes down in a data center, you can fail over all the traffic to go to another data center so that your site stays up. All right. So that went and created that. Let's check Azure VM list. Yep. So everything's ready roll. So it's all set to go and I can confirm that by looking in here and everybody's up and running. So next last thing I'll show you is we're going to create another VM. So Azure VM creates MVP Drupal 07 Drupal 703. And then I will cut and paste some text in here. This way faster. This will be faster. Then I can talk about what I'm doing. All right. So I'm going to create. Oh, that's the wrong one. Thank God. Let's just do this. Azure VM create and JB Drupal 703. And then the image Drupal 7 password. My VM name. And then this one I'm going to call and JB actually got that wrong. Sorry. I'm going to give it the same name and JB Drupal 702 because I'm going to join this to the same cloud service. The first one I did create, but I'm going to give it a different VM name. So image is Drupal 7. And then then username, password, and then the name. And that one I'm going to call and JB Drupal 703. And then the size, small location should be in the same data center. I'm going to connect it to MJB Drupal 702. And then the last thing I'm going to do is set the SSH port. So here's the thing. I'm connecting it using the same cloud service DNS endpoint. I have to use a different port for SSH if I want a VM or SSH into the different VM. So for that, I'm going to select SSH port 2222. So now this will go and create a new VM. And we'll just give that a minute. Okay, so that VM has been created. So now what I'm going to do is I'm going to create another endpoint. And then this will load balance it over it. So Azure VM endpoint creates and JB Drupal 703. And then public port, private port, and point name, whoops, HTTP. And then my load balance set name and load balancer. And then my set my pro port to 80 and protocol TCP. Okay, so this is going to go create another endpoint. And then what'll happen, I've now have load balancing set up that'll basically share it equally across both those Linux VMs running Drupal. Now, obviously if I was doing this for real, I would set up Drupal and put all the files on a file share. And then I would obviously run the two front end servers to point to that same thing. And then I'd set up a third machine. Or if I wanted, I would set up another machine run engine X on that and then load balance across those two there. Maybe set up yet another machine run varnish on that. So point is you can create basically the same architecture, the same typology you would use for any Drupal site. You can even just create everything and put it all on one VM if you want. Azure is flexible and allowing you to do anything you want. You can use the services that come with Windows Azure or go ahead and deploy VMs to provide the services you want. They're all just there for you to use. So here if I go back in, and we'll just refresh this. Oh, you can see. So there's my two virtual machines right there. And if I go to cloud services, I'll have one called mjb Drupal 702. So that's basically the endpoint that's going to hit is this one here. Right. So there you go. So I could go in, log in, set it up, and it's all good to go. So that's it. Thank you for joining me. I hope I was able to show you a little about Windows Azure. If you have any questions, just feel free to. Yeah, where'd my deck go? I'll put my email address back up here. And there mark dot brown at Microsoft.com. Don't forget to take your survey. And that's it. Thank you very much.