1. Packages
  2. Azure Classic
  3. API Docs
  4. storage
  5. Table

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

azure.storage.Table

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Manages a Table within an Azure Storage Account.

    Note on Authentication Shared Key authentication will always be used for this resource, as AzureAD authentication is not supported when setting or retrieving ACLs for Tables.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "azuretest",
        location: "West Europe",
    });
    const exampleAccount = new azure.storage.Account("example", {
        name: "azureteststorage1",
        resourceGroupName: example.name,
        location: example.location,
        accountTier: "Standard",
        accountReplicationType: "LRS",
    });
    const exampleTable = new azure.storage.Table("example", {
        name: "mysampletable",
        storageAccountName: exampleAccount.name,
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="azuretest",
        location="West Europe")
    example_account = azure.storage.Account("example",
        name="azureteststorage1",
        resource_group_name=example.name,
        location=example.location,
        account_tier="Standard",
        account_replication_type="LRS")
    example_table = azure.storage.Table("example",
        name="mysampletable",
        storage_account_name=example_account.name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("azuretest"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
    			Name:                   pulumi.String("azureteststorage1"),
    			ResourceGroupName:      example.Name,
    			Location:               example.Location,
    			AccountTier:            pulumi.String("Standard"),
    			AccountReplicationType: pulumi.String("LRS"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = storage.NewTable(ctx, "example", &storage.TableArgs{
    			Name:               pulumi.String("mysampletable"),
    			StorageAccountName: exampleAccount.Name,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "azuretest",
            Location = "West Europe",
        });
    
        var exampleAccount = new Azure.Storage.Account("example", new()
        {
            Name = "azureteststorage1",
            ResourceGroupName = example.Name,
            Location = example.Location,
            AccountTier = "Standard",
            AccountReplicationType = "LRS",
        });
    
        var exampleTable = new Azure.Storage.Table("example", new()
        {
            Name = "mysampletable",
            StorageAccountName = exampleAccount.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.storage.Account;
    import com.pulumi.azure.storage.AccountArgs;
    import com.pulumi.azure.storage.Table;
    import com.pulumi.azure.storage.TableArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("azuretest")
                .location("West Europe")
                .build());
    
            var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
                .name("azureteststorage1")
                .resourceGroupName(example.name())
                .location(example.location())
                .accountTier("Standard")
                .accountReplicationType("LRS")
                .build());
    
            var exampleTable = new Table("exampleTable", TableArgs.builder()
                .name("mysampletable")
                .storageAccountName(exampleAccount.name())
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: azuretest
          location: West Europe
      exampleAccount:
        type: azure:storage:Account
        name: example
        properties:
          name: azureteststorage1
          resourceGroupName: ${example.name}
          location: ${example.location}
          accountTier: Standard
          accountReplicationType: LRS
      exampleTable:
        type: azure:storage:Table
        name: example
        properties:
          name: mysampletable
          storageAccountName: ${exampleAccount.name}
    

    Create Table Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Table(name: string, args: TableArgs, opts?: CustomResourceOptions);
    @overload
    def Table(resource_name: str,
              args: TableArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Table(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              storage_account_name: Optional[str] = None,
              acls: Optional[Sequence[TableAclArgs]] = None,
              name: Optional[str] = None)
    func NewTable(ctx *Context, name string, args TableArgs, opts ...ResourceOption) (*Table, error)
    public Table(string name, TableArgs args, CustomResourceOptions? opts = null)
    public Table(String name, TableArgs args)
    public Table(String name, TableArgs args, CustomResourceOptions options)
    
    type: azure:storage:Table
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args TableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args TableArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args TableArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TableArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var azureTableResource = new Azure.Storage.Table("azureTableResource", new()
    {
        StorageAccountName = "string",
        Acls = new[]
        {
            new Azure.Storage.Inputs.TableAclArgs
            {
                Id = "string",
                AccessPolicies = new[]
                {
                    new Azure.Storage.Inputs.TableAclAccessPolicyArgs
                    {
                        Expiry = "string",
                        Permissions = "string",
                        Start = "string",
                    },
                },
            },
        },
        Name = "string",
    });
    
    example, err := storage.NewTable(ctx, "azureTableResource", &storage.TableArgs{
    	StorageAccountName: pulumi.String("string"),
    	Acls: storage.TableAclArray{
    		&storage.TableAclArgs{
    			Id: pulumi.String("string"),
    			AccessPolicies: storage.TableAclAccessPolicyArray{
    				&storage.TableAclAccessPolicyArgs{
    					Expiry:      pulumi.String("string"),
    					Permissions: pulumi.String("string"),
    					Start:       pulumi.String("string"),
    				},
    			},
    		},
    	},
    	Name: pulumi.String("string"),
    })
    
    var azureTableResource = new Table("azureTableResource", TableArgs.builder()
        .storageAccountName("string")
        .acls(TableAclArgs.builder()
            .id("string")
            .accessPolicies(TableAclAccessPolicyArgs.builder()
                .expiry("string")
                .permissions("string")
                .start("string")
                .build())
            .build())
        .name("string")
        .build());
    
    azure_table_resource = azure.storage.Table("azureTableResource",
        storage_account_name="string",
        acls=[{
            "id": "string",
            "access_policies": [{
                "expiry": "string",
                "permissions": "string",
                "start": "string",
            }],
        }],
        name="string")
    
    const azureTableResource = new azure.storage.Table("azureTableResource", {
        storageAccountName: "string",
        acls: [{
            id: "string",
            accessPolicies: [{
                expiry: "string",
                permissions: "string",
                start: "string",
            }],
        }],
        name: "string",
    });
    
    type: azure:storage:Table
    properties:
        acls:
            - accessPolicies:
                - expiry: string
                  permissions: string
                  start: string
              id: string
        name: string
        storageAccountName: string
    

    Table Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Table resource accepts the following input properties:

    StorageAccountName string
    Specifies the storage account in which to create the storage table. Changing this forces a new resource to be created.
    Acls List<TableAcl>
    One or more acl blocks as defined below.
    Name string
    The name of the storage table. Only Alphanumeric characters allowed, starting with a letter. Must be unique within the storage account the table is located. Changing this forces a new resource to be created.
    StorageAccountName string
    Specifies the storage account in which to create the storage table. Changing this forces a new resource to be created.
    Acls []TableAclArgs
    One or more acl blocks as defined below.
    Name string
    The name of the storage table. Only Alphanumeric characters allowed, starting with a letter. Must be unique within the storage account the table is located. Changing this forces a new resource to be created.
    storageAccountName String
    Specifies the storage account in which to create the storage table. Changing this forces a new resource to be created.
    acls List<TableAcl>
    One or more acl blocks as defined below.
    name String
    The name of the storage table. Only Alphanumeric characters allowed, starting with a letter. Must be unique within the storage account the table is located. Changing this forces a new resource to be created.
    storageAccountName string
    Specifies the storage account in which to create the storage table. Changing this forces a new resource to be created.
    acls TableAcl[]
    One or more acl blocks as defined below.
    name string
    The name of the storage table. Only Alphanumeric characters allowed, starting with a letter. Must be unique within the storage account the table is located. Changing this forces a new resource to be created.
    storage_account_name str
    Specifies the storage account in which to create the storage table. Changing this forces a new resource to be created.
    acls Sequence[TableAclArgs]
    One or more acl blocks as defined below.
    name str
    The name of the storage table. Only Alphanumeric characters allowed, starting with a letter. Must be unique within the storage account the table is located. Changing this forces a new resource to be created.
    storageAccountName String
    Specifies the storage account in which to create the storage table. Changing this forces a new resource to be created.
    acls List<Property Map>
    One or more acl blocks as defined below.
    name String
    The name of the storage table. Only Alphanumeric characters allowed, starting with a letter. Must be unique within the storage account the table is located. Changing this forces a new resource to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Table resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Table Resource

    Get an existing Table resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: TableState, opts?: CustomResourceOptions): Table
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            acls: Optional[Sequence[TableAclArgs]] = None,
            name: Optional[str] = None,
            storage_account_name: Optional[str] = None) -> Table
    func GetTable(ctx *Context, name string, id IDInput, state *TableState, opts ...ResourceOption) (*Table, error)
    public static Table Get(string name, Input<string> id, TableState? state, CustomResourceOptions? opts = null)
    public static Table get(String name, Output<String> id, TableState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Acls List<TableAcl>
    One or more acl blocks as defined below.
    Name string
    The name of the storage table. Only Alphanumeric characters allowed, starting with a letter. Must be unique within the storage account the table is located. Changing this forces a new resource to be created.
    StorageAccountName string
    Specifies the storage account in which to create the storage table. Changing this forces a new resource to be created.
    Acls []TableAclArgs
    One or more acl blocks as defined below.
    Name string
    The name of the storage table. Only Alphanumeric characters allowed, starting with a letter. Must be unique within the storage account the table is located. Changing this forces a new resource to be created.
    StorageAccountName string
    Specifies the storage account in which to create the storage table. Changing this forces a new resource to be created.
    acls List<TableAcl>
    One or more acl blocks as defined below.
    name String
    The name of the storage table. Only Alphanumeric characters allowed, starting with a letter. Must be unique within the storage account the table is located. Changing this forces a new resource to be created.
    storageAccountName String
    Specifies the storage account in which to create the storage table. Changing this forces a new resource to be created.
    acls TableAcl[]
    One or more acl blocks as defined below.
    name string
    The name of the storage table. Only Alphanumeric characters allowed, starting with a letter. Must be unique within the storage account the table is located. Changing this forces a new resource to be created.
    storageAccountName string
    Specifies the storage account in which to create the storage table. Changing this forces a new resource to be created.
    acls Sequence[TableAclArgs]
    One or more acl blocks as defined below.
    name str
    The name of the storage table. Only Alphanumeric characters allowed, starting with a letter. Must be unique within the storage account the table is located. Changing this forces a new resource to be created.
    storage_account_name str
    Specifies the storage account in which to create the storage table. Changing this forces a new resource to be created.
    acls List<Property Map>
    One or more acl blocks as defined below.
    name String
    The name of the storage table. Only Alphanumeric characters allowed, starting with a letter. Must be unique within the storage account the table is located. Changing this forces a new resource to be created.
    storageAccountName String
    Specifies the storage account in which to create the storage table. Changing this forces a new resource to be created.

    Supporting Types

    TableAcl, TableAclArgs

    Id string
    The ID which should be used for this Shared Identifier.
    AccessPolicies List<TableAclAccessPolicy>
    An access_policy block as defined below.
    Id string
    The ID which should be used for this Shared Identifier.
    AccessPolicies []TableAclAccessPolicy
    An access_policy block as defined below.
    id String
    The ID which should be used for this Shared Identifier.
    accessPolicies List<TableAclAccessPolicy>
    An access_policy block as defined below.
    id string
    The ID which should be used for this Shared Identifier.
    accessPolicies TableAclAccessPolicy[]
    An access_policy block as defined below.
    id str
    The ID which should be used for this Shared Identifier.
    access_policies Sequence[TableAclAccessPolicy]
    An access_policy block as defined below.
    id String
    The ID which should be used for this Shared Identifier.
    accessPolicies List<Property Map>
    An access_policy block as defined below.

    TableAclAccessPolicy, TableAclAccessPolicyArgs

    Expiry string
    The ISO8061 UTC time at which this Access Policy should be valid until.
    Permissions string
    The permissions which should associated with this Shared Identifier.
    Start string
    The ISO8061 UTC time at which this Access Policy should be valid from.
    Expiry string
    The ISO8061 UTC time at which this Access Policy should be valid until.
    Permissions string
    The permissions which should associated with this Shared Identifier.
    Start string
    The ISO8061 UTC time at which this Access Policy should be valid from.
    expiry String
    The ISO8061 UTC time at which this Access Policy should be valid until.
    permissions String
    The permissions which should associated with this Shared Identifier.
    start String
    The ISO8061 UTC time at which this Access Policy should be valid from.
    expiry string
    The ISO8061 UTC time at which this Access Policy should be valid until.
    permissions string
    The permissions which should associated with this Shared Identifier.
    start string
    The ISO8061 UTC time at which this Access Policy should be valid from.
    expiry str
    The ISO8061 UTC time at which this Access Policy should be valid until.
    permissions str
    The permissions which should associated with this Shared Identifier.
    start str
    The ISO8061 UTC time at which this Access Policy should be valid from.
    expiry String
    The ISO8061 UTC time at which this Access Policy should be valid until.
    permissions String
    The permissions which should associated with this Shared Identifier.
    start String
    The ISO8061 UTC time at which this Access Policy should be valid from.

    Import

    Table’s within a Storage Account can be imported using the resource id, e.g.

    $ pulumi import azure:storage/table:Table table1 "https://example.table.core.windows.net/Tables('replace-with-table-name')"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi