integrating-azure-services
Skill1 starsChanged 10 months agoMITView on GitHub
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.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- authenticating-with-oauthSkill
- binding-event-subscribersSkill
- building-cue-rolecentersSkill
- consuming-bc-standard-apiSkill
- controlling-al-accessSkill
- creating-bc-custom-apiSkill
- handling-bc-filesSkill
- implementing-al-interfacesSkill
- implementing-telemetrySkill
- optimizing-bc-performanceSkill
- writing-git-commitsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 91
BC Connector (GA 2024): Use Managed Identity for auth.
- Distinctive: line 120
Security: Never hardcode function keys → Isolated Storage.
- Very specific: line 122
Telemetry: Add to Program.cs for unified BC + Functions monitoring:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: AL Azure Integration
Validation Gates
- After Step 2: Azure Function responds to HTTP request from Postman
- After Step 3: AL code successfully calls function, receives response
- Final: Logic App triggers on BC event, performs expected action
Note: In-process model deprecated Nov 2026. Use Isolated Worker (.NET 8+).
Procedure
Step 1: Create Azure Function (Isolated Worker)
// 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>
Step 2: Deploy and Get Function URL
- Deploy to Azure (VS Code / CLI / GitHub Actions)
- Copy Function URL + Key from Azure Portal → Function App → Functions → Get Function Url
Step 3: Call Function from AL
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;Step 4: Create Logic App (Optional)
Common triggers:
When a Business Event occurs→ React to BC eventsRecurrence→ Scheduled data syncWhen file added to SharePoint→ File processing
BC Connector (GA 2024): Use Managed Identity for auth. Enable Run History for debugging.
Authentication Options
| Method | Code | Use Case |
| Function Key | CreateCodeAuth(url, key) | Simple scenarios |
| Azure AD | CreateOAuth2(url, ...) | Enterprise |
| Managed Identity | Via Azure AD | Logic Apps |
Binary Response (Images/PDFs)
if AzureFunctionResponse.IsSuccessful() then begin
AzureFunctionResponse.GetResultAsStream(ResultInStream);
DownloadFromStream(ResultInStream, 'Download', '', '', FileName);
end;Hosting Plans
| Plan | Cold Start | Best For |
| Consumption | Yes | Sporadic |
| Flex Consumption | Optional | Production |
| Premium | No | High-frequency |
Important Notes
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();
})References
See references/ folder for:
azure-functions-patterns.md- Complete .NET examples
External Documentation
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

