You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While you're able to develop and test Azure Functions in the [Azure portal], many developers prefer a local development experience. When you use Functions, using your favorite code editor and development tools to create and test functions on your local computer becomes easier. Your local functions can connect to live Azure services, and you can debug them on your local computer using the full Functions runtime.
11
+
Whenever possible, you should create and validate your Azure Functions code project in a local development environment. Azure Functions Core Tools provides a local runtime version of Azure Functions that integrates with popular development tools for an integrated development, debugging, and deployments. Your local functions can even connect to live Azure services.
11
12
12
-
This article provides links to specific development environments for your preferred language. It also provides some shared guidance for local development, such as working with the [local.settings.json file](#local-settings-file).
13
+
This article provides some shared guidance for local development, such as working with the [local.settings.json file](#local-settings-file). It also links to development environment-specific guidance.
14
+
15
+
>[!TIP]
16
+
>You can find detailed information about how to develop functions locally in the linked IDE-specific guidance articles.
13
17
14
18
## Local development environments
15
19
16
-
The way in which you develop functions on your local computer depends on your [language](supported-languages.md) and tooling preferences. The environments in the following table support local development:
20
+
The way in which you develop functions on your local computer depends on your [language](supported-languages.md) and tooling preferences. Make sure to choose your preferred language at the [top of the article](#top).
21
+
22
+
>[!NOTE]
23
+
>All local development environments rely on Azure Functions Core Tools to provide the Functions runtime for local debugging.
24
+
25
+
These local development environments support function development in your chosen language:
26
+
27
+
::: zone pivot="programming-language-csharp"
28
+
29
+
|Environment |Description|
30
+
|------------|-----------|
31
+
|[Visual Studio](functions-develop-vs.md)| The Azure Functions tools are included in the **Azure development** workload of [Visual Studio](https://www.visualstudio.com/vs/). Lets you compile and deploy your C# function code to Azure as a .NET class library. Includes the Core Tools for local testing. To learn more, see [Create your first C# function in Azure using Visual Studio](functions-create-your-first-function-visual-studio.md)|
32
+
|[Visual Studio Code](functions-develop-vs-code.md)| The [Azure Functions extension for VS Code](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) adds Functions support to VS Code. Requires the Core Tools. Supports development on Linux, macOS, and Windows. To learn more, see [Create your first function using Visual Studio Code](./create-first-function-vs-code-csharp.md). |
33
+
|[Command prompt or terminal](functions-run-local.md)|[Azure Functions Core Tools] provides the core runtime and templates for creating functions, which enable local development. Supports development on Linux, macOS, and Windows. To learn more, see [Create a C# function in Azure from the command line](create-first-function-cli-csharp.md).|
34
+
35
+
::: zone-end
36
+
::: zone pivot="programming-language-java"
37
+
38
+
|Environment |Description|
39
+
|------------|-----------|
40
+
|[Maven](./create-first-function-cli-java.md)| Maven archetype uses Core Tools to enable development of Java functions. Supports development on Linux, macOS, and Windows. To learn more, see [Create your first function with Java and Maven](./create-first-function-cli-java.md). |
41
+
|[Visual Studio Code](functions-develop-vs-code.md)| The [Azure Functions extension for VS Code](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) adds Functions support to VS Code. Requires the Core Tools. Supports development on Linux, macOS, and Windows. To learn more, see [Create your first function using Visual Studio Code](./create-first-function-vs-code-java.md). |
42
+
|[IntelliJ IDEA](functions-create-maven-intellij.md)| Maven archetype and Core Tools lets you develop your functions using IntelliJ. For more information, see [Create your first Java function in Azure using IntelliJ](functions-create-maven-intellij.md). |
43
+
|[Eclipse](functions-create-maven-eclipse.md)| Maven archetype and Core Tools lets you develop your functions using Eclipse. To learn more, see [Create your first Java function in Azure using Ecplise](functions-create-maven-eclipse.md). |
|[Visual Studio Code](functions-develop-vs-code.md)|[C# (in-process)](functions-dotnet-class-library.md)<br/>[C# (isolated worker process)](dotnet-isolated-process-guide.md)<br/>[JavaScript](functions-reference-node.md)<br/>[PowerShell](./create-first-function-vs-code-powershell.md)<br/>[Python](functions-reference-python.md)| The [Azure Functions extension for VS Code](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) adds Functions support to VS Code. Requires the Core Tools. Supports development on Linux, macOS, and Windows, when using version 2.x of the Core Tools. To learn more, see [Create your first function using Visual Studio Code](./create-first-function-vs-code-csharp.md). |
21
-
|[Command prompt or terminal](functions-run-local.md)|[C# (in-process)](functions-dotnet-class-library.md)<br/>[C# (isolated worker process)](dotnet-isolated-process-guide.md)<br/>[JavaScript](functions-reference-node.md)<br/>[PowerShell](functions-reference-powershell.md)<br/>[Python](functions-reference-python.md)|[Azure Functions Core Tools] provides the core runtime and templates for creating functions, which enable local development. Version 2.x supports development on Linux, macOS, and Windows. All environments rely on Core Tools for the local Functions runtime. |
22
-
|[Visual Studio](functions-develop-vs.md)|[C# (in-process)](functions-dotnet-class-library.md)<br/>[C# (isolated worker process)](dotnet-isolated-process-guide.md)| The Azure Functions tools are included in the **Azure development** workload of [Visual Studio](https://www.visualstudio.com/vs/), starting with Visual Studio 2019. Lets you compile functions in a class library and publish the .dll to Azure. Includes the Core Tools for local testing. To learn more, see [Develop Azure Functions using Visual Studio](functions-develop-vs.md). |
23
-
|[Maven](./create-first-function-cli-java.md) (various) |[Java](functions-reference-java.md)| Maven archetype supports Core Tools to enable development of Java functions. Version 2.x supports development on Linux, macOS, and Windows. To learn more, see [Create your first function with Java and Maven](./create-first-function-cli-java.md). Also supports development using [Eclipse](functions-create-maven-eclipse.md) and [IntelliJ IDEA](functions-create-maven-intellij.md). |
45
+
::: zone-end
46
+
::: zone pivot="programming-language-javascript,programming-language-typescript"
24
47
25
-
[!INCLUDE [Don't mix development environments](../../includes/functions-mixed-dev-environments.md)]
48
+
|Environment |Description|
49
+
|------------|-----------|
50
+
|[Visual Studio Code](functions-develop-vs-code.md)| The [Azure Functions extension for VS Code](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) adds Functions support to VS Code. Requires the Core Tools. Supports development on Linux, macOS, and Windows. To learn more, see [Create your first function using Visual Studio Code](./create-first-function-vs-code-node.md). |
51
+
|[Command prompt or terminal](functions-run-local.md)|[Azure Functions Core Tools] provides the core runtime and templates for creating functions, which enable local development. Supports development on Linux, macOS, and Windows. To learn more, see [Create a Node.js function in Azure from the command line](./create-first-function-cli-node.md).|
52
+
53
+
::: zone-end
54
+
::: zone pivot="programming-language-powershell"
55
+
56
+
|Environment |Description|
57
+
|------------|-----------|
58
+
|[Visual Studio Code](functions-develop-vs-code.md)| The [Azure Functions extension for VS Code](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) adds Functions support to VS Code. Requires the Core Tools. Supports development on Linux, macOS, and Windows. To learn more, see [Create your first function using Visual Studio Code](./create-first-function-vs-code-powershell.md). |
59
+
|[Command prompt or terminal](functions-run-local.md)|[Azure Functions Core Tools] provides the core runtime and templates for creating functions, which enable local development. Supports development on Linux, macOS, and Windows. To learn more, see [Create a PowerShell function in Azure from the command line](./create-first-function-cli-powershell.md).|
60
+
61
+
::: zone-end
62
+
::: zone pivot="programming-language-python"
63
+
64
+
|Environment |Description|
65
+
|------------|-----------|
66
+
|[Visual Studio Code](functions-develop-vs-code.md)| The [Azure Functions extension for VS Code](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) adds Functions support to VS Code. Requires the Core Tools. Supports development on Linux, macOS, and Windows. To learn more, see [Create your first function using Visual Studio Code](./create-first-function-vs-code-python.md). |
67
+
|[Command prompt or terminal](functions-run-local.md)|[Azure Functions Core Tools] provides the core runtime and templates for creating functions, which enable local development. Supports development on Linux, macOS, and Windows. To learn more, see [Create a Python function in Azure from the command line](./create-first-function-cli-python.md).|
68
+
69
+
::: zone-end
26
70
27
71
Each of these local development environments lets you create function app projects and use predefined function templates to create new functions. Each uses the Core Tools so that you can test and debug your functions against the real Functions runtime on your own machine just as you would any other app. You can also publish your function app project from any of these environments to Azure.
28
72
@@ -99,11 +143,11 @@ When you develop your functions locally, any local settings required by your app
99
143
100
144
## Triggers and bindings
101
145
102
-
When you develop your functions locally, you need to take trigger and binding behaviors into consideration. For HTTP triggers, you can simply call the HTTP endpoint on the local computer, using `http://localhost/`. For non-HTTP triggered functions, there are several options to run locally:
146
+
When you develop your functions locally, you need to take trigger and binding behaviors into consideration. For HTTP triggers, you can call the HTTP endpoint on the local computer, using `http://localhost/`. For non-HTTP triggered functions, there are several options to run locally:
103
147
104
-
+ The easiest way to test bindings during local development is to use connection strings that target live Azure services. You can target live services by adding the appropriate connection string settings in the `Values` array in the local.settings.json file. When you do this, local executions during testing impact live service data. Because of this, consider setting-up separate services to use during development and testing, and then switch to different services during production.
148
+
+ The easiest way to test bindings during local development is to use connection strings that target live Azure services. You can target live services by adding the appropriate connection string settings in the `Values` array in the local.settings.json file. When you do this, local executions during testing might affect your production services. Instead, consider setting-up separate services to use during development and testing, and then switch to different services during production.
105
149
+ For storage-based triggers, you can use a [local storage emulator](#local-storage-emulator).
106
-
+ You can manually run non-HTTP trigger functions by using special administrator endpoints. For more information, see [Manually run a nonHTTP-triggered function](functions-manually-run-non-http.md).
150
+
+ You can manually run non-HTTP trigger functions by using special administrator endpoints. For more information, see [Manually run a non-HTTP-triggered function](functions-manually-run-non-http.md).
107
151
108
152
During local testing, you must be running the host provided by Core Tools (func.exe) locally. For more information, see [Azure Functions Core Tools](functions-run-local.md).
109
153
@@ -112,7 +156,7 @@ During local testing, you must be running the host provided by Core Tools (func.
112
156
During development, it's easy to call any of your function endpoints from a web browser when they support the HTTP GET method. However, for other HTTP methods that support payloads, such as POST or PUT, you need to use an HTTP test tool to create and send these HTTP requests to your function endpoints.
113
157
114
158
> [!CAUTION]
115
-
> For scenarios where your requests must include sensitive data, make sure to use a tool that protects your data and reduces the risk of exposing any sensitive data to the public. Sensitive data you should protect might include: credentials, secrets, access tokens, API keys, geolocation data, even personally-identifiable information (PII).
159
+
> For scenarios where your requests must include sensitive data, make sure to use a tool that protects your data and reduces the risk of exposing any sensitive data to the public. Sensitive data you should protect might include: credentials, secrets, access tokens, API keys, geolocation data, even personal data.
116
160
117
161
You can keep your data secure by choosing an HTTP test tool that works either offline or locally, doesn't sync your data to the cloud, and doesn't require that you sign in to an online account. Some tools can also protect your data from accidental exposure by implementing specific security features.
118
162
@@ -142,17 +186,12 @@ With this setting value, any Azure Storage trigger or binding that uses `AzureWe
142
186
+ You should test with an actual storage connection to Azure services before publishing to Azure.
143
187
+ When you publish your project, don't publish the `AzureWebJobsStorage` setting as `UseDevelopmentStorage=true`. In Azure, the `AzureWebJobsStorage` setting must always be the connection string of the storage account used by your function app. For more information, see [`AzureWebJobsStorage`](functions-app-settings.md#azurewebjobsstorage).
144
188
145
-
## Next steps
146
-
147
-
+ To learn more about local development of compiled C# functions (both in-process and isolated worker process) using Visual Studio, see [Develop Azure Functions using Visual Studio](functions-develop-vs.md).
148
-
+ To learn more about local development of functions using VS Code on a Mac, Linux, or Windows computer, see the Visual Studio Code getting started article for your preferred language:
+ To learn more about local development of functions using Visual Studio, see [Develop Azure Functions using Visual Studio](functions-develop-vs.md).
193
+
::: zone-end
194
+
+ To learn more about local development of functions using Visual Studio Code on a Mac, Linux, or Windows computer, see [Develop Azure Functions by using Visual Studio Code](functions-develop-vs-code.md).
156
195
+ To learn more about developing functions from the command prompt or terminal, see [Work with Azure Functions Core Tools](functions-run-local.md).
description: Learn how to code and test Azure Functions from the command prompt or terminal on your local computer before you deploy them to run them on Azure Functions.
@@ -294,7 +294,7 @@ curl --request POST http://localhost:7071/api/MyHttpTrigger --data "{'name':'Azu
294
294
295
295
The following considerations apply when calling HTTP endpoints locally:
296
296
297
-
+ You can make GET requests from a browser passing data in the query string. For all other HTTP methods, you must use a HTTP testing tool that also keeps your data secure. For more information, see [HTTP test tools](functions-develop-local.md#http-test-tools).
297
+
+ You can make GET requests from a browser passing data in the query string. For all other HTTP methods, you must use an HTTP testing tool that also keeps your data secure. For more information, see [HTTP test tools](functions-develop-local.md#http-test-tools).
298
298
299
299
+ Make sure to use the same server name and port that the Functions host is listening on. You see an endpoint like this in the output generated when starting the Function host. You can call this URL using any HTTP method supported by the trigger.
0 commit comments