title | description | keywords | services | author | manager | editor | documentationcenter | ms.assetid | ms.service | ms.workload | ms.tgt_pltfrm | ms.devlang | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Build a serverless app in Visual Studio | Microsoft Docs |
Get started with your first serverless app with this guide on creating, deploying, and managing the app in Visual Studio. |
logic-apps |
jeffhollan |
anneta |
d565873c-6b1b-4057-9250-cf81a96180ae |
logic-apps |
integration |
na |
na |
article |
03/30/2017 |
LADocs; jehollan |
Serverless tools and capabilities in Azure allow for rapid development and deployment of cloud applications. This document focuses on how to get started in Visual Studio building a serverless application. An overview of serverless in Azure can be found in this article.
Here are the prerequisites needed to build a serverless application from Visual Studio:
- Visual Studio 2017 or Visual Studio 2015 - Community, Professional, or Enterprise
- Logic Apps Tools for Visual Studio
- Latest Azure SDK (2.9.1 or greater)
- Azure PowerShell
- Azure Functions Core Tools to debug Functions locally
- Access to the web when using the embedded Logic App designer
Managing resources in Azure are done within a resource group. A resource group is a logical grouping of resources. Resource groups allow deployment and management of a collection of resources. For a Serverless application in Azure, our resource group contains both Azure Logic Apps, and Azure Functions. By using the Resource Group project within Visual Studio, we are able to develop, manage, and deploy the entire application as a single asset.
- In Visual Studio, click to add a New Project
- In the Cloud category, select to create an Azure Resource Group project
- If you do not see the category or project listed, be sure you have the Azure SDK installed for Visual Studio
- Give the project a name and location, and select Ok to create Visual Studio prompts to select a template. You could select to start from Blank, start with a Logic App or other resource. However, in this case we use an Azure Quickstart Template to get us started with a serverless app.
- Select to show templates from Azure Quickstart
- Select the serverless quickstart template: 101-logic-app-and-function-app and click Ok
The quickstart template creates a deployment template in your resource group project. The template contains a simple Logic App that calls an Azure Functions, and returns the result. If you open the azuredeploy.json
file in the Solution Explorer, you can see the resources for the serverless app.
Before you can open the Logic App visual designer in Visual Studio, there needs to be a pre-deployed Azure Resource Group. This allows the designer to create and use connections to resources and services in the logic app. To get started, we simply need to deploy the solution created.
- Right-click the project in Visual Studio, select Deploy, and create a New deployment
- Select a valid Azure subscription and Resource group
- Select to Deploy the solution
- Enter in the name for the Logic App and the Azure Function App. The Azure Function name does need to be globally unique
The serverless solution deploys into the specified resource group. If you look at the Output in Visual Studio you can see the status of the deployment.
Once the solution has been deployed into any resource group, the visual designer can be used to edit and make changes to the logic app.
- Right-click the
azuredeploy.json
file in the Solution Explorer and select Open With Logic Apps Designer - Select the Resource Group and Location the solution has been deployed to and select OK
The Logic App visual designer should now be visible with Visual Studio. You can continue to add steps, modify the workflow, and save changes. You can also create logic apps from Visual Studio. If you right-click the Resources in the template navigator, you can choose to add a Logic App to the project. Empty logic apps load in the visual designer without a pre-deploy into a resource group.
You can also manage and view the run history for logic apps deployed in Azure. If you open the Cloud Explorer tool in Visual Studio, you can right-click any Logic App and choose to edit, disable, view properties, or view run history. Clicking edit also allows you to download a published logic app into a Visual Studio Resource Group project. This means that even if you started building your logic app in the Azure portal, you can still import it and manage it from Visual Studio.
The deployment template deploys any Azure Functions that are contained in the solution for the git repository specified in the azuredeploy.json
variables. If you author a function project within the solution, check it into source control (GitHub, Visual Studio Team Services, etc.), and update the repo
variable, the template will deploy the Azure Function.
If using JavaScript, Python, F#, Bash, Batch, or PowerShell, follow the steps in the Functions CLI to create a project. If developing a function in C#, you can use a C# class library in the current solution for the Azure Function.