Azure Storage Account Plugin

The plugin provides functionality to interact with Azure Storage Account.

Installation

Example 1. build.gradle
implementation(group: 'org.vividus', name: 'vividus-plugin-azure-storage-account', version: '0.3.6-SNAPSHOT')

Configuration

Authentication

The authentication process relies on the configuration of the environment variables.

See the official "Azure identity" guide to get more details on what types of authentication could be used.

Properties

The storage accounts endpoints are configured with the following property format:

azure.storage-account.<key>=<endpoint>

where:

  1. key - The logical key used to refer storage account in the steps.

  2. endpoint - The storage account endpoint, e.g. https://storageaccount.blob.core.windows.net/

Steps

Download the blob

Downloads the entire blob from the container and saves its content as a text to a variable.

When I download blob with name `$blobName` from container `$containerName` of storage account `$storageAccountKey` and save its content to $scopes variable `$variableName`
  • $blobName - The full path to a blob in the container.

  • $containerName - The name of the container to point to.

  • $storageAccountKey - The key of storage account from the configuration.

  • $scopes - The comma-separated set of the variables scopes.

  • $variableName - The variable name to store the blob content.

Example 2. Download the blob
When I download blob with name `raw/test.json` from container `vividus` of storage account `testaccount` and save its content to scenario variable `blob`

Download the blob to a temporary file

Downloads the entire blob from the container into a temporary file with the specified name and saves the full path to the specified variable.

When I download blob with name `$blobName` from container `$containerName` of storage account `$storageAccountKey` to temporary file with name `$baseFileName` and save path to $scopes variable `$variableName`
  • $blobName - The full path to a blob in the container.

  • $containerName - The name of the container to point to.

  • $storageAccountKey - The key of storage account from the configuration.

  • $baseFileName - The base file name used to generate the prefix and the suffix for the creating temporary file.

  • $scopes - The comma-separated set of the variables scopes.

  • $variableName - The variable name to store the path to the temporary file with the blob content.

Example 3. Download the blob to a temporary file
When I download blob with name `raw/test.json` from container `vividus` of storage account `testaccount` to temporary file with name `test.json` and save path to scenario variable `$pathToBlob`

Upload the blob

Uploads the blob to the container.

When I upload blob with name `$blobName` and data `$data` to container `$containerName` of storage account `$storageAccountKey`
  • $blobName - The full path to a blob in the container.

  • $data - The data to store as blob.

  • $containerName - The name of the container to point to.

  • $storageAccountKey - The key of storage account from the configuration.

Example 4. Upload the blob
When I upload blob with name `raw/test.json` and `{"key":"value"}` to container `vividus` of storage account `testaccount`

Delete the blob

Deletes the specified blob from the container.

When I delete blob with name `$blobName` from container `$containerName` of storage account `$storageAccountKey`
  • $blobName - The full path to a blob in the container.

  • $containerName - The name of the container to point to.

  • $storageAccountKey - The key of storage account from the configuration.

Example 5. Delete the blob
When I delete blob with name `raw/test.json` from container `vividus` of storage account `testaccount`

Find blobs

Finds the blobs with names matching the specified comparison rule.

When I find all blobs with name which $comparisonRule `$blobNameToMatch` in container `$containerName` of storage account `$storageAccountKey` and save result to $scopes variable `$variableName`
Example 6. Find blobs
When I find all blobs with name which contains `json` in container `vividus` of storage account `testaccount` and save result to scenario variable `blobsCollection`