Calls Azure Functions from AL using Codeunit "Azure Functions" for serverless .NET execution, and orchestrates Logic Apps workflows triggered by BC business events. Use when generating QR codes or PDFs externally, running .NET libraries unavailable in AL, building file processing workflows, or automating BC-to-external-system data sync.
70
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Note: In-process model deprecated Nov 2026. Use Isolated Worker (.NET 8+).
// Program.cs
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults()
.Build();
host.Run();
// MyFunction.cs
[Function("MyFunction")]
public async Task<HttpResponseData> Run(
[HttpTrigger(AuthorizationLevel.Function, "post")] HttpRequestData req)
{
var response = req.CreateResponse(HttpStatusCode.OK);
await response.WriteStringAsync("Result");
return response;
}Required in .csproj: <TargetFramework>net8.0</TargetFramework> + <OutputType>Exe</OutputType>
procedure CallAzureFunction(InputData: Text): Text
var
AzureFunction: Codeunit "Azure Functions";
AzureFunctionResponse: Codeunit "Azure Functions Response";
AzureFunctionAuth: Codeunit "Azure Functions Authentication";
IAzureFunctionAuth: Interface "Azure Functions Authentication";
ResponseText: Text;
begin
IAzureFunctionAuth := AzureFunctionAuth.CreateCodeAuth(GetFunctionUrl(), GetFunctionKey());
AzureFunctionResponse := AzureFunction.SendPostRequest(
IAzureFunctionAuth,
'{"data": "' + InputData + '"}',
'application/json');
if AzureFunctionResponse.IsSuccessful() then
AzureFunctionResponse.GetResultAsText(ResponseText)
else
Error('Azure Function failed: %1', AzureFunctionResponse.GetError());
exit(ResponseText);
end;
local procedure GetFunctionKey(): Text
var
FunctionKey: Text;
begin
if IsolatedStorage.Get('AzureFunctionKey', DataScope::Company, FunctionKey) then
exit(FunctionKey);
Error('Azure Function key not configured');
end;Common triggers:
When a Business Event occurs → React to BC eventsRecurrence → Scheduled data syncWhen file added to SharePoint → File processingBC Connector (GA 2024): Use Managed Identity for auth. Enable Run History for debugging.
| Method | Code | Use Case |
|---|---|---|
| Function Key | CreateCodeAuth(url, key) | Simple scenarios |
| Azure AD | CreateOAuth2(url, ...) | Enterprise |
| Managed Identity | Via Azure AD | Logic Apps |
if AzureFunctionResponse.IsSuccessful() then begin
AzureFunctionResponse.GetResultAsStream(ResultInStream);
DownloadFromStream(ResultInStream, 'Download', '', '', FileName);
end;| Plan | Cold Start | Best For |
|---|---|---|
| Consumption | Yes | Sporadic |
| Flex Consumption | Optional | Production |
| Premium | No | High-frequency |
Security: Never hardcode function keys → Isolated Storage. Use Azure AD for production.
Telemetry: Add to Program.cs for unified BC + Functions monitoring:
.ConfigureServices(services => {
services.AddApplicationInsightsTelemetryWorkerService();
})See references/ folder for:
azure-functions-patterns.md - Complete .NET examples52f8705
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.