I’m about to write Azure Function for data anonymization in Dataverse with GitHub Copilot. I created the tables and model driven app with M365 Copilot and maker portal Copilot in previous post. I also proposed prompt for me to use in GitHub Copilot. I think this is vibe coding since I have been doing 15 minutes of work and I already have data model and UI ready for the configuration app.

I have not done Azure Function for ages, so I had no clue which version I would need. I want to have .NET Framework, that is what I know. Let’s call to my old pall M365 Copilot.

Azure Function version choices in Visual Studio 2022
Azure Function version choices in Visual Studio 2022

I need to create Azure Function with Visual Studio 2022. The function will handle Dataverse data.

I got instructions but not answer which worker I should select.

I added the picture above, gave it to Copilot and asked again

Asking help from M365 Copilot for selecting Azure Function worker in Visual Studio 2022
Asking help from M365 Copilot for selecting Azure Function worker in Visual Studio 2022

Based on the options shown in your image and your goal of building a modern Azure Function that interacts with Dataverse, I recommend selecting:

.NET 8.0 Isolated (Long Term Support)

Here’s why:

  • Long-Term Support (LTS): Ensures stability and updates for enterprise-grade applications.
  • Isolated Worker: Offers better separation of concerns, improved startup performance, and more flexibility for dependency injection and middleware.
  • Modern SDK Compatibility: Works well with the latest Dataverse SDK and Azure libraries.

When to Use Other Options

  • .NET Framework In-process v1 or Isolated v4: Only if you’re maintaining legacy code or need compatibility with older libraries.
  • .NET 8.0 In-process: Slightly simpler setup, but less flexible than isolated for complex scenarios like custom dependency injection or middleware.

Now I have empty function solution and project. Let’s copy the prompt from previous post, just a bit fine tune it and then allow GitHub Copilot to do the trick.

Prompting GitHub Copilot with prompt got from M365 Copilot to create Azure Function functionality
Prompting GitHub Copilot with prompt got from M365 Copilot to create Azure Function functionality

I got the code, I see red there – I need to NuGet packages to get this working. Then I need to check the table and field names. And then I need to check to code logic and finally test it. I installed packages

  • Microsoft.PowerPlatform.Dataverse.Client
  • Microsoft.CrmSdk.CoreAssemblies
  • Polly
GitHub Copilot output code and installing NuGet packages

Then I noticed, that .NET 8 is wrong version for me. I checked from working function project and it had version .NET Framework 6.0. I changed to that, removed CrmSdk.CoreAssemblies package. Downgraded Dataverse.Client packate to version 1.0.39 and emptied function code.

I re-prompted with GitHub Copilot like below picture. Now it seems to be more stable. Still need to figure out all the red stuff away.

Refactoring Data Anonymization function
Refactoring Data Anonymization function

I added couple using statements that Visual Studio offered me, and then one foreach EntityCollection needed postfix .Entitites. Then I was able to build my code.

Then I need to change the table and column names

I have the code ready – I need to check what it does and change the actual table and column names which were created into Power Platform.

Checking the GitHub Copilot generated code and change table and column names to the actual names
Checking the GitHub Copilot generated code and change table and column names to the actual names