getAccountBlobContainerSAS

Use this data source to obtain a Shared Access Signature (SAS Token) for an existing Storage Account Blob Container. Shared access signatures allow fine-grained, ephemeral access control to various aspects of an Azure Storage Account Blob Container.

Example Usage

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.Container;
import com.pulumi.azure.storage.ContainerArgs;
import com.pulumi.azure.storage.StorageFunctions;
import com.pulumi.azure.storage.inputs.GetAccountBlobContainerSASArgs;
import com.pulumi.azure.storage.inputs.GetAccountBlobContainerSASPermissionsArgs;
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 rg = new ResourceGroup("rg", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var storage = new Account("storage", AccountArgs.builder()
.resourceGroupName(rg.name())
.location(rg.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
var container = new Container("container", ContainerArgs.builder()
.storageAccountName(storage.name())
.containerAccessType("private")
.build());
final var example = StorageFunctions.getAccountBlobContainerSAS(GetAccountBlobContainerSASArgs.builder()
.connectionString(storage.primaryConnectionString())
.containerName(container.name())
.httpsOnly(true)
.ipAddress("168.1.5.65")
.start("2018-03-21")
.expiry("2018-03-21")
.permissions(GetAccountBlobContainerSASPermissionsArgs.builder()
.read(true)
.add(true)
.create(false)
.write(false)
.delete(true)
.list(true)
.build())
.cacheControl("max-age=5")
.contentDisposition("inline")
.contentEncoding("deflate")
.contentLanguage("en-US")
.contentType("application/json")
.build());
ctx.export("sasUrlQueryString", example.applyValue(getAccountBlobContainerSASResult -> getAccountBlobContainerSASResult).applyValue(example -> example.applyValue(getAccountBlobContainerSASResult -> getAccountBlobContainerSASResult.sas())));
}
}

Return

A collection of values returned by getAccountBlobContainerSAS.

Parameters

argument

A collection of arguments for invoking getAccountBlobContainerSAS.


suspend fun getAccountBlobContainerSAS(cacheControl: String? = null, connectionString: String, containerName: String, contentDisposition: String? = null, contentEncoding: String? = null, contentLanguage: String? = null, contentType: String? = null, expiry: String, httpsOnly: Boolean? = null, ipAddress: String? = null, permissions: GetAccountBlobContainerSASPermissions, start: String): GetAccountBlobContainerSASResult

Return

A collection of values returned by getAccountBlobContainerSAS.

See also

Parameters

cacheControl

The Cache-Control response header that is sent when this SAS token is used.

connectionString

The connection string for the storage account to which this SAS applies. Typically directly from the primary_connection_string attribute of an azure.storage.Account resource.

containerName

Name of the container.

contentDisposition

The Content-Disposition response header that is sent when this SAS token is used.

contentEncoding

The Content-Encoding response header that is sent when this SAS token is used.

contentLanguage

The Content-Language response header that is sent when this SAS token is used.

contentType

The Content-Type response header that is sent when this SAS token is used.

expiry

The expiration time and date of this SAS. Must be a valid ISO-8601 format time/date string.

NOTE: The ISO-8601 Time offset from UTC is currently not supported by the service, which will result into 409 error.

httpsOnly

Only permit https access. If false, both http and https are permitted. Defaults to true.

ipAddress

Single IPv4 address or range (connected with a dash) of IPv4 addresses.

permissions

A permissions block as defined below.

start

The starting time and date of validity of this SAS. Must be a valid ISO-8601 format time/date string.


Return

A collection of values returned by getAccountBlobContainerSAS.

See also

Parameters

argument

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