Class Blob
Manages a Blob within a Storage Container.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "West Europe",
});
var exampleAccount = new Azure.Storage.Account("exampleAccount", new Azure.Storage.AccountArgs
{
ResourceGroupName = exampleResourceGroup.Name,
Location = exampleResourceGroup.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
});
var exampleContainer = new Azure.Storage.Container("exampleContainer", new Azure.Storage.ContainerArgs
{
StorageAccountName = exampleAccount.Name,
ContainerAccessType = "private",
});
var exampleBlob = new Azure.Storage.Blob("exampleBlob", new Azure.Storage.BlobArgs
{
StorageAccountName = exampleAccount.Name,
StorageContainerName = exampleContainer.Name,
Type = "Block",
Source = new FileAsset("some-local-file.zip"),
});
}
}
Inherited Members
Namespace: Pulumi.Azure.Storage
Assembly: Pulumi.Azure.dll
Syntax
public class Blob : CustomResource
Constructors
View SourceBlob(String, BlobArgs, CustomResourceOptions)
Create a Blob resource with the given unique name, arguments, and options.
Declaration
public Blob(string name, BlobArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| BlobArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAccessTier
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
Declaration
public Output<string> AccessTier { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ContentType
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
Declaration
public Output<string> ContentType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Metadata
A map of custom blob metadata.
Declaration
public Output<ImmutableDictionary<string, string>> Metadata { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
Name
The name of the storage blob. Must be unique within the storage container the blob is located.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Parallelism
The number of workers per CPU core to run for concurrent uploads. Defaults to 8.
Declaration
public Output<int?> Parallelism { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Size
Used only for page blobs to specify the size in bytes of the blob to be created. Must be a multiple of 512. Defaults to 0.
Declaration
public Output<int?> Size { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Source
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified.
Declaration
public Output<AssetOrArchive> Source { get; }
Property Value
| Type | Description |
|---|---|
| Output<AssetOrArchive> |
SourceContent
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified.
Declaration
public Output<string> SourceContent { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceUri
The URI of an existing blob, or a file in the Azure File service, to use as the source contents
for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.
Declaration
public Output<string> SourceUri { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
StorageAccountName
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
Declaration
public Output<string> StorageAccountName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
StorageContainerName
The name of the storage container in which this blob should be created.
Declaration
public Output<string> StorageContainerName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Type
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
Declaration
public Output<string> Type { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Url
The URL of the blob
Declaration
public Output<string> Url { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, BlobState, CustomResourceOptions)
Get an existing Blob resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Blob Get(string name, Input<string> id, BlobState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| BlobState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Blob |