Setup and installation¶
Welcome to the Azure sponsored workshop for PyCon 2020 (now online)!
This section will guide you through the prerequisites for the workshop.
Each requirement is outlined here with detailed instructions on their installation.
Python 3.x¶
Make sure to have one of these Python versions installed:
3.6
3.7
3.8
These are the supported versions by Azure Functions. If you already have one installed jump straight to the rest of the setup instructions.
Otherwise, you can follow this fantastic tutorial from Real Python to get a clean Python install.
VS Code¶
We will be using Visual Studio Code (or VS Code for short). VS Code is an Open Source IDE that can be easily extended or enhanced with extensions. For this particular tutorial, we will use the Python and the Azure functions extensions. To get started:
Download and install VS Code . When directed to the install page, this should identify your OS. Download the install file and follow the instructions.
Install the Python VS Code extension . Click on the Install button on the extension website. This will launch VS Code and ask for your confirmation to install.
Install the Azure Functions extension
Azure account and credits¶
You can sign up to your Azure account and receive 12 months of some free services as well as 200 USD in credits. To get started with Azure visit this link.
Azure CLI and functions core tool¶
We first need to install the Azure CLI to be able to deploy our functions
Install homebrew
Install the CLI
brew update && brew install azure-cli
Download the installer from the docs page
When downloaded, open the driver to follow the instructions.
The instructions vary depending on your distribution. Please follow the instructions in the official docs
To be able to run and test your functions locally, we need to install the Azure functions core tools:
Install homebrew
Install the CLI
brew tap azure/functions
brew install azure-functions-core-tools@3
# if upgrading on a machine that has 2.x installed
brew link --overwrite azure-functions-core-tools@3
Install Node.js
Install the core tools package
npm install -g azure-functions-core-tools@3
For Debian/Ubuntu distributions:
Install Microsoft package repository GPG key, to validate package integrity:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
Set up the .NET development source list before doing an APT update.
# Ubuntu sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list' # Debian sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/debian/$(lsb_release -rs | cut -d'.' -f 1)/prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list'
Start the APT source update and install the tools
sudo apt-get update sudo apt-get install azure-functions-core-tools
For more detailed instructions, visit the corresponding docs.
Other accounts¶
StackOverFlow API¶
We will use the StackOverFlow API to collect data. For this you will need to register for an app key.
Head over to https://api.stackexchange.com/ and click on Register for an App Key. Note that you will need to log into StackOverFlow to get a ner key.
In the following screen you will need to provide the details of the app. They do not have to be extensive but you can always go back and change them later. Once filled in, click on the Register app button.
The next screen will display your apps details. Make sure to keep the key and the client secret safe at all times.