On the advice of @Anonymous I have contacted Azure Support and they helped me finding the workaround for exporting SendGrid's SaaS resource to ARM template. If anyone encounters similar issues, the solution is as follows:
The catch was to create free account first and then check the generated template:
- Find the deployment history in the SendGrid-service-belonging resource group and click into the deployment.
- When we click into the template of this deployment, we will see how this SaaS template looks like. (In some services, they don’t create the service by template and use rest api directly, so we may not see the deployment by this way)
- Since it is SaaS service, it required for the plan id, offer id and term id as the same. Rename the service to avoid conflict of the name.
- After creation, you will see the SendGrid like below, and you will receive an email from the SendGrid side.
Another not exactly straight forward thing are the SendGrid's new planIds which are:
"free-100",
"essentials40k",
"essentials100k",
"pro-100k",
"pro-300k",
"pro-700k",
"pro-1p5m",
"pro-2p5m"
Hope this will help someone.