Getting Started Azure Functions using Azure Free Trial Account
Azure Function is a solution for easily running small pieces of code in the cloud. Create, Execute and test your custom logic function without creating a VM, Web Applications, and no need install any software and infrastructure to run the function. You can use development language of as per your choice below
- C#
- F#
- Node
. js - Python
- PHP
How to create an Azure Functions:
Step 1: Navigate to https://functions.azure.com and click on try it For Free
Step 2: Create Azure Premade function.
Choose the functions scenario (WebAPI/timer/Processing),
Free trail will allow only twolanguage (c# and JavaScript), Select your Language and click on Create the Function.
Choose the functions scenario (WebAPI/timer/Processing),
Free trail will allow only two
Step 3: Login with any of following provider without creating azure account.
Step 3: Azure Function Editor
Azure functions Edit was following feature
Microsoft Azure free trial Functions edit will give access only 60 Minutes
You can edit c# azure function in Run
Save the changes
Run the Functions
Get Function URL button will provide the public functions url
View File button for
Test button for Test the function
View File Window.
You can Add and upload file using File explore window and
Run. csx File
TheFunction.Json File
The function.json file defines the function bindings and other configuration settings. how to pass data into and return data from function execution. The name that is used for the bound data in the function. For C#, this is an argument name; for JavaScript, it's the key in a key/value list.
You can refer the following is an example function.json file.
Test the Function
You can test Azure functions on multiple way, Here I will explain on two ways to Run /test from an Azure Function editor and test with the Browser
You can use to do testing with click on a test button and provide the request body a JSON string similar to the following in the request body field and click on the Run button
Test with a Browser
The web browser is a simple way to trigger functions via HTTP. You can use a browser for GET requests that do not require a body payload, and that use only query string parameters.
To test the function, we defined earlier, copy the Function Url from the Azure function portal like below
Append the name parameter to the query string. Use an actual name for the <Enter a name here> placeholder.
https://<Your Function App>.azurewebsites.net/api/<Your Function Name>?code=<your access code>&name=<Enter a name here>
Paste the URL into your browser, and you should get a response similar to the following.
The Chrome browser will have returned string in XML. Other browsers display just the string value.
Summary
In this article, you learned about Azure functions, how to create Azure functions with create Azure account and test Azure functionsIf you have any questions/ feedback/ issues, please write in the comment box.
0 Comments