1. Packages
  2. Azure Classic
  3. API Docs
  4. datashare
  5. getShare

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Use this data source to access information about an existing Data Share.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var exampleAccount = Output.Create(Azure.DataShare.GetAccount.InvokeAsync(new Azure.DataShare.GetAccountArgs
            {
                Name = "example-account",
                ResourceGroupName = "example-resource-group",
            }));
            var exampleShare = exampleAccount.Apply(exampleAccount => Output.Create(Azure.DataShare.GetShare.InvokeAsync(new Azure.DataShare.GetShareArgs
            {
                Name = "existing",
                AccountId = exampleAccount.Id,
            })));
            this.Id = exampleShare.Apply(exampleShare => exampleShare.Id);
        }
    
        [Output("id")]
        public Output<string> Id { get; set; }
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/datashare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleAccount, err := datashare.LookupAccount(ctx, &datashare.LookupAccountArgs{
    			Name:              "example-account",
    			ResourceGroupName: "example-resource-group",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleShare, err := datashare.LookupShare(ctx, &datashare.LookupShareArgs{
    			Name:      "existing",
    			AccountId: exampleAccount.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("id", exampleShare.Id)
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const exampleAccount = azure.datashare.getAccount({
        name: "example-account",
        resourceGroupName: "example-resource-group",
    });
    const exampleShare = exampleAccount.then(exampleAccount => azure.datashare.getShare({
        name: "existing",
        accountId: exampleAccount.id,
    }));
    export const id = exampleShare.then(exampleShare => exampleShare.id);
    
    import pulumi
    import pulumi_azure as azure
    
    example_account = azure.datashare.get_account(name="example-account",
        resource_group_name="example-resource-group")
    example_share = azure.datashare.get_share(name="existing",
        account_id=example_account.id)
    pulumi.export("id", example_share.id)
    

    Example coming soon!

    Using getShare

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getShare(args: GetShareArgs, opts?: InvokeOptions): Promise<GetShareResult>
    function getShareOutput(args: GetShareOutputArgs, opts?: InvokeOptions): Output<GetShareResult>
    def get_share(account_id: Optional[str] = None,
                  name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetShareResult
    def get_share_output(account_id: Optional[pulumi.Input[str]] = None,
                  name: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetShareResult]
    func LookupShare(ctx *Context, args *LookupShareArgs, opts ...InvokeOption) (*LookupShareResult, error)
    func LookupShareOutput(ctx *Context, args *LookupShareOutputArgs, opts ...InvokeOption) LookupShareResultOutput

    > Note: This function is named LookupShare in the Go SDK.

    public static class GetShare 
    {
        public static Task<GetShareResult> InvokeAsync(GetShareArgs args, InvokeOptions? opts = null)
        public static Output<GetShareResult> Invoke(GetShareInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetShareResult> getShare(GetShareArgs args, InvokeOptions options)
    public static Output<GetShareResult> getShare(GetShareArgs args, InvokeOptions options)
    
    fn::invoke:
      function: azure:datashare/getShare:getShare
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountId string
    The ID of the Data Share account in which the Data Share is created.
    Name string
    The name of this Data Share.
    AccountId string
    The ID of the Data Share account in which the Data Share is created.
    Name string
    The name of this Data Share.
    accountId String
    The ID of the Data Share account in which the Data Share is created.
    name String
    The name of this Data Share.
    accountId string
    The ID of the Data Share account in which the Data Share is created.
    name string
    The name of this Data Share.
    account_id str
    The ID of the Data Share account in which the Data Share is created.
    name str
    The name of this Data Share.
    accountId String
    The ID of the Data Share account in which the Data Share is created.
    name String
    The name of this Data Share.

    getShare Result

    The following output properties are available:

    AccountId string
    Description string
    The description of the Data Share.
    Id string
    The provider-assigned unique ID for this managed resource.
    Kind string
    The kind of the Data Share.
    Name string
    The name of the snapshot schedule.
    SnapshotSchedules List<GetShareSnapshotSchedule>
    A snapshot_schedule block as defined below.
    Terms string
    The terms of the Data Share.
    AccountId string
    Description string
    The description of the Data Share.
    Id string
    The provider-assigned unique ID for this managed resource.
    Kind string
    The kind of the Data Share.
    Name string
    The name of the snapshot schedule.
    SnapshotSchedules []GetShareSnapshotSchedule
    A snapshot_schedule block as defined below.
    Terms string
    The terms of the Data Share.
    accountId String
    description String
    The description of the Data Share.
    id String
    The provider-assigned unique ID for this managed resource.
    kind String
    The kind of the Data Share.
    name String
    The name of the snapshot schedule.
    snapshotSchedules List<GetShareSnapshotSchedule>
    A snapshot_schedule block as defined below.
    terms String
    The terms of the Data Share.
    accountId string
    description string
    The description of the Data Share.
    id string
    The provider-assigned unique ID for this managed resource.
    kind string
    The kind of the Data Share.
    name string
    The name of the snapshot schedule.
    snapshotSchedules GetShareSnapshotSchedule[]
    A snapshot_schedule block as defined below.
    terms string
    The terms of the Data Share.
    account_id str
    description str
    The description of the Data Share.
    id str
    The provider-assigned unique ID for this managed resource.
    kind str
    The kind of the Data Share.
    name str
    The name of the snapshot schedule.
    snapshot_schedules Sequence[GetShareSnapshotSchedule]
    A snapshot_schedule block as defined below.
    terms str
    The terms of the Data Share.
    accountId String
    description String
    The description of the Data Share.
    id String
    The provider-assigned unique ID for this managed resource.
    kind String
    The kind of the Data Share.
    name String
    The name of the snapshot schedule.
    snapshotSchedules List<Property Map>
    A snapshot_schedule block as defined below.
    terms String
    The terms of the Data Share.

    Supporting Types

    GetShareSnapshotSchedule

    Name string
    The name of this Data Share.
    Recurrence string
    The interval of the synchronization with the source data.
    StartTime string
    The synchronization with the source data's start time.
    Name string
    The name of this Data Share.
    Recurrence string
    The interval of the synchronization with the source data.
    StartTime string
    The synchronization with the source data's start time.
    name String
    The name of this Data Share.
    recurrence String
    The interval of the synchronization with the source data.
    startTime String
    The synchronization with the source data's start time.
    name string
    The name of this Data Share.
    recurrence string
    The interval of the synchronization with the source data.
    startTime string
    The synchronization with the source data's start time.
    name str
    The name of this Data Share.
    recurrence str
    The interval of the synchronization with the source data.
    start_time str
    The synchronization with the source data's start time.
    name String
    The name of this Data Share.
    recurrence String
    The interval of the synchronization with the source data.
    startTime String
    The synchronization with the source data's start time.

    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.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.