getShare

suspend fun getShare(argument: GetSharePlainArgs): GetShareResult

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

Note on Authentication Shared Key authentication will always be used for this data source, as AzureAD authentication is not supported by the Storage API for files.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.storage.getAccount({
name: "exampleaccount",
resourceGroupName: "examples",
});
const exampleGetShare = example.then(example => azure.storage.getShare({
name: "existing",
storageAccountId: example.id,
}));
import pulumi
import pulumi_azure as azure
example = azure.storage.get_account(name="exampleaccount",
resource_group_name="examples")
example_get_share = azure.storage.get_share(name="existing",
storage_account_id=example.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Storage.GetAccount.Invoke(new()
{
Name = "exampleaccount",
ResourceGroupName = "examples",
});
var exampleGetShare = Azure.Storage.GetShare.Invoke(new()
{
Name = "existing",
StorageAccountId = example.Apply(getAccountResult => getAccountResult.Id),
});
});
package main
import (
"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 := storage.LookupAccount(ctx, &storage.LookupAccountArgs{
Name: "exampleaccount",
ResourceGroupName: pulumi.StringRef("examples"),
}, nil)
if err != nil {
return err
}
_, err = storage.LookupShare(ctx, &storage.LookupShareArgs{
Name: "existing",
StorageAccountId: pulumi.StringRef(example.Id),
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.storage.StorageFunctions;
import com.pulumi.azure.storage.inputs.GetAccountArgs;
import com.pulumi.azure.storage.inputs.GetShareArgs;
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) {
final var example = StorageFunctions.getAccount(GetAccountArgs.builder()
.name("exampleaccount")
.resourceGroupName("examples")
.build());
final var exampleGetShare = StorageFunctions.getShare(GetShareArgs.builder()
.name("existing")
.storageAccountId(example.applyValue(getAccountResult -> getAccountResult.id()))
.build());
}
}
variables:
example:
fn::invoke:
function: azure:storage:getAccount
arguments:
name: exampleaccount
resourceGroupName: examples
exampleGetShare:
fn::invoke:
function: azure:storage:getShare
arguments:
name: existing
storageAccountId: ${example.id}

Return

A collection of values returned by getShare.

Parameters

argument

A collection of arguments for invoking getShare.


suspend fun getShare(acls: List<GetShareAcl>? = null, metadata: Map<String, String>? = null, name: String, storageAccountId: String? = null, storageAccountName: String? = null): GetShareResult

Return

A collection of values returned by getShare.

Parameters

acls

One or more acl blocks as defined below.

metadata

A map of custom file share metadata.

name

The name of the share.

storageAccountId

The ID of the storage account in which the share exists.

NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

storageAccountName

The name of the storage account in which the share exists. This property is deprecated in favour of storage_account_id.

See also


suspend fun getShare(argument: suspend GetSharePlainArgsBuilder.() -> Unit): GetShareResult

Return

A collection of values returned by getShare.

Parameters

argument

Builder for com.pulumi.azure.storage.kotlin.inputs.GetSharePlainArgs.

See also