@Ramnath Muralidhar Firstly, apologies for the delay in responding on this and any inconvenience this issue may have caused
I tried to do the repro in my lab with respect to the article you mentioned.
Initially I tried with the most basic role i.e., Reader role over the Subscription but I was running into the same error as yours.
I then tried with Contributor role over the subscription and I was able to go through the tutorial without any issue.
Contributor grants full access to manage all resources, but does not allow you to assign roles in Azure RBAC. You can read more about it here.
Moreover any role that supports the 'Microsoft.Resources/deployments/validate/action' action should work. Here is a list of builtin roles and supported actions.
You need to add user as contributor or role having required permission over Subscription or Resource Group or Resource as below:
Go to Azure Portal >>Subscriptions>>IAM >> Add Role Assignment:
You can read more about Role Assignments here.
Hope it helps!!!
Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics