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
543
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
110
Azure

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

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

Understanding Generative AI and RAG Benefits

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

PowerShell Automation for Azure Networks: Detailed VNET and Subnet Analysis

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

Xamarin.forms,Blazor and Web API

Xamarin.forms,Blazor and Web API

December 3, 2020
1.2k
Migrate and modernize your applications on Azure

Migrate and modernize your applications on Azure – Part – 00 (creating .Net 5.0 application )

March 29, 2021
315
Why you need to ensure updating your Xamarin.Android Application to Supports 64-Bit Devices and how to do that .

Why you need to ensure updating your Xamarin.Android Application to Supports 64-Bit Devices and how to do that .

April 21, 2020
507
#msbuild registration is now open!

#msbuild registration is now open!

April 29, 2021
301
Going Dapr

Going Dapr

August 17, 2021
491
Microsoft Ignite Cloud Skills Challenge March 2021

Microsoft Ignite Cloud Skills Challenge March 2021

March 2, 2021
788
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