Learn how to use Command Line Interface (CLI) to create and modify an Azure App Service plan. Learn about this command as well as other options for using CLI to interact with the Azure App Service and WebApps.
- [Instructor] Now let's go ahead and create an app service and an app, using the command line interface. I have logged into the Windows Azure SDK environment, and I am already logged into the correct subscription. Next we're going to go ahead and create a resource group. To do so, I am going to type the command, Azure group create, and then I'm going to provide a name and location for our resource group.
The name will be My Company RG underscore CL for command line. And the location will be the west US. We can see that we now have a resource group in the West US. Next, we're going to go ahead and create an app service plan. To do so, I'm going to use the command Azure app service plan create, and then I'm going to provide a name of my service plan, the location, the resource group name.
I'll also have to provide a SKU, and the number of instances. The name for my service plan will be My Company SP underscore CL. Next, the location. Just the west US.
The resource group. I'm using the resource group I've just created, My Company RG underscore CL, the SKU. This'll be a P1, a premium small size SKU, and then the number of instances. In our example, it will be 10.
And hope I don't have any typos, and click enter. Now that my service plan has been created, I can go ahead and create an app. I'm going to go ahead and clear the screen first, just to give us a little bit more real estate. We're going to go ahead and create a web app. To do so, I am going to use the command Azure web app create, I will provide a name, a resource group, the service plan, and the location.
The name of my app will be My Company App SB underscore CL. The resource group is My Company RG underscore CL. Next is the plan. And finally, the location.
So I have an error here, and the error is on the company app SB name. And I suspect what the issue here is my underscore CL, so I'm going to try this one more time, modifying that name. I'm going to remove the underscore, and let's try this one more time. And there we have it.
And this is something to keep in mind when you're using power shell or a command line interface, sometimes, if you have an error, it might take a minute for you to figure out what that error is, whereas when you're using the portal, it will come up immediately and let you know, hey you're not allowed to use that character. So for those of you who are comfortable, in the command line interface, here are the basic commands to go ahead and create the app service plan within the resource group, and then create the web app.
- Deploying Web Apps
- Creating App Service plans
- Deploying and moving apps
- Configuring app settings
- Managing Web Apps using PowerShell and CLI
- Configuring alerts
- Enabling diagnostic logs
- Retrieving and streaming logs
- Configuring Web Apps for scale and resilience