Skip to main content

Posts

Showing posts from 2025

How to embed PowerFX in NET app

How to embed PowerFX in a .NET Application PowerFX is a language from Microsoft aimed at power users. Writing PowerFX feels like Excel formulas, and one of the building blocks of PowerFX is actually “formulas” that are reactive to other formulas. Microsoft uses PowerFX mainly as the low code language for the PowerApps offering. A few years ago, Microsoft open sourced PowerFX with the goal of letting others take advantage of the power and simplicity of the language. The main repo is located at https://github.com/microsoft/Power-Fx . The repo contains a link nice introductory video about the what, why and how of PowerFX ( https://www.youtube-nocookie.com/embed/ik6k89WNjuk ). If you are a .NET developer, you too can take advantage of the power and simplicity of PowerFX by embedding a .NET PowerFX Interpreter created by Microsoft. One use case for embedding PowerFX in a .NET app is to allow Business Users to define Business Rules in PowerFX and then integrate them into your app. This all...

How to read build variables in Source Generators

How to read build variables in Source Generators I used GitHub copilot to help me create a source generator that reads the schema of a database and generates C# ADO.net code that can call SQL Stored Procedures, Views and Functions in that database ( https://github.com/TheJuanitoLearnsShow/Puppy.Ado.SourceGenerator ). The connection string to the database is set on a build variable in the consuming csproj file. The problem is that copilot missed the step described in Microsoft’s Source Generator Cookbook . The missing step is to add a CompilerVisibleProperty element to an ItemGroup for each of the build variables you want the source generator to use. For example, my source generator uses two build variables: DbGen_EnableLiveSchema and DbGen_ConnectionString, so they are defined in the PropertyGroup element in the consuming csproj file: <DbGen_EnableLiveSchema>true</DbGen_EnableLiveSchema> <DbGen_ConnectionString>Data Source=.\sqlExpress;Database=AutomatedTESTS_AdoGen...

APIM requests not showing downstream requests in application

APIM requests not showing downstream requests in application insights In Application Insights, if you are not seeing the telemetry for the backend service being called by APIM, it could be you have the wrong type of correlation type option set under that API’s settings in APIM. The correct setting, for newer web apps that use the latest open telemetry or application insights nugets should be W3C . The default value is Legacy so you will need to change it to W3C. Without that correlation, the appropriate headers will not be included in the request to the backend service from APIM and the two parts of the request would appear as separate flows inside Application Insights.