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
544
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
138
Azure

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

March 11, 2025
282
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
143
Understanding Generative AI and RAG Benefits
AI

Understanding Generative AI and RAG Benefits

January 12, 2025
98
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.7k
PowerShell Automation for Azure Networks: Detailed VNET and Subnet Analysis
Azure

PowerShell Automation for Azure Networks: Detailed VNET and Subnet Analysis

November 2, 2024
514
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

Setting up Serilog in ASP.NET Core

Setting up Serilog in ASP.NET Core

September 15, 2020
3k
Navigating the Alphabet Soup: Unraveling Microsoft Acronyms

Navigating the Alphabet Soup: Unraveling Microsoft Acronyms

July 16, 2023
254
What if we can check the cost of Azure resources in a juts few seconds

What if we can check the cost of Azure resources in a juts few seconds

May 9, 2023
545
Reflecting on a Year of Growth: 2023 in Review

Reflecting on a Year of Growth: 2023 in Review

December 31, 2023
377
Revolutionizing IP Management in Azure with IPAM: Explore, Deploy, and Master!

Revolutionizing IP Management in Azure with IPAM: Explore, Deploy, and Master!

October 4, 2023
410
Part 5-A : Using Azure DevOps, Automate Your CI/CD Pipeline and Your Deployments

Part 5-A : Using Azure DevOps, Automate Your CI/CD Pipeline and Your Deployments

April 17, 2023
473
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