是否可以通过Azure CLI创建SendGrid帐户?

时间:2017-04-05 20:06:26

标签: azure sendgrid azure-cli

我见过的每个教程和资源都有你通过GUI创建一个SendGrid帐户,但我希望能够使用cli。有可能吗?

类似的东西:

az sendgrid create

3 个答案:

答案 0 :(得分:1)

尽管不能使用Azure Cli创建一个SendGrid帐户,但是可以使用ARM模板创建一个,如下所示:

{
"$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')]"
        }
    }
]

然后,您可以使用az group deployment create来配置模板。

答案 1 :(得分:0)

  

但我希望能够使用cli。有可能吗?

据我所知,azure doe 支持此时通过CLI创建sendgrid。

    private PageNode homePage;

public void setHomePage(PageNode homePage){
    this.homePage = homePage;
}

public PageNode getHomepage(){
    return homePage;
}

答案 2 :(得分:0)

不,这不可能。

在这里您可以看到所有可用的命令:https://docs.microsoft.com/en-us/cli/azure/reference-index?view=azure-cli-latest