Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create a SendGrid account through Azure CLI?

Every tutorial and resource I've seen has you create a SendGrid account through the GUI, but I want to be able to use the cli. Is it possible?

Something like:

az sendgrid create
like image 823
user3052659 Avatar asked Apr 05 '17 20:04

user3052659


1 Answers

Although you cannot create a SendGrid account using Azure Cli, you can create one using an ARM template, as following

{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
    "name": {
        "type": "string"
    },
    "location": {
        "type": "string"
    },
    "plan_name": {
        "type": "string"
    },
    "plan_publisher": {
        "type": "string"
    },
    "plan_product": {
        "type": "string"
    },
    "plan_promotion_code": {
        "type": "string"
    },
    "password": {
        "type": "secureString"
    },
    "email": {
        "type": "string"
    },
    "firstName": {
        "type": "string"
    },
    "lastName": {
        "type": "string"
    },
    "company": {
        "type": "string"
    },
    "website": {
        "type": "string"
    },
    "acceptMarketingEmails": {
        "type": "string"
    }
},
"resources": [
    {
        "apiVersion": "2015-01-01",
        "name": "[parameters('name')]",
        "type": "Sendgrid.Email/accounts",
        "location": "[parameters('location')]",
        "plan": {
            "name": "[parameters('plan_name')]",
            "publisher": "[parameters('plan_publisher')]",
            "product": "[parameters('plan_product')]",
            "promotionCode": "[parameters('plan_promotion_code')]"
        },
        "properties": {
            "password": "[parameters('password')]",
            "acceptMarketingEmails": "[parameters('acceptMarketingEmails')]",
            "email": "[parameters('email')]",
            "firstName": "[parameters('firstName')]",
            "lastName": "[parameters('lastName')]",
            "company": "[parameters('company')]",
            "website": "[parameters('website')]"
        }
    }
]

Then you can use az group deployment create to provision your template.

like image 83
Loul G. Avatar answered Nov 16 '22 00:11

Loul G.