Securing Azure Functions
Try reloading this page, or reviewing your browser settings
This video segment demonstrates how you can host azure functions in an app service plan, and pros and cons.
- App service plan
- Azure functions
About this video
- Sahil Malik
- First online
- 21 December 2018
- Online ISBN
- Copyright information
- © Sahil Malik 2019
Sahil Malik: Now let’s talk about the App Service Plan, which gives you numerous new options when it comes to scaling and hosting Azure Functions.
Now, when creating a new function app, you have a choice of either picking a Consumption Plan or picking an App Service Plan. So let me go with an App Service Plan and let me point it to a resource group that I have and let’s go through creating this entire, you know, function app. So I will point it to a new storage. I will turn Application Insights off. And here, you see this part here where it says App Service plan and location. Let’s click on that and explore what we see in here. So it tells me that it’ll go ahead and create a new plan for me and it has picked a name for me, not particularly intuitive, but I’m going to click on this Create new button.
So what choices do I see in here? So I can choose to give it a name. So I’ll call sahilappserviceplan. Put it in a location that I prefer and choose the pricing tier. So I click on the Pricing tier here and I see a number of choices here. So by default it has picked S1 for me, which is the smallest unit I can pick for production years. You see that under this tab here where you have shared plans and it tells you how much it will cost every month. And this ACU stands for Azure Compute Units. So this is a way for them to limit you and also give me an estimate of how much compute power you’ll be given inside of this App Service Plan.
What is really cool is that this App Service Plan once provisioned, and I’ve committed to paying 44.64 USD a month estimated, a at that point, I can choose to put as many things as I wish inside of this particular App Service Plan. It could be a website, a Web API. Basically anything that an App Service Plan supports as long as I stay within these Azure Compute Units. And I work with a certain amount of memory, I’m given a certain kind of VM. And if I want to scale higher, I can go to Isolated, of course I’ll be paying more for that and I can go really, really high if I want. But for Dev and Test, I’ll just go with B1, which is going to cost 32.74 USD a month, and it gives me certain other features like I can have custom domains/SSLs, I can choose to scale and so on, so forth.
So I’m going to go with the smallest possible production workload like this, and it tells me these various choices I have so I can choose to auto scale. So these new features become available for you. Traffic manager, daily backups, staging slots. A number of these things become available to you. So I’ll click on Apply, okay. And I’ll choose to click Okay. And now it has picked that particular service plan for me and I’m going to click on the Create button.
Now remember that once this function app is created, with that you also created a new App Service Plan. Now you’ve committed to paying that much every month. And whether or not you use it, you still on the hook for it, okay? So this is the main difference in Consumption Plan and App Service Plan. So think of an App Service plan as a fantastic way for you to perhaps use the spare capacity that you already have an App Service Plans, so you can run functions in it for essentially free because you’re already paying for it.
Once the resources are provisioned for you, what’s really amazing with an App Service Plan is that you have a lot of flexibility on scaling out. So let me come here. And you see if I go down here, there are these two tabs here called Scale up and Scale out. Let’s see what those are. So Scale up allows me to move to a completely different skew, right? So I can switch from S1 to a different skew. But here, it’s asking me that it’s not supported for this particular scale unit. So I have to, you know, redeploying the app or clone the app, but still I have some possibilities here. Under Additional pricing tiers, I can up my ACUs. I can choose to go to a P1, P2 or P3. So within limits I have the ability to scale. And also, again Isolated pricing tiers are not available here, but still I have the ability to, in a sort of redeploy this the way that I talked about the latest deployment options and moved to an Isolated plan as well. Of course you would tie this with a traffic manager, so end users don’t see outages.
Under Scale out, you have the ability to increase the Instance count, right? So scale up is upping your App Service Plan and scale out is increasing the instance count so that way you can serve more requests in the same sort of bucket that you’ve already paid for. Enable auto scale allows you to set various metrics so you can say, hey, when a lot of load comes in, automatically scale up, but when you don’t see load, automatically scaled down. So this way I have a lot of ability in how to scale this and run paired with traffic manager, et cetera, I have the ability to also introduce things like geographically distributed networking and you know, deployed at different places around the globe and so on and so forth.