Welcome to todays blog.
I will show how to deploy an existing serverless function into Azure. In a previous post, I show how to create an Azure Serverless Function with .NET Core.
Deploying a serverless Azure function can be done using two different publishing tools:
- Visual Studio Code
- Visual Studio
I will show how to publish an Azure function using Visual Studio.
Select the publish option in the project.
The following dialog will show:
Select the create new App Service option.
The following dialog shows:
Click Start to publish the app.
Select Create New Profile …
The Create App Service dialog opens.
In the Hosting Plan, select New..
In the Configure Hosting Plan, select Location and set Size to Consumption.
The publish screen opens:
Click Publish to deploy.
After a few minutes the deployment will complete.
Verify the function has been deployed by selecting Resources from the Azure Portal. You will see both an App Service Plan and an App Service, which is the Azure Function.
Click on the function. Select Overview.
You will see under the App Service plan / pricing tier the pricing option, which is Consumption.
On the left-hand menu, you will notice the function.
From here you can perform additional management of the function:
Copy the URL. Paste it into a browser.
You should see the confirmation that the function app is running:
To check the routing works, enter the additional routing and submit.
You should see a response back from the function:
To confirm the binaries have deployed successfully to Azure, open the console from the function platform menu. You will notice the function has a folder created for it as shown:
In addition, the function.json that determines the http trigger binding has also been deployed under this folder.
This shows the Azure Serverless Function has been successfully deployed.
That’s all for today’s post.
I hope you found it informative and useful.
Andrew Halil is a blogger, author and software developer with expertise of many areas in the information technology industry including full-stack web and native cloud based development, test driven development and Devops.