Talk With Angel Garcia!

Talk With Angel Garcia!

a blog about software and beers

[Workshop] Azure for devs – Week 4

Hi everyone, in our last session of the workshop “Azure for Devs” for our community .NET Dominicana (@DotNetDo), my friend Luis Pujols and I covered the following topics:

📱Let’s Learn About Power Apps

Power Apps is a no-code/low-code platform for building apps that build off of concepts similar to formulas in an Excel workbook such as SUM and TEXT. You can use Power Apps to build simple solutions like vehicle inspection forms and status reports or complex business solutions for purchasing processes and inventory management.

🌩 Introducing Azure Functions

Serverless computing enables developers to build applications faster by eliminating the need for them to manage infrastructure.

With serverless applications, the cloud service provider automatically provisions, scales, and manages the infrastructure required to run the code.

Azure Functions allows you to run small pieces of code (called “functions”) without worrying about application infrastructure.

✨ Triggers and Bindings

Triggers are what cause a function to run. A trigger defines how a function is invoked and a function must have exactly one trigger.

Triggers have associated data, which is often provided as the payload of the function.

Bindings are a declarative way to connect data and services to your function. Bindings know how to talk to different services, which means you don’t have to write code in your function to connect to data sources and manage connections.

A trigger is a special type of input binding that has the additional capability of initiating execution.

⏲ Durable Functions

Durable Functions is an extension of Azure Functions that lets you write stateful functions in a serverless compute environment.

The extension lets you define stateful workflows by writing orchestrator functions and stateful entities by writing entity functions using the Azure Functions programming model.

Behind the scenes, the extension manages state, checkpoints, and restarts for you, allowing you to focus on your business logic.

💵 Azure Functions Costs

There are currently three types of hosting plans for an app that runs in Azure Functions, with each plan having its own pricing model:

  • Consumption. You’re only charged for the time that your function app runs (per seconds). Consumption plan pricing includes a monthly free grant of 1 million requests and 400,000 GB-s of resource consumption per month.
  • Premium Provides you with the same features and scaling mechanism as the Consumption plan, but with enhanced performance and VNET access.
  • Dedicated (App Service) When you need to run in dedicated VMs or in isolation, use custom images, or want to use your excess App Service plan capacity. Uses regular App Service plan billing.

Cost is based on your chosen pricing tier.

🕹 Demo: creating and deploying an Azure Function

func --version

func templates list

func init Currency --dotnet

cd Currency

func new --template "HTTP trigger" --name "CurrencyFunction"

dotnet add package AngleSharp --version 0.14.0

//Add the following code to the CurrencyFunction.cs file: <>

func start

az login

az account list --output table

az account set --subscription Your-Subscription-Id

az group create --name dev-az --location "West Europe"

az storage account create --name currencydevstorage --location "West Europe" --resource-group dev-az --sku Standard_LRS

az functionapp create --resource-group dev-az --consumption-plan-location westeurope --runtime dotnet --functions-version 3 --name my-currency-function --storage-account currencydevstorage

func azure functionapp publish my-currency-function

func azure functionapp logstream my-currency-function --browser

az group delete --name "dev-az"

Finally, here goes the presentation:

See you next week!


Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.