A while back I wrote an article on Azure Automation DSC. Since then, Microsoft has released Guest Configuration as a GA feature. I have build a reference implementation of this technology and posted it on my Github. The example uses Terraform as configuration language to deploy the solution, but this can easily be ported to Bicep or ARM.
The example includes both a Guest Configuration deployed through Azure Policy as one assigned directly to a VM and it also showcases how to install packages through Chocolatey. Enjoy!