Skip to content

Storage Account Read Blob Content action

MarkAbrams edited this page Feb 5, 2024 · 1 revision

This is an example of JSON request and response message content for a mocked Storage Account Read Blob Content action.

Request

The name of the blob container is located in the containerName field and the name of the blob is located in the blobName field.

{
  "containerName": "customers",
  "blobName": "JohnSmith.json"
}

Successful Response (JSON content)

This response can be used when the read was successful for a blob containing JSON:

{
    "content": {
        "id": 54624,
        "title": "Mr",
        "firstName": "Peter",
        "lastName": "Smith",
        "dateOfBirth": "1970-04-25",
        "address": {
            "addressLine1": "Blossoms Grove",
            "addressLine2": "High Street",
            "addressLine3": "",
            "town": "Smithville",
            "county": "Bedfordshire",
            "postcode": "LT12 6XX",
            "countryCode": "UK",
            "countryName": "United Kingdom"
        }
    },
    "properties": {
        "appendBlobCommittedBlockCount": 0,
        "blobTierInferred": true,
        "blobTierLastModifiedTime": "2023-01-27T12:57:54+00:00",
        "blobType": "Block",
        "contentMD5": "KK9TUH0a3v6L66XWMdfQVg==",
        "contentType": "application/json",
        "created": "2023-01-27T12:57:54+00:00",
        "creationTime": "2023-01-27T12:57:54+00:00",
        "eTag": "\"0x8DB00661B6E6181\"",
        "isIncrementalCopy": false,
        "isServerEncrypted": true,
        "lastModified": "2023-01-27T12:57:54+00:00",
        "leaseDuration": "Infinite",
        "leaseState": "Available",
        "leaseStatus": "Unlocked",
        "length": 442,
        "pageBlobSequenceNumber": 0,
        "premiumPageBlobTier": "Hot",
        "standardBlobTier": "Hot"
    },
    "metadata": {}
}

The test case should respond with a HTTP 200 (OK) status code. The JSON content and properties of the blob are included in the response.

Successful Response (Plain text content)

This response can be used when the read was successful for a blob containing plain text:

{
    "content":"This is some plain text",
    "properties": {
        "appendBlobCommittedBlockCount": 0,
        "blobTierInferred": true,
        "blobTierLastModifiedTime": "2023-06-07T10:14:16+00:00",
        "blobType": "Block",
        "contentMD5": "uAHR5E5EfKaO0FDlo5XQWw==",
        "contentType": "text/plain",
        "created": "2023-06-07T10:14:16+00:00",
        "creationTime": "2023-06-07T10:14:16+00:00",
        "eTag": "\"0x8DB673FF363450B\"",
        "isIncrementalCopy": false,
        "isServerEncrypted": true,
        "lastModified": "2023-06-07T10:14:16+00:00",
        "leaseDuration": "Infinite",
        "leaseState": "Available",
        "leaseStatus": "Unlocked",
        "length": 449,
        "pageBlobSequenceNumber": 0,
        "premiumPageBlobTier": "Hot",
        "standardBlobTier": "Hot"
    },
    "metadata": {}
}

The test case should respond with a HTTP 200 (OK) status code. The plain text content and properties of the blob are included in the response.

Successful Response (Binary content)

This response can be used when the read was successful for a blob containing binary data:

{
    "content": {
        "$content-type": "application/pdf",
        "$content": "JVBERi0xLjcKCjQgMCBvYmoKPDwKL0JpdgpzdGFydHhyZWYKMTU0MDI4CiUlRU9GCg=="
    },
    "properties": {
        "appendBlobCommittedBlockCount": 0,
        "blobTierInferred": true,
        "blobTierLastModifiedTime": "2023-06-07T10:08:54+00:00",
        "blobType": "Block",
        "contentMD5": "GhK8gP6AYsUUs3n3Nldhjw==",
        "contentType": "application/pdf",
        "created": "2023-06-07T10:08:54+00:00",
        "creationTime": "2023-06-07T10:08:54+00:00",
        "eTag": "\"0x8DB673F3397041F\"",
        "isIncrementalCopy": false,
        "isServerEncrypted": true,
        "lastModified": "2023-06-07T10:08:54+00:00",
        "leaseDuration": "Infinite",
        "leaseState": "Available",
        "leaseStatus": "Unlocked",
        "length": 1309,
        "pageBlobSequenceNumber": 0,
        "premiumPageBlobTier": "Hot",
        "standardBlobTier": "Hot"
    },
    "metadata": {}
}

The test case should respond with a HTTP 200 (OK) status code. The binary content and properties of the blob are included in the response.

Failed Response

This response can be used when the read failed because a blob does not exist in the container:

{
    "code": "ServiceProviderActionFailed",
    "message": "The service provider action failed with error code 'ServiceOperationResourceNotFound' and error message 'The specified blob named 'JohnJones.json' in container 'customers' doesn't exist.'."
}

The test case should respond with a HTTP 404 (Not Found) status code.

Clone this wiki locally