Azure Function

  • date 16th April, 2024 |
  • by Prwatech |
  • 0 Comments

Azure Function

 

 

  1. Azure Functions provides a serverless computing experience.
  2. It is a serverless platform
  3. Execute your code when needed
  4. Event-driven solution
  5. Execution of your code is triggered by a specific type of event.
  6. Pay only for the time spent running your code.
  7. No worry about configuration or management of the underlying physical and application infrastructure.
  8. Azure Functions can be triggered by various event types, including HTTP requests.
  9. Functions scale automatically based on demand
  10. Functions can be either stateless or stateful.
  11. Resilience: If one of your functions fails, it does not affect other functions.
  12. User Case:
  13. Process file uploads – Run code when a file is uploaded or changed in blob storage
  14. Build a web API – Implement an endpoint for your web applications using the
  15. HTTP trigger o Respond to database changes – Run custom logic when a document is created or updated in Cosmos DB

Azure function-Hands on  

 

It’s the UI of Azure Function App, click on create.

 

image

Now we will try to create a function app, by selecting the subscription and creating the resource group.

image

we need to select the runtime stack and version. By default,Linux will be selected for Python.

image

Now, in the storage session no need to change anything, it should be the default

image

in the network session also no need to change anything, it should be default.

image

Now, in the monitoring session also no need to change anything, it should be default.

image

in deployment session also no need to change anything, if we want to do any continuous deployment then we can enable it or else it should be default.

image

Now, in the tag session also no need to change anything, it should be default.

image

Here you can review the details that we have entered and click on Create.

image

 you can see the function app has been created.

image

Here you can see in the resource grp.

Now, we need to click on the create function which is show below in the fig.

image 

 

 

Now, we need to create a function, here in this, we need to select the template.

As I’ll be selecting HTTP Trigger.

image

Here you can see, that the function has been create

image

Now, we need to write the code and test it.

So for that click on Code + Test, which is show on the left side.

Here you can see the HttpTrigger1 overview.

image

,

By default you will get one code

image

Click on test/run, and you will get like this, we need to select post and you can see in the body session name that Azure has been give. click on run.

image

Here you can see it has been execute successfully.

image

If we want to run it in the browser, we can click on the get function URL, and copy past that URL in the browser.

image

Here you can see in the browser

image

When we pass the name in the query string we will get this

image

0
0

Leave a Reply

Quick Support

image image