az webapp new - where new is always better!

2 minute read • February 6, 2018

Ahmed Elnably

This blog post has old info, the new version is here.

The App Service team have been hard at work creating a new experimental create and deploy experience for Azure App Service. We released a new Azure CLI extension that adds a new command called new (have you seen what we did there!?). The new command (Which is currently in Preview) enables the user to create and deploy their Node.js or .NET Core app using a single command. For Node.js we check for the existence of a package.json file in the code root path to indicate it is a Node.js app. For .NET Core we check for the existence of a *.csproj file with netcoreapp as the TargetFramework [caption id="attachment_7095" align="alignnone" width="586"] Click on the gif to see the command in action[/caption] In the case of Node.js app the command does the following:
  1. Create a new resource group (in Central US, you can use the --location to change the region)
  2. Create a new Linux single VM small App Service plan in the Standard SKU (in Central US)
  3. Create a Linux webapp
  4. Deploy the content of the current working directory to the webapp using Zip Deployment
In the case of .NET Core app the command does the following:
  1. Create a new resource group (in Central US, you can use the --location to change the region)
  2. Create a new free Windows App Service plan (in Central US)
  3. Create a Windows webapp
  4. Deploy the content of the current working directory to the webapp using Zip Deployment
To Install the Azure CLI tools refer to their documentation. To Install the extension:
az extension add --name webapp
To update the extension with the latest fixes and new languages support (Current version is 0.1.0):
az extension update --name webapp
To know what the command will do without creating anything:
az webapp new --name [app name] --location [optional Azure region name] --dryrun
[caption id="attachment_7115" align="alignnone" width="626"] Click to see --dryrun in action[/caption] To use the new command:
az webapp new --name [app name] --location [optional Azure region name]
To update your app content - Just rerun the command you used to create the app (including the --location argument):
az webapp new --name [app name] --location [optional Azure region name]
To submit feedback or submit an issue please open an issue in the Azure CLI extensions Github Project page. Road Map - also tracked here:
  1. Add better support to update the app with new changes
  2. Add more languages to the supported list
  3. Add support to Azure Functions