12
Views
1
Comments
[Azure Blob Storage] Rename Blob
azure-blob-storage
Web icon
Forge asset by Barduino
Application Type
Traditional Web

How to do that?

2024-09-17 12-24-07
Rammurthy Naidu Boddu
Champion

Hi @Filipe Lourenço

  1. Install the Azure Blob Storage Connector:

    • If you haven’t done so already, install the Azure Blob Storage component from the OutSystems Forge.
  2. Copy the Blob to a New Name:

    • Use the Copy Blob action to create a new blob with the new name. This action will copy the original blob to the destination (with the new name).
  3. Delete the Original Blob:

    • After copying, delete the original blob using the Delete Blob action from the Azure Blob Storage connector.

Step-by-Step Example

Let’s say you have a blob named oldFileName.txt and you want to rename it to newFileName.txt.

1. Set Up the Azure Blob Storage Configuration

  • Define the required parameters for your Azure Blob Storage (like Account Name, Account Key, and Container Name) in the module using the Azure Blob Storage connector.

2. Copy the Blob to a New Name

outsystemsCopy code// Use the AzureBlobStorage_CopyBlob actionAzureBlobStorage_CopyBlob(    SourceBlobPath: "oldFileName.txt",     // Original blob path    DestinationBlobPath: "newFileName.txt" // New blob path)

  • SourceBlobPath: This is the path (or name) of the original blob (e.g., oldFileName.txt).
  • DestinationBlobPath: This is the new name or path where the blob should be copied (e.g., newFileName.txt).

3. Delete the Original Blob

outsystemsCopy code// Use the AzureBlobStorage_DeleteBlob actionAzureBlobStorage_DeleteBlob(    BlobPath: "oldFileName.txt" // Original blob path to delete)

  • BlobPath: Specify the path or name of the original blob (oldFileName.txt) that you want to delete after copying.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.