get Share
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.getShare({
name: "existing",
storageAccountName: "existing",
});
export const id = example.then(example => example.id);
Content copied to clipboard
import pulumi
import pulumi_azure as azure
example = azure.storage.get_share(name="existing",
storage_account_name="existing")
pulumi.export("id", example.id)
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Storage.GetShare.Invoke(new()
{
Name = "existing",
StorageAccountName = "existing",
});
return new Dictionary<string, object?>
{
["id"] = example.Apply(getShareResult => getShareResult.Id),
};
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := storage.LookupShare(ctx, &storage.LookupShareArgs{
Name: "existing",
StorageAccountName: "existing",
}, nil)
if err != nil {
return err
}
ctx.Export("id", example.Id)
return nil
})
}
Content copied to clipboard
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.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.getShare(GetShareArgs.builder()
.name("existing")
.storageAccountName("existing")
.build());
ctx.export("id", example.applyValue(getShareResult -> getShareResult.id()));
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
Function: azure:storage:getShare
Arguments:
name: existing
storageAccountName: existing
outputs:
id: ${example.id}
Content copied to clipboard
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, storageAccountName: String): 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.
storage Account Name
The name of the storage account.
See also
Return
A collection of values returned by getShare.
Parameters
argument
Builder for com.pulumi.azure.storage.kotlin.inputs.GetSharePlainArgs.