You can use the Microsoft.Authorization/roleAssignments
resource type to assign the necessary role to the principal deploying the template. This role should have permissions to register resource providers.
If your service requires acceptance of specific legal terms (such as for Responsible AI), this usually needs to be done manually in the Azure portal. However, for a smoother deployment experience, you might want to include instructions or a script as part of your Managed Application package to guide the customer through this process.
Make sure that the dependencies within your template are correctly defined. If certain resources depend on the availability of others (like network resources), these dependencies should be explicitly stated in the template.