Achraf Ben Alaya
No Result
View All Result
  • Home
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Dapr
    • Tricks, Tips and Fixes
    • General Tips & Fix
  • AI
  • Cloud
  • Motivation
  • Courses
  • About
    • Resume
    • Privacy Policy
SUBSCRIBE
  • Home
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Dapr
    • Tricks, Tips and Fixes
    • General Tips & Fix
  • AI
  • Cloud
  • Motivation
  • Courses
  • About
    • Resume
    • Privacy Policy
No Result
View All Result
Achraf Ben Alaya
No Result
View All Result
ADVERTISEMENT
Home Blog Cloud Azure

Migrate and modernize your applications on Azure – Part 2.0 (Azure Functions)

achraf by achraf
April 3, 2021
in Azure, Blog, Cloud
2 min read
0
Migrate and modernize your applications on Azure
0
SHARES
550
VIEWS
Share on FacebookShare on Twitter

After we have created and published our application to azure , it’s time now to modernize it accelerate and simplify application development with serverless compute using the azure function .

The first azure function that we are going to create will play the role of add-task , so instead of using the API we will use this azure function to do the add task job .

Functions can be written in a variety of languages, and will automatically trigger and scale based on your application needs.

Creating the azure Function

In order to create our azure function ,first we need to clique on the solution in order to add a new project and than from the templates we are going to look for function .

next for the setting of the app we will follow the below table

PS : Make sure you set the Authorization level to Anonymous. If you choose the default level of Function, you’re required to present the function key in requests to access your function endpoint.

Visual Studio creates a project and class that contains boilerplate code for the HTTP trigger function type. The boilerplate code sends an HTTP response that includes a value from the request body or query string. The HttpTrigger attribute specifies that the function is triggered by an HTTP request.

If you follow the video below on the blog we will end up having a function like this :

public  class Function1
 {

     private readonly TaskDbContext _TaskDbContext;
     public Function1(TaskDbContext TaskDbContext)
     {
         _TaskDbContext = TaskDbContext;
     }

     [FunctionName("CreateTodo")]
     public async Task<IActionResult> Run(
         [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req,
         ILogger log)
     {


         log.LogInformation("Creating a new todo list item");
         var requestBody = await new StreamReader(req.Body).ReadToEndAsync();
         var input = JsonConvert.DeserializeObject<ToDo>(requestBody);
         var todo = new ToDo { Name = input.Name, Priority = input.Priority, URD = System.DateTime.Now.ToString() };
         await _TaskDbContext.todo.AddAsync(todo);
         await _TaskDbContext.SaveChangesAsync();
         return new OkObjectResult(input);
     }
 }

The function will create a task based on the ToDo Model .

To see how to create and publish the function you can find detailed explanation below .

ShareTweet
Previous Post

Migrate and modernize your applications on Azure – Part –1 (Migrate Database)

Next Post

Migrate and modernize your applications on Azure – Part 2.0 (Proxy Function)

Related Posts

AI

Model Context Protocol (MCP): The Future of AI Integration

April 21, 2025
177
Azure

Step-by-Step Guide: Azure Front Door + Storage Account Static Website + Custom Domain with Terraform

March 11, 2025
418
Network Security & Route Tables – Checking NSGs, route tables, and service endpoints for a targeted VNET or Subnet
Azure

Network Security & Route Tables – Checking NSGs, route tables, and service endpoints for a targeted VNET or Subnet

February 3, 2025
154
Understanding Generative AI and RAG Benefits
AI

Understanding Generative AI and RAG Benefits

January 12, 2025
108
Azure Communication Services Email Sending Simplified: From Setup to Execution and Monitoring
Azure

Azure Communication Services Email Sending Simplified: From Setup to Execution and Monitoring

December 8, 2024
1.8k
PowerShell Automation for Azure Networks: Detailed VNET and Subnet Analysis
Azure

PowerShell Automation for Azure Networks: Detailed VNET and Subnet Analysis

November 2, 2024
600
Next Post
Migrate and modernize your applications on Azure

Migrate and modernize your applications on Azure – Part 2.0 (Proxy Function)

Leave a Reply Cancel reply

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

Terraform

Certifications

Microsoft certified trainer (MCT)

Recommended

Automated Monitoring of Azure App Registration Secrets with Automation Accounts and Logic Apps

Automated Monitoring of Azure App Registration Secrets with Automation Accounts and Logic Apps

October 7, 2024
698

How To host a Next.js app on Azure

October 5, 2020
1.6k
Recover a deleted storage account azure

Recover a deleted storage account azure

December 14, 2020
1.1k
Win a free certifications at the Microsoft spring skills challenge  🎁

Win a free certifications at the Microsoft spring skills challenge 🎁

March 20, 2022
540
Reflecting on a Year of Growth: 2023 in Review

Reflecting on a Year of Growth: 2023 in Review

December 31, 2023
381
Elevate Your API Reliability: Deep Dive into Load Balancing and Failover Strategies in Azure API Management

Elevate Your API Reliability: Deep Dive into Load Balancing and Failover Strategies in Azure API Management

December 29, 2023
371
Facebook Twitter LinkedIn Youtube

Model Context Protocol (MCP): The Future of AI Integration

April 21, 2025

Step-by-Step Guide: Azure Front Door + Storage Account Static Website + Custom Domain with Terraform

March 11, 2025
Network Security & Route Tables – Checking NSGs, route tables, and service endpoints for a targeted VNET or Subnet

Network Security & Route Tables – Checking NSGs, route tables, and service endpoints for a targeted VNET or Subnet

February 3, 2025

Categories

  • AI (2)
  • Apps (1)
  • Azure (63)
  • blazor (2)
  • Blog (91)
  • c# (7)
  • Cloud (65)
  • Courses (3)
  • Dapr (4)
  • docker (4)
  • Games (1)
  • General Tips & Fix (1)
  • Home (1)
  • Kubernetes Service (AKS) (1)
  • motivation (2)
  • Motivation (3)
  • News (9)
  • Resume (1)
  • sql (4)
  • Terrafrom (1)
  • Tricks, Tips and Fixes (4)
  • xamarin (5)
No Result
View All Result
  • Home
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Dapr
    • Tricks, Tips and Fixes
    • General Tips & Fix
  • AI
  • Cloud
  • Motivation
  • Courses
  • About
    • Resume
    • Privacy Policy