Microsoft Azure – Introduction to Azure Kung Fu Toolkit
In this article, we will learn about the Azure Kung Fu Toolkit. The Azure Kung Fu toolkit contains tons of practical scripts and examples for the Azure CLI.
The below images shows the GitHub page of the Azure Kung Fu Toolkit. You can download the toolkit from here, and run and use the scripts on your local machine. You can also contribute to it as it is completely open-source.
To get started, open the toolkit folder in Visual Studio Code. Also, make sure that you have the Visual Studio Code terminal set to bash.
To run the script, you also need to install the Azure CLI tools extension for Visual Studio Code, which we already have installed in this case.
Normally, when you are using the Azure CLI, you need to first run the following command to login with your Azure account.
But because we are using Visual Studio Code and we have our Azure account connected to it, we don’t have to do that anymore.
When you have multiple subscriptions associated with your Azure account, you can use the account-set.azcli script to set a subscription that all the scripts will use.
There are lots of useful scripts in the toolkit. There are scripts like az-login.azcli for different ways of logging into Azure as shown below:
There are sample scripts for specific scenarios like deleting multiple resource groups, or one for running a query and outputting the results to a file, and there are lots more.
Let’s create an Azure App Service Plan with the appservice-plan-create.azcli script, and an Azure Web App with that Service Plan.
Before we can run those scripts, we need to create a Resource Group. This can be done using the group-create.azcli script as shown below:
All the scripts come with parameters that you need to fill in with your own values. We’ve already done that here.
And now we could simply select the scripts and run them with terminal, Run Selected Text.
It creates a Resource Group. Now, for the App Service Plan, the below image shows the parameters, which are the Resource Group, a name, and a region.
Let’s select these and run them. Now, we can create an Azure Web App using the webapp-create.azcli script.
Again, we have already filled in the parameters here. Now, select these commands for creating the Web App, paste it in the terminal d run it as Run Selected Text. Again. It created a Web App.
The Azure Kung Fu toolkit contains lots of practical Azure CLI scripts and examples that you can easily use by replacing parameters and running the scripts.