SlideShare a Scribd company logo
Python Azure Functions
Azure Developer Stories
KonfHub
@dhilipsiva
10 years of experience in Python, JavaScript,
DevOps & more
Optimistic Nihilist.
Wannabe Astrophysicist.
I code for fun & pro t.
I love Science, Python, FOSS & tness.
Dad of 2. Environmentalist. Story Teller. Gamer.
Jack of all trades & Master of none
http://dhilipsiva.com
dhilipsiva@gmail.com
I have no idea what I am
talking about
Azure Functions
Event-driven serverless compute platform
On-demand service
Provides a continually-updated infrastructure
You can build web APIs, respond to database
changes, process IoT streams, manage message
queues, and more.
Only worry about our app and not infrastructure
Automatically scales
Supported Languages
Python
C#
Go
Java
JavaScript / TypeScript
PowerShell
Rust
Any other Language (Custom Image + PowerShell)
Deployment Approaches
1. Commandline
2. VS Code (with an of cial azure plugin)
I will be taking the command line approach on my
Debian machine as it's easier for me. So the rest of
the talk will use this method.
If you are someone who likes to use GUI tools, you
should probably opt for VS Code approach:
https://docs.microsoft.com/en-us/azure/azure-
functions/create- rst-function-vs-code-python
Prerequisites
Azure Account : https://portal.azure.com/
Azure Functions Core Tools : Used for creating
projects & apps, testing Functions locally,
deploying, logs, etc.
Azure CLI : For managing Azure Cloud Reources
Python 3.8 (or 3.7, 3.6) : Azure only supports
Python 3.x
Azure Functions Core Tools
Install the Microsoft package repository GPG key
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dea
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
Set up the APT source
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/
Install the Core Tools package ( func binary)
sudo apt-get update
sudo apt-get install azure-functions-core-tools-3
Azure CLI ( az binary)
Install using a script (maintained by Azure team)
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
Azure Login
az login
If you want to list available locations
az account list-locations
Alternative installs
Azure Functions Core tools:
https://docs.microsoft.com/en-us/azure/azure-
functions/functions-run-local
Azure CLI: https://docs.microsoft.com/en-
us/cli/azure/install-azure-cli-linux
Creating Project and Apps
Create Project
func init $PROJECT_NAME --python
Create Function
func new 
--name $FUNCTION_NAME 
--template "HTTP trigger" 
--authlevel "anonymous"
Run locally
func start
Creating Azure Resources
Create Resource Group
az group create 
--name $GROUP_NAME 
--location $LOCATION_NAME
General-purpose storage account
az storage account create 
--name $STORAGE_NAME 
--location $LOCATION_NAME 
--resource-group $GROUP_NAME 
--sku Standard_LRS
Creating Resources (contd.)
Create the function app in Azure
az functionapp create 
--resource-group $GROUP_NAME 
--consumption-plan-location $LOCATION_NAME 
--runtime python 
--runtime-version 3.8 
--functions-version 3 
--name $APP_NAME 
--storage-account $STORAGE_NAME 
--os-type linux
Deploy
func azure functionapp publish $APP_NAME
Logs
func azure functionapp logstream $APP_NAME --browser
Delete Azure Resources
az group delete --name $GROUP_NAME
Thanks!
dhilipsiva@pm.me
http://dhilipsiva.com
https://github.com/dhilipsiva/talks
http://www.slideshare.net/dhilipsiva
Source Code: https://github.com/reckonsys/python-
azure-functions-demo
Questions

More Related Content

What's hot (20)

