get Share
Use this data source to access information about an existing File Share.
Note: 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.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}
API Providers
This data source uses the following Azure API Providers:
Microsoft.Storage
: 2023-05-01
Return
A collection of values returned by getShare.
Parameters
A collection of arguments for invoking getShare.
Return
A collection of values returned by getShare.
Parameters
One or more acl blocks as defined below.
A map of custom file share metadata.
The name of the share.
The ID of the storage account in which the share exists.
Note: One of
storage_account_name
orstorage_account_id
must be specified. When specifyingstorage_account_id
the resource will use the Resource Manager API, rather than the Data Plane API.
The name of the storage account in which the share exists. This property is deprecated in favour of storage_account_id
.
See also
Return
A collection of values returned by getShare.
Parameters
Builder for com.pulumi.azure.storage.kotlin.inputs.GetSharePlainArgs.