My first recommendation would be to go through the guide for Troubleshooting Azure Windows virtual machine activation problems
Azure uses different endpoints for KMS (Key Management Services) activation depending on the cloud region where the VM resides. When using this troubleshooting guide, use the appropriate KMS endpoint that applies to your region.
One of the customer in this post shared what worked for them :
If the VM date/time was set to UTC, activation was successful. However, if date/time changed back to local time, activation warnings would commence again.
Another customer resolved it with the help of these commands:
slmgr /upk --> To uninstall existing product key
slmgr /ipk --> NTBV8-9K7Q8-V27C6-M2BTV-KHMXV
slmgr /ato --> To activate
slmgr /xpr --> To check activation expiry date.
Similar threads on the same issue that you may find helpful:
https://learn.microsoft.com/en-us/answers/questions/803757/cannot-activate-license-of-windows-servervm-in-clo.html
https://learn.microsoft.com/en-us/answers/questions/811308/azure-server-needs-activation.html
Please go through these and let me know if you are still encountering this issue. Thanks.