Thanks for reaching out on Microsoft Q&A!
While you can use HostBuilder and register services like ILogger, custom services (e.g., ISomeService) are not automatically injected into your custom code actions in Logic Apps. This is because:
- The Custom Code runtime in Logic Apps is designed for lightweight, inline logic, not full-blown ASP.NET Core-style DI setups.
- The
Program.csandHostBuilderpattern is not fully supported in the context of Logic Apps' custom code execution
If your logic requires full DI, consider moving the logic to an Azure Function (which supports DI fully), and call it from your Logic App via HTTP. If your logic is simple, you can also use the "Execute JavaScript Code" action in Logic Apps Standard to run inline code.
Please click ‘Accept answer’ if you think my answer is helpful. Feel free to drop additional queries in the comments below!
Kind regards,
Sonny