In this article, we are going to build a small python application and deploy it to Azure Functions. The development and the deployment will be done using the Visual Studio (VS) Code. As you might be aware, VS Code is one of the most widely used and preferred code editors for programmers. It is a cross-platform tool, which means you can install this tool on any operating system of your choice, starting from Windows, Linux, or Mac OS.

What makes the VS Code so unique and popular is that there are tons of custom extensions that are developed by the community. These extensions are leveraged and can be extended the default behavior of the code editor as you want.

Pre-requisites for app development

Assuming that this article is for a beginner, I will start by listing out all the possible pre-requisites that you need to have in order to deploy your code to Azure Functions from Visual Studio Code.

  • Python executable – First things first, since in this article, we are going to learn how to deploy python apps, we need to have the python executable installed in our system. You can head over to https://www.python.org/ and download Python for your operating system
  • **Visual Studio Code **– Yes, as we are going to use Visual Studio Code as the code editor and build our app using the same, you need to get this installed and running on your machine as well. Visual Studio Code is a cross-platform tool, and you can get it installed on any operating system. Download Visual Studio Code by visiting http://code.visualstudio.com/
  • Python Extension for Visual Studio Code – By default, when you install Visual Studio Code, you do not have the option to execute python files directly. You need to install an additional extension provided by Microsoft to support working with python files. Download this extension from the marketplace by visiting https://marketplace.visualstudio.com/items?itemName=ms-python.python
  • Azure Functions Extension for Visual Studio Code – In order to be able to deploy your code to Azure Functions, you need to install the extension as well. You can install the same by visiting https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions
  • **Azure Functions Core Tools **– In order to debug and run your functions locally, you need to set up Azure Functions Core Tools as well. You can follow how to install this tool from the official documentation
  • **A valid Azure Account **– You also need to have an Azure account up and running for this. Visit https://portal.azure.com to create your account

Once you are done with installing all the pre-requisites as mentioned above, you should be good to start with it. Now, the Visual Studio Code looks something like this.

Functions Icon Added in VS Code

Figure 1 – Azure Icon Added in VS Code

As you can see, an icon for using the Azure Services appears on the left-hand pane. Use this panel to sign-in to your Azure account to proceed forward.

#azure #python #visual studio code #programming

Deploy Python apps to Azure Functions using Visual Studio Code
1.55 GEEK