The PHP Function App
Let's create a PHP Function in Azure App. We already created Azure App in the previous chapter.
PHP is also still in the experimental phase, so we don't have much of an option as of now.
Example
Now we will create an Azure Function with the DNS lookup example in PHP:
- Log into Azure Portal and click on
Azure Function App
. We already created Azure Function App in the previous chapter, so now we will create the Azure Function. - Click on the + sign and then select the coding language, as shown in the following screenshot:
By default, PHP gives the template that fetches the entities from a storage table when it receives the HTTP request.
The code for fetching a data from the storage table is already there in PHP. We can directly use it. However, in this example, we will not use the storage table. We will write code for DNS lookup.
This allows us to create only the HTTP GET
request:
- Now, give a name to the function, provide the storage account connection, and click on the
Create
button...