![梁斌penny](https://i-blog.csdnimg.cn/blog_migrate/37461e38c0821020bb3623554bad2c2b.png)
梁斌penny
I got an interesting question today. This is actually an extremely common one so I thought I'd take a bit to explore it. It's worth noting that I don't know the result of this blog post. That is, I don't know if I'll be right or not, and I'm not going to edit it. Let's see how this goes!
今天我有一个有趣的问题。 这实际上是一种非常普通的方法,因此我认为我需要花一些时间来探索它。 值得注意的是,我不知道这篇博客文章的结果。 也就是说,我不知道我是否对,也不会编辑它。 让我们看看情况如何!
The individual emailed and said they were new to Azure and said:
该个人通过电子邮件发送电子邮件,并说他们是Azure的新手,并说:
Question for you. (and we may have made a mistake – some opinions and help needed)
A month or so ago, we setup a full up Win2016 server on Azure, with the idea that it would host a SQL server as well two IIS web sites给你的问题。 (我们可能犯了一个错误-需要一些意见和帮助) 一个月左右之前,我们在Azure上安装了完整的Win2016服务器,其想法是将托管一个SQL服务器以及两个IIS网站
Long story short, they were mired in the setup of IIS on Win2k6, messing with ports, yada yada yada. '
长话短说,他们被困在Win2k6上的IIS设置中,弄乱了端口yada yada yada。 '
All they wanted was:
他们想要的是:
- The ability to right-click publish from Visual Studio for two sites. 右键单击从Visual Studio中发布两个站点的功能。
- Management of a SQL Database from SQL Management Studio. 从SQL Management Studio管理SQL数据库。
This is a classic "lift and shift" story. Someone has a VM locally or under their desk or in hosting, so they figure they'll move it to the cloud. They LIFT the site as a Virtual Machine and SHIFT it to the cloud.
这是一个经典的“提升与转变”的故事。 某人在本地,在其办公桌下或在托管中拥有VM,因此他们认为他们会将其移动到云中。 他们将站点提升为虚拟机,然后将其转移到云中。
For many, this is a totally reasonable and logical thing to do. If you did this and things work for you, fab, and congrats. However, if, at this point, you're finding the whole "Cloud" thing to be underwhelming, it's likely because you're not really using the cloud, you've just moved a VM into a giant host. You still have to feed and water the VM and deal with its incessant needs. This is likely NOT what you wanted to do. You just want your app running.
对于许多人来说,这是完全合理和合乎逻辑的事情。 如果您这样做了,一切都会为您工作, fab并表示祝贺。 但是,如果此时您发现整个“云”事物不堪重负,则可能是因为您并未真正使用云,所以您只是将虚拟机移到了大型主机中。 您仍然必须为VM充水并处理其不断的需求。 这可能不是您想要的。 您只希望您的应用程序运行。
使VM做所有事情 (Making a VM to do Everything)
If I go into Azure and make a new Virtual Machine (Linux or Windows) it's important to remember that I'm now responsible for giving that VM a loving home and a place to poop. Just making sure you're still reading.
如果我进入Azure并制作了一个新的虚拟机(Linux或Windows),请务必记住,我现在负责给该虚拟机提供一个充满爱的家园和一个便便的地方。 只要确保您还在阅读。
NOTE: If you're making a Windows VM and you already have a Windows license you can save like 40%, so be aware of that, but I'll assume they didn't have a license.
注意:如果您要制作Windows VM,并且已经拥有Windows许可证,则可以节省40%,因此请注意,但是我假设他们没有许可证。
You can check out the Pricing Calculator if you like, but I'll just go and actually setup the VM and see what the Azure Portal says. Note that it's going to need to be beefy enough for two websites AND a SQL Server, per the requirements from before.
您可以根据需要查看价格计算器,但我只是去实际设置虚拟机,然后看看Azure门户所说的内容。 请注意,根据之前的要求,对于两个网站和一个SQL Server,它必须足够强大。
![Pricing for VMs in Azure Pricing for VMs in Azure](https://i-blog.csdnimg.cn/blog_migrate/cb01ace96ecd2bbaf2c8cdb4e2647c16.png)
For a SQL Server and two sites I might want the second or third choice here, which isn't too bad given they have SSDs and lots of RAM. But again, you're responsible for them. Not to mention you have ONE VM so your web server and SQL Server Database are living on that one machine. Anything fails and it's over. You're also possibly giving up perf as you're sharing resources.
对于SQL Server和两个站点,我可能希望在这里选择第二个或第三个选择,考虑到它们具有SSD和大量RAM,这还不错。 但同样,您要为他们负责。 更不用说您拥有一个VM,因此您的Web服务器和SQL Server数据库都位于该计算机上。 一切失败,一切都结束了。 您在共享资源时也可能会放弃性能。
网站/应用程序和SQL Azure Server的应用程序服务计划 (App Service Plans with Web Sites/Apps and SQL Azure Server)
An "App Service Plan" on Azure is a fancy word for "A VM you don't need to worry about." You can host as many Web Apps, Mobile Apps/Backends, Logic Apps and stuff in one as you like, barring perf or memory issues. I have between 19 and 20 small websites in one Small App Service Plan. So, to be clear, you put n number of App Services as you'd like into one App Service Plan.
Azure上的“应用程序服务计划”是“您无需担心的VM”的花哨词。 您可以根据需要将任意数量的Web应用程序,移动应用程序/后端,逻辑应用程序和其他内容托管在一个中,以免出现性能或内存问题。 一个小应用服务计划中有19个至20个小网站。 因此,很明显,您将n个App Services放入了一个App Service Plan中。
When you check out the pricing tier for an App Service Plan, be sure to View All and really explore and think about your options. Some includes support for custom domains and SSL, others have 50 backups a day, or support BizTalk Services, etc. They start at Free, go to Shared, and then Basic, Standard, etc. Best part is that you can scale these up and down. If I go from a Small to a Medium App Service Plan, every App on the Plan gets better.
当您查看应用服务计划的定价层时,请务必查看全部并真正探索和考虑您的选择。 其中一些支持自定义域和SSL,另一些每天支持50个备份,或支持BizTalk Services等。它们从免费开始,转到“共享”,然后是“基本”,“标准”等。最好的部分是您可以扩展这些资源并下。 如果我从小型应用程序服务计划过渡到中型应用程序服务计划,则计划中的每个应用程序都会变得更好。
However, we don't need a SQL Server, remember? This is going to be a plan that we'll use to host those two websites. AND we can use the the same App Service Plan for staging slots (dev/test/staging/production) if we like. So just get the plan that works for your sites, today. Unlike a VM, you can change it whenever.
但是,我们不需要SQL Server,记得吗? 这将是一个计划,我们将用来托管这两个网站。 并且,如果愿意,我们可以将相同的App Service Plan用于登台时段(开发/测试/登台/生产)。 因此,请立即获取适用于您网站的计划。 与VM不同,您可以随时更改它。
![App Service Plan pricing App Service Plan pricing](https://i-blog.csdnimg.cn/blog_migrate/6bb2870c87dd66598ffc6b663f71235e.png)
SQL Server on Azure is similar. You make a SQL Server Database that is hosted on a SQL Server that supports the number of Database Throughput Units that I need. Again, because it's the capital-C Cloud, I can change the size anytime. I can even script it and turn it up and down on the weekends. Whatever saves me money!
Azure上SQL Server与之类似。 您制作了一个SQL Server数据库,该数据库承载在一个SQL Server上,该SQL Server支持我需要的数据库吞吐量单元的数量。 再说一次,因为它是资本C云,所以我可以随时更改大小。 我什至可以编写脚本并在周末将其打开和关闭。 为我省钱的一切!
![SQL Azure Pricing SQL Azure Pricing](https://i-blog.csdnimg.cn/blog_migrate/be132f34ae1f592d6875f5b57db956b4.png)
I can scale the SQL Server from $5 to a month to bajillions and everything in between.
我可以将SQL Server的费用从每月5美元扩展到数十亿美元,而这两者之间的一切都可以。
What the difference here?
这里有什么区别?
First, we started here
首先,我们从这里开始
VM in the Cloud: At the start we had "A VM in the Cloud." I have total control over the Virtual Machine, which is good, but I have total control over the Virtual Machine, which is bad. I can scale up or out, but just as one Unit, unless I split things up into three VMs.
云中的VM:一开始我们有“云中的VM”。 我对虚拟机有完全控制权,这很好,但是对虚拟机却有完全控制权。 我可以向上或向外扩展,但可以作为一个单元进行扩展,除非我将它们拆分为三个虚拟机。
Now we've got.
现在我们有了。
IIS/Web Server in the Cloud: I don't have to think about the underlying OS or keeping it patched. I can use Linux or Windows if I like, and I can run PHP, Ruby, Java, .NET, and on and on in an Azure App Service. I can put lots of sites in one Plan but the IIS publishing endpoint for Visual Studio is automatically configured. I can also use Git for deployment as well
云中的IIS / Web服务器:我不必考虑底层操作系统或对其进行修补。 如果愿意,我可以使用Linux或Windows,并且可以在Azure App Service中不断运行PHP,Ruby,Java,.NET等。 我可以将许多站点放在一个计划中,但是会自动配置Visual Studio的IIS发布终结点。 我也可以使用Git进行部署
SQL Server in the Cloud: The SQL Server is managed, backed up, and independently scalable.
云中SQL Server : SQL Server是受管理,备份和独立可伸缩的。
This is a slightly more "cloudy" of doing things. It's not microservices and independently scalable containers, but it does give you:
这是一个稍微“阴天”的做事。 它不是微服务和可独立扩展的容器,但确实为您提供:
- Independently scalable tiers (pricing and CPU and Memory and disk) 可独立扩展的层(定价,CPU,内存和磁盘)
- Lots of automatic benefits - backups, custom domains, ssl certs, git deploy, App Service Extensions, and on and on. Dozens of features. 许多自动好处-备份,自定义域,ssl证书,git部署,App Service Extensions等。 数十种功能。
- Control over pricing that is scriptable. You could write scripts to really pinch pennies by scaling your units up and down based on time of day or month. 可脚本化的定价控制。 您可以编写脚本来根据一天或一个月的时间向上和向下缩放单位来真正缩小成本。
What are your thoughts on Lift and Shift to IaaS (Infrastructure as a Service) vs using PaaS (Platform as a Service)? What did I forget? (I'm sure lots!)
您对使用IaaS(基础设施即服务)和使用PaaS(平台即服务)的提升和转变有何看法? 我忘记了什么? (我敢肯定!)
Sponsor: Check out JetBrains Rider: a new cross-platform .NET IDE. Edit, refactor, test, build and debug ASP.NET, .NET Framework, .NET Core, or Unity applications. Learn more and get access to early builds!
赞助商:查看JetBrains Rider :一个新的跨平台.NET IDE。 编辑,重构,测试,构建和调试ASP.NET,.NET Framework,.NET Core或Unity应用程序。 了解更多信息并获得早期版本!
梁斌penny