Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy Azure Table via Azure Resource Manager Template

So now that it's (apparently) possible to create Blob Containers via an ARM template, is it possible to similarly create an Azure Storage Table? I've searched around but most of the answers are from before Blob Container creation was implemented and available.

I've also found the documentation for the REST API at https://docs.microsoft.com/en-us/rest/api/storageservices/create-table but I'm not sure if and how this maps to the JSON entry in an ARM template.

I'm looking to eliminate the PowerShell script that currently handles the creation of the Table resources in my deployment.

like image 676
Jonathan Claudio Avatar asked Aug 28 '18 05:08

Jonathan Claudio


People also ask

When can you use Azure resource Manager template?

Create any Azure resource: You can immediately use new Azure services and features in templates. As soon as a resource provider introduces new resources, you can deploy those resources through templates. You don't have to wait for tools or modules to be updated before using the new services.

How do I upload an Azure template?

In a web browser, go to the Azure portal and sign in. From the Azure portal search bar, search for deploy a custom template and then select it from the available options. For Template source, notice that Quickstart template is selected by default.

What is an Azure Resource Manager (ARM) template?

Learn how to generate an Azure Resource Manager template (ARM template) using the Azure portal, and the process of editing and deploying the template from the portal. ARM templates are JSON files that define the resources you need to deploy for your solution.

How do I deploy a template in azure?

To deploy the template, use either Azure CLI or Azure PowerShell. Use the resource group you created. Give a name to the deployment so you can easily identify it in the deployment history. For convenience, also create a variable that stores the path to the template file.

How do I configure a resource in azure?

Using the Azure portal, you can configure a resource, for example an Azure Storage account. Before you deploy the resource, you can export your configuration into a template. You can save the template and reuse it in the future.

How do I export a template from Azure portal?

For more information about exporting templates by using the portal, see Export resource groups to templates. The other way to find a working template is from Azure Quickstart templates. In a web browser, go to the Azure portal and sign in. From the Azure portal menu, select Create a resource.


1 Answers

As of the 2019-06-01 version ... Yes

No, this is not currently possible to do with an ARM template.

https://docs.microsoft.com/en-us/rest/api/storagerp/table/create
https://docs.microsoft.com/en-us/azure/templates/microsoft.storage/2019-06-01/storageaccounts/tableservices

{
  "name": "default",
  "type": "Microsoft.Storage/storageAccounts/tableServices",
  "apiVersion": "2019-06-01",
  "properties": {
    "cors": {
      "corsRules": [
        {
          "allowedOrigins": [
            "string"
          ],
          "allowedMethods": [
            "string"
          ],
          "maxAgeInSeconds": "integer",
          "exposedHeaders": [
            "string"
          ],
          "allowedHeaders": [
            "string"
          ]
        }
      ]
    }
  }
}

and tables:

{
  "name": "string",
  "type": "Microsoft.Storage/storageAccounts/tableServices/tables",
  "apiVersion": "2019-06-01"
}
like image 108
4c74356b41 Avatar answered Nov 29 '22 23:11

4c74356b41