PPTX
Automated Deployment with Fabric
tanihito
ย 
PDF
Fabric - a server management tool from Instagram
Jay Ren
ย 
PDF
ECSใ‚’ใ‚„ใ‚ใ†ใจใ—ใพใ—ใŸ
ๆ™‹ไนŸ ๅคๆธก
ย 
PPTX
Cross platform mobile apps using .NET
Jonas Follesรธ
ย 
PDF
Distributed tracing for Node.js
Nikolay Stoitsev
ย 
PDF
Ansible is the simplest way to automate. SymfonyCafe, 2015
Alex S
ย 
PPTX
Advance discussion on Ansible - Rahul Inti
Sahil Davawala
ย 
PDF
The Puppet Master on the JVM - PuppetConf 2014
Puppet
ย 
PDF
Cheap HPC
Alex Moore
ย 
PPTX
Compcon 2016 Workshop
Steven Cooper
ย 
PDF
A quick intro to Ansible
Dan Vaida
ย 
PPTX
Basics of Ansible - Sahil Davawala
Sahil Davawala
ย 
PDF
DevOps Days India 2013: Build Radiator on Raspberry Pi
Akshay Karle
ย 
PDF
Composer Tutorial (PHP Hampshire Sept 2013)
James Titcumb
ย 
PDF
Automating the Cloud with Terraform, and Ansible
Brian Hogan
ย 
ZIP
Deploying Rails applications with Moonshine
Robot Mode
ย 
PDF
Eclipse SCADA Release 0.1.0
dentrassi1
ย 
PDF
Productive OpenCL with Intel Xeon Phi Coprocessors
Intel IT Center
ย 
PDF
Machine learning in Apache Zeppelin
Gary Sieling
ย 
PDF
Building and Testing Puppet with Docker
carlaasouza
ย 
Automated Deployment with Fabric
tanihito
ย 
Fabric - a server management tool from Instagram
Jay Ren
ย 
ECSใ‚’ใ‚„ใ‚ใ†ใจใ—ใพใ—ใŸ
ๆ™‹ไนŸ ๅคๆธก
ย 
Cross platform mobile apps using .NET
Jonas Follesรธ
ย 
Distributed tracing for Node.js
Nikolay Stoitsev
ย 
Ansible is the simplest way to automate. SymfonyCafe, 2015
Alex S
ย 
Advance discussion on Ansible - Rahul Inti
Sahil Davawala
ย 
The Puppet Master on the JVM - PuppetConf 2014
Puppet
ย 
Cheap HPC
Alex Moore
ย 
Compcon 2016 Workshop
Steven Cooper
ย 
A quick intro to Ansible
Dan Vaida
ย 
Basics of Ansible - Sahil Davawala
Sahil Davawala
ย 
DevOps Days India 2013: Build Radiator on Raspberry Pi
Akshay Karle
ย 
Composer Tutorial (PHP Hampshire Sept 2013)
James Titcumb
ย 
Automating the Cloud with Terraform, and Ansible
Brian Hogan
ย 
Deploying Rails applications with Moonshine
Robot Mode
ย 
Eclipse SCADA Release 0.1.0
dentrassi1
ย 
Productive OpenCL with Intel Xeon Phi Coprocessors
Intel IT Center
ย 
Machine learning in Apache Zeppelin
Gary Sieling
ย 
Building and Testing Puppet with Docker
carlaasouza
ย 

Similar to Deploy your Python code on Azure Functions (20)

PDF
One-Man Ops
Jos Boumans
ย 
PDF
Continuous Deployment @ AWS Re:Invent
John Schneider
ย 
PDF
Going serverless with azure functions
gjuljo
ย 
PPTX
Gruntwork Executive Summary
Yevgeniy Brikman
ย 
PPTX
Introduction to Google App Engine with Python
Brian Lyttle
ย 
PPTX
Azure serverless Full-Stack kickstart
Davide Mauri
ย 
PPTX
January 2011 HUG: Pig Presentation
Yahoo Developer Network
ย 
PPTX
Azure DevOps tyรถkalut - Roundtable 14.3.2019
Janne Mattila
ย 
PPTX
Deep Dive Azure Functions - Global Azure Bootcamp 2019
Andrea Tosato
ย 
PPT
Python Deployment with Fabric
andymccurdy
ย 
PDF
Function as a Service
rich fernandez
ย 
PPTX
Windows azure overview for SharePoint Pros
Usama Wahab Khan Cloud, Data and AI
ย 
PDF
Software Quality Assurance Tooling - Wintersession 2024
Henry Schreiner
ย 
PPTX
AWS CodeDeploy - basic intro
Anton Babenko
ย 
PPTX
AWS CodeDeploy + Github
HyunJin CHA
ย 
PPTX
Keynote Microsoft Azure Summit
Danilo Bordini
ย 
PDF
Deployment automation
Riccardo Lemmi
ย 
PDF
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Bastian Feder
ย 
PDF
Making the most of your Test Suite
ericholscher
ย 
PDF
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
ย 
One-Man Ops
Jos Boumans
ย 
Continuous Deployment @ AWS Re:Invent
John Schneider
ย 
Going serverless with azure functions
gjuljo
ย 
Gruntwork Executive Summary
Yevgeniy Brikman
ย 
Introduction to Google App Engine with Python
Brian Lyttle
ย 
Azure serverless Full-Stack kickstart
Davide Mauri
ย 
January 2011 HUG: Pig Presentation
Yahoo Developer Network
ย 
Azure DevOps tyรถkalut - Roundtable 14.3.2019
Janne Mattila
ย 
Deep Dive Azure Functions - Global Azure Bootcamp 2019
Andrea Tosato
ย 
Python Deployment with Fabric
andymccurdy
ย 
Function as a Service
rich fernandez
ย 
Windows azure overview for SharePoint Pros
Usama Wahab Khan Cloud, Data and AI
ย 
Software Quality Assurance Tooling - Wintersession 2024
Henry Schreiner
ย 
AWS CodeDeploy - basic intro
Anton Babenko
ย 
AWS CodeDeploy + Github
HyunJin CHA
ย 
Keynote Microsoft Azure Summit
Danilo Bordini
ย 
Deployment automation
Riccardo Lemmi
ย 
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Bastian Feder
ย 
Making the most of your Test Suite
ericholscher
ย 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
ย 
Ad

