Table of Contents

Codeunit "Azure Blob Storage UTCAP"

ID 70344763
Namespace: CapVision.Core.Storage

Ce module propose une implémentation du service Azure Blob Storage.

Examples

Lister les conteneurs

``` AL
    var
        AzureBlobStorage: Codeunit "Azure Blob Storage UTCAP";
        Containers: List of [Text];
        ContainerName: Text;
        ContainerNames: TextBuilder;
    begin
        AzureBlobStorage.Initialize('mystorage', '<key1>');
        AzureBlobStorage.GetContainers(Containers);
    
        foreach ContainerName in Containers do
            ContainerNames.AppendLine(ContainerName);
        
        Message(ContainerNames.ToText());
    end;
```

Créer un blob

``` AL
    var
        AzureBlobStorage: Codeunit "Azure Blob Storage UTCAP";
        TempBlob: Codeunit "Temp Blob";
        InStr: InStream;
        FromFile: Text;
    begin
        TempBlob.CreateInStream(InStr);
        UploadIntoStream('', '', 'All Files (*.*)|*.*', FromFile, InStr);
    
        AzureBlobStorage.Initialize('mystorage', '<key1>');
        AzureBlobStorage.PutBlob('mycontainer', FromFile, InStr);
    end;
```

Supprimer un blob

``` AL
    var
        AzureBlobStorage: Codeunit "Azure Blob Storage UTCAP";
    begin
        AzureBlobStorage.Initialize('mystorage', '<key1>');
        AzureBlobStorage.DeleteBlob('mycontainer', 'myblobname.txt');
    end;
```

Methods

Initialize

Obsolete

This element will become obsolete from version V25.202505. Replaced by same procedure with AccessKey as SecretText.

[Obsolete(Replaced by same procedure with AccessKey as SecretText.,V25.202505)]
procedure Initialize(NewAccountName: Text, NewAccessKey: Text)

Parameters

Name Type Description
NewAccountName Text
NewAccessKey Text

Initialize

procedure Initialize(NewAccountName: Text, NewAccessKey: SecretText)

Parameters

Name Type Description
NewAccountName Text
NewAccessKey SecretText

GetContainers

procedure GetContainers(var Containers: List of [Text])

Parameters

Name Type Description
Containers List of [Text]

ListBlobs

[TryFunction]
procedure ListBlobs(ContainerName: Text, var Blobs: List of [Text]): Boolean

Parameters

Name Type Description
ContainerName Text
Blobs List of [Text]

Returns

Type Description
Boolean

GetBlob

[TryFunction]
procedure GetBlob(ContainerName: Text, BlobName: Text, var InputStream: InStream): Boolean

Parameters

Name Type Description
ContainerName Text
BlobName Text
InputStream InStream

Returns

Type Description
Boolean

DeleteBlob

[TryFunction]
procedure DeleteBlob(ContainerName: Text, BlobName: Text): Boolean

Parameters

Name Type Description
ContainerName Text
BlobName Text

Returns

Type Description
Boolean

PutBlob

[TryFunction]
procedure PutBlob(ContainerName: Text, BlobName: Text, DocumentStream: InStream): Boolean

Parameters

Name Type Description
ContainerName Text
BlobName Text
DocumentStream InStream

Returns

Type Description
Boolean

See also