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
Copy file name to clipboardExpand all lines: articles/logic-apps/create-run-custom-code-functions.md
+8-23Lines changed: 8 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ ms.suite: integration
6
6
ms.reviewer: estfan, kewear, azla
7
7
ms.topic: how-to
8
8
ms.custom: devx-track-dotnet
9
-
ms.date: 06/10/2024
9
+
ms.date: 10/16/2023
10
10
# Customer intent: As a logic app workflow developer, I want to write and run my own .NET Framework code to perform custom integration tasks.
11
11
---
12
12
@@ -46,12 +46,7 @@ For more information about limitations in Azure Logic Apps, see [Limits and conf
46
46
47
47
- The custom functions capability is currently available only in Visual Studio Code, running on a Windows operating system.
48
48
49
-
- The custom functions capability currently supports calling the following assemblies:
50
-
51
-
- Azure-hosted logic app workflows: .NET Framework and .NET 8
52
-
- Linux-hosted containers: Netcore and .NET 8
53
-
54
-
To use .NET 8, make sure that you have the [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet). For more information, see [Overview for .NET 8](/dotnet/core/whats-new/dotnet-8/overview).
49
+
- The custom functions capability currently supports calling only .NET Framework 4.7.2 assemblies.
55
50
56
51
- A local folder to use for creating your code project
57
52
@@ -73,8 +68,6 @@ The latest Azure Logic Apps (Standard) extension for Visual Studio Code includes
73
68
74
69
:::image type="content" source="media/create-run-custom-code-functions/create-workspace.png" alt-text="Screenshot shows Visual Studio Code, Azure window, Workspace section toolbar, and selected option for Create new logic app workspace.":::
75
70
76
-
1. From the
77
-
78
71
1. In the **Select folder** box, browse to and select the local folder that you created for your project.
79
72
80
73
1. When the **Create new logic app workspace** prompt box appears, provide a name for your workspace:
@@ -87,14 +80,12 @@ The latest Azure Logic Apps (Standard) extension for Visual Studio Code includes
87
80
88
81
:::image type="content" source="media/create-run-custom-code-functions/project-template.png" alt-text="Screenshot shows Visual Studio Code with prompt to select project template for logic app workspace.":::
89
82
90
-
1. For Azure-hosted Standard logic app workflows, follow the prompt to select either **.NET Framework** or **.NET 8**.
91
-
92
83
1. Follow the subsequent prompts to provide the following example values:
93
84
94
85
| Item | Example value |
95
86
|------|---------------|
96
-
| Function name for your functions project |**WeatherForecast**|
97
-
| Namespace name for your functions project |**Contoso.Enterprise**|
87
+
| Function name for functions project |**WeatherForecast**|
88
+
| Namespace name for functions project |**Contoso.Enterprise**|
@@ -241,7 +232,7 @@ This example continues with the sample code without any changes.
241
232
242
233
## Compile and build your code
243
234
244
-
After you finish writing your code, compile to make sure that no build errors exist. Your function project automatically includes build tasks, which compile and then add your code to the **lib\custom** folder in your logic app project where workflows look for custom functions to run. These tasks put the assemblies in the **lib\custom\net472**or **lib\custom\net8**folder, based on your .NET version.
235
+
After you finish writing your code, compile to make sure that no build errors exist. Your function project automatically includes build tasks, which compile and then add your code to the **lib\custom** folder in your logic app project where workflows look for custom functions to run. These tasks put the assemblies in the **lib\custom\net472** folder.
245
236
246
237
1. In Visual Studio Code, from the **Terminal** menu, select **New Terminal**.
247
238
@@ -263,7 +254,7 @@ After you finish writing your code, compile to make sure that no build errors ex
263
254
264
255
1. Confirm that the following items exist in your logic app project:
265
256
266
-
- In your workspace, expand the following folders: **LogicApp** > **lib\custom** > **net472** or **net8**, based on your .NET version. Confirm that the subfolder named **net472**or **net8**, respectively, contains the assembly (DLL) files required to run your code, including a file named **<*function-name*>.dll**.
257
+
- In your workspace, expand the following folders: **LogicApp** > **lib\custom** > **net472**. Confirm that the subfolder named **net472** contains the multiple assembly (DLL) files required to run your code, including a file named **<*function-name*>.dll**.
267
258
268
259
- In your workspace, expand the following folders: **LogicApp** > **lib\custom** > **<*function-name*>**. Confirm that the subfolder named **<*function-name*>** contains a **function.json** file, which includes the metadata about the function code that you wrote. The workflow designer uses this file to determine the necessary inputs and outputs when calling your code.
269
260
@@ -353,13 +344,7 @@ After you confirm that your code compiles and that your logic app project contai
353
344
354
345
## Deploy your code
355
346
356
-
You can deploy your custom functions in the same way that you deploy your logic app project. Whether you deploy from Visual Studio Code or use a CI/CD DevOps process, make sure that you build your code and that all dependent assemblies exist in the following logic app project folder before you deploy:
357
-
358
-
- .NET 4.7.2: **lib/custom/net472** folder
359
-
360
-
- .NET 8: **lib/custom/net8** folder
361
-
362
-
For more information, see [Deploy Standard workflows from Visual Studio Code to Azure](create-single-tenant-workflows-visual-studio-code.md#deploy-azure).
347
+
You can deploy your custom functions in the same way that you deploy your logic app project. Whether you deploy from Visual Studio Code or use a CI/CD DevOps process, make sure that you build your code and that all dependent assemblies exist in the logic app project's **lib/custom/net472** folder before you deploy. For more information, see [Deploy Standard workflows from Visual Studio Code to Azure](create-single-tenant-workflows-visual-studio-code.md#deploy-azure).
363
348
364
349
## Troubleshoot problems
365
350
@@ -379,7 +364,7 @@ To fix this problem, from the **Run and Debug** list, select **Attach to logic a
379
364
380
365
### Package not imported correctly
381
366
382
-
If the Output window shows an error similar to the following message, make sure that you have at least .NET 6.0 installed. If you have this version installed, try uninstalling and then reinstalling.
367
+
If the Output window shows an error similar to the following message, make sure that you have .NET 6.0 installed. If you have this version installed, try uninstalling and then reinstalling.
383
368
384
369
`C:\Users\yourUserName\.nuget\packages\microsoft.net.sdk.functions\4.2.0\build\Microsoft.NET.Sdk.Functions.targets(83,5): warning : The ExtensionsMetadataGenerator package was not imported correctly. Are you missing 'C:\Users\yourUserName\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\4.0.1\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets' or 'C:\Users\yourUserName\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\4.0.1\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.props'? [C:\Desktop\...\custom-code-project\MyLogicAppWorkspace\Function\WeatherForecast.csproj] WeatherForecast -> C:\Desktop\...\custom-code-project\MyLogicAppWorkspace\Function\\bin\Debug\net472\WeatherForecast.dll C:\Users\yourUserName\.nuget\packages\microsoft.net.sdk.functions\4.2.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : It was not possible to find any compatible framework version [C:\Desktop\...\custom-code-project\MyLogicAppWorkspace\Function\WeatherForecast.csproj] C:\Users\yourUserName\.nuget\packages\microsoft.net.sdk.functions\4.2.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : The specified framework 'Microsoft.NETCore.App', version '6.0.0' was not found. [C:\Desktop\...\custom-code-project\MyLogicAppWorkspace\Function\WeatherForecast.csproj] C:\Users\yourUserName\.nuget\packages\microsoft.net.sdk.functions\4.2.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : - Check application dependencies and target a framework version installed at: [C:\Desktop\...\custom-code-project\MyLogicAppWorkspace\Function\WeatherForecast.csproj]`
0 commit comments