Hi Jakub
You can create custom policy with Deployifnotexists effect to deploy SAP extensions for VM.
SAP extension reference: https://learn.microsoft.com/en-us/azure/sap/workloads/vm-extension-for-sap-new. It has examples of PowerShell, CLI, Terraform.
SAP configurations can be taken from the above link for ARM template being used in policy.
Sample Built-in policy that can be updated with SAP extension configuration in the ARM template code: Configure Dependency agent on Azure Arc enabled Linux servers