More from Dhilipsiva DS (12)

PDF
Introduction To DevOps Workshop @ New Horizon College
Dhilipsiva DS
ย 
PDF
Build, deploy and scale: Django, GraphQL and SPA (DjangoCon EU 2021)
Dhilipsiva DS
ย 
PDF
Garuda: Automagically Exposing Djagno ORM over gRPC for microservices written...
Dhilipsiva DS
ย 
PDF
AWS LearnUp - Intro to AWS Services - Venturesity
Dhilipsiva DS
ย 
PDF
Python Workshop Day - 2 (REVA University)
Dhilipsiva DS
ย 
PDF
Full-Stack Development
Dhilipsiva DS
ย 
PDF
BangML Meetup 1: The Path to Becoming an Machine Learning Expert
Dhilipsiva DS
ย 
PDF
Architecture @ Appknox
Dhilipsiva DS
ย 
PDF
Microservices with Swagger, Flask and Docker
Dhilipsiva DS
ย 
PDF
Container (Docker) Orchestration Tools
Dhilipsiva DS
ย 
PPT
IEEE
Dhilipsiva DS
ย 
PPT
MuLiST
Dhilipsiva DS
ย 
Introduction To DevOps Workshop @ New Horizon College
Dhilipsiva DS
ย 
Build, deploy and scale: Django, GraphQL and SPA (DjangoCon EU 2021)
Dhilipsiva DS
ย 
Garuda: Automagically Exposing Djagno ORM over gRPC for microservices written...
Dhilipsiva DS
ย 
AWS LearnUp - Intro to AWS Services - Venturesity
Dhilipsiva DS
ย 
Python Workshop Day - 2 (REVA University)
Dhilipsiva DS
ย 
Full-Stack Development
Dhilipsiva DS
ย 
BangML Meetup 1: The Path to Becoming an Machine Learning Expert
Dhilipsiva DS
ย 
Architecture @ Appknox
Dhilipsiva DS
ย 
Microservices with Swagger, Flask and Docker
Dhilipsiva DS
ย 
Container (Docker) Orchestration Tools
Dhilipsiva DS
ย 
IEEE
Dhilipsiva DS
ย 
MuLiST
Dhilipsiva DS
ย 
Ad

Recently uploaded (20)

PDF
Building scalbale cloud native apps with .NET 8
GillesMathieu10
ย 
PPTX
IObit Uninstaller Pro 14.3.1.8 Crack Free Download 2025
sdfger qwerty
ย 
PDF
Rewards and Recognition (2).pdf
ethan Talor
ย 
PDF
How DeepSeek Beats ChatGPT: Cost Comparison and Key Differences
sumitpurohit810
ย 
PPTX
Android Notifications-A Guide to User-Facing Alerts in Android .pptx
Nabin Dhakal
ย 
PPTX
Quality on Autopilot: Scaling Testing in Uyuni
Oscar Barrios Torrero
ย 
PDF
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
ย 
PPTX
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
ย 
PDF
Automated Test Case Repair Using Language Models
Lionel Briand
ย 
PPTX
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
ย 
PDF
IDM Crack with Internet Download Manager 6.42 Build 41
utfefguu
ย 
PDF
Power BI vs Tableau vs Looker - Which BI Tool is Right for You?
MagnusMinds IT Solution LLP
ย 
PPTX
computer forensics encase emager app exp6 1.pptx
ssuser343e92
ย 
PDF
AI Software Development Process, Strategies and Challenges
Net-Craft.com
ย 
PPTX
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
ย 
PDF
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
ย 
PDF
Dealing with JSON in the relational world
Andres Almiray
ย 
PPTX
Seamless-Image-Conversion-From-Raster-to-wrt-rtx-rtx.pptx
Quick Conversion Services
ย 
PDF
Cloud computing Lec 02 - virtualization.pdf
asokawennawatte
ย 
PDF
Continouous failure - Why do we make our lives hard?
Papp Krisztiรกn
ย 
Building scalbale cloud native apps with .NET 8
GillesMathieu10
ย 
IObit Uninstaller Pro 14.3.1.8 Crack Free Download 2025
sdfger qwerty
ย 
Rewards and Recognition (2).pdf
ethan Talor
ย 
How DeepSeek Beats ChatGPT: Cost Comparison and Key Differences
sumitpurohit810
ย 
Android Notifications-A Guide to User-Facing Alerts in Android .pptx
Nabin Dhakal
ย 
Quality on Autopilot: Scaling Testing in Uyuni
Oscar Barrios Torrero
ย 
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
ย 
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
ย 
Automated Test Case Repair Using Language Models
Lionel Briand
ย 
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
ย 
IDM Crack with Internet Download Manager 6.42 Build 41
utfefguu
ย 
Power BI vs Tableau vs Looker - Which BI Tool is Right for You?
MagnusMinds IT Solution LLP
ย 
computer forensics encase emager app exp6 1.pptx
ssuser343e92
ย 
AI Software Development Process, Strategies and Challenges
Net-Craft.com
ย 
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
ย 
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
ย 
Dealing with JSON in the relational world
Andres Almiray
ย 
Seamless-Image-Conversion-From-Raster-to-wrt-rtx-rtx.pptx
Quick Conversion Services
ย 
Cloud computing Lec 02 - virtualization.pdf
asokawennawatte
ย 
Continouous failure - Why do we make our lives hard?
Papp Krisztiรกn
ย 

Deploy your Python code on Azure Functions

  • 1. Python Azure Functions Azure Developer Stories KonfHub @dhilipsiva
  • 2. 10 years of experience in Python, JavaScript, DevOps & more Optimistic Nihilist. Wannabe Astrophysicist. I code for fun & pro t. I love Science, Python, FOSS & tness. Dad of 2. Environmentalist. Story Teller. Gamer. Jack of all trades & Master of none http://dhilipsiva.com [email protected]
  • 3. I have no idea what I am talking about
  • 4. Azure Functions Event-driven serverless compute platform On-demand service Provides a continually-updated infrastructure You can build web APIs, respond to database changes, process IoT streams, manage message queues, and more. Only worry about our app and not infrastructure Automatically scales
  • 5. Supported Languages Python C# Go Java JavaScript / TypeScript PowerShell Rust Any other Language (Custom Image + PowerShell)
  • 6. Deployment Approaches 1. Commandline 2. VS Code (with an of cial azure plugin) I will be taking the command line approach on my Debian machine as it's easier for me. So the rest of the talk will use this method. If you are someone who likes to use GUI tools, you should probably opt for VS Code approach: https://docs.microsoft.com/en-us/azure/azure- functions/create- rst-function-vs-code-python
  • 7. Prerequisites Azure Account : https://portal.azure.com/ Azure Functions Core Tools : Used for creating projects & apps, testing Functions locally, deploying, logs, etc. Azure CLI : For managing Azure Cloud Reources Python 3.8 (or 3.7, 3.6) : Azure only supports Python 3.x
  • 8. Azure Functions Core Tools Install the Microsoft package repository GPG key curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dea sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg Set up the APT source sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/ Install the Core Tools package ( func binary) sudo apt-get update sudo apt-get install azure-functions-core-tools-3
  • 9. Azure CLI ( az binary) Install using a script (maintained by Azure team) curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash Azure Login az login If you want to list available locations az account list-locations
  • 10. Alternative installs Azure Functions Core tools: https://docs.microsoft.com/en-us/azure/azure- functions/functions-run-local Azure CLI: https://docs.microsoft.com/en- us/cli/azure/install-azure-cli-linux
  • 11. Creating Project and Apps Create Project func init $PROJECT_NAME --python Create Function func new --name $FUNCTION_NAME --template "HTTP trigger" --authlevel "anonymous" Run locally func start
  • 12. Creating Azure Resources Create Resource Group az group create --name $GROUP_NAME --location $LOCATION_NAME General-purpose storage account az storage account create --name $STORAGE_NAME --location $LOCATION_NAME --resource-group $GROUP_NAME --sku Standard_LRS
  • 13. Creating Resources (contd.) Create the function app in Azure az functionapp create --resource-group $GROUP_NAME --consumption-plan-location $LOCATION_NAME --runtime python --runtime-version 3.8 --functions-version 3 --name $APP_NAME --storage-account $STORAGE_NAME --os-type linux
  • 14. Deploy func azure functionapp publish $APP_NAME Logs func azure functionapp logstream $APP_NAME --browser
  • 15. Delete Azure Resources az group delete --name $GROUP_NAME