SendGrid as SaaS resource - ARM template deployment

BMD 111 Reputation points
2021-09-20T15:46:03.007+00:00

Hi,

I have noticed that Azure migrated all legacy SendGrid accounts into SaaS resources and pricing tiers names were changed as well.
I am looking for a way to enable creating and configuring SendGrid account using ARM template but did not find anything helpful so far.
The attempt to export existing SendGrid resource to ARM template from Azure Portal was unsuccessful with the following error message:

{"code":"ExportTemplateCompletedWithErrors","message":"Export template operation completed with errors. Some resources were not exported. Please see details for more information.","details":[{"code":"ResourceTypeSchemaNotFound","target":"Microsoft.SaaS/resources","message":"The schema of resource type 'Microsoft.SaaS/resources' is not available. Resources of this type will not be exported to the template."}]}

I have also tried to reach Twilio Support Team but they do not know neither - they recommended contacting Azure Support.
Does anyone know if there is any way to achieve that currently?

Azure DevTest Labs
Azure DevTest Labs
An Azure service that is used for provisioning development and test environments.
256 questions
0 comments No comments
{count} votes

Accepted answer
  1. BMD 111 Reputation points
    2021-09-24T15:28:57.063+00:00

    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:

    1. Find the deployment history in the SendGrid-service-belonging resource group and click into the deployment.
      135068-sg1.png
    2. 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)
      135115-sg2.png
    3. 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.
      135069-sg3.png
    4. After creation, you will see the SendGrid like below, and you will receive an email from the SendGrid side.
      135070-sg4.png

    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.

    2 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. BMD 111 Reputation points
    2021-09-21T07:46:39.24+00:00

    @Anonymous
    Thank you for the hints, but like I said in my first message - I have already tried that approach and exporting template is not possible due to an error which I also mentioned in the previous message.

    It look like some kind of functionality degradation for me because it was possible before.
    Screenshots below:
    133809-1-window.png

    133876-2-window.png

    1 person found this answer helpful.

  2. kobulloc-MSFT 23,496 Reputation points Microsoft Employee
    2021-09-20T21:30:56.627+00:00

    Hello, @BMD !

    As a third party solution usually we would usually recommend reaching out to SendGrid directly but it sounds like you've already done that. I'm not a SendGrid specialist but I'll do my best to try and answer your question.

    One of my favorite ARM features is the ability to export an ARM template from an existing resource or resource group. This allows you to use the portal (or CLI, or PowerShell) to quickly create an ARM template base which you can edit and use for future deployments. In this case you would create your SendGrid resource, export the ARM template, edit it as needed, and then use it for future deployments:

    https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/export-template-portal

    Resource Group:

    133761-image.png

    Resource:

    133730-image.png

    It does appear that SendGrid relies heavily on API calls, however, and there may be some configuration that you'll need to automate using connectors or through some other means:

    I hope this helps!

    0 comments No comments