Hello Tarneshdeep Singh
Welcome to Microsoft Q&A Platform, thanks for posting your query here.
Based on the issue description, you have resized your Azure VM from B4ms to D4as_v4, but the OS layer is still showing the old size. This can happen if the VM is not properly restarted after resizing.
You mentioned that you have already tried rebooting the machine, but the issue still persists.
Ensure that the Azure Guest Agent running inside the VM is up to date. The Guest Agent is responsible for reporting the VM's configuration to the Azure Portal. You can update the Guest Agent by using the Azure Portal, Azure CLI, or PowerShell commands.
I would recommend you to perform a "Redeploy" operation on the VM. This operation moves the VM to a new node within the Azure infrastructure and can help resolve issues related to VM state.
Ref: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/redeploy-to-new-node-linux
After the VM is started, please check if the correct number of vCPUs are showing up in the OS layer.
Hope this helps.