Skip to content

Storage Account Upload Blob 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 Upload Blob 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. The content of the blob is located in the content field.

{
  "containerName": "thisIsMyContainer",
  "blobName": "thisIsMyBlob",
  "content": {
    "customerType": "individual",
    "title": "Mr",
    "name": "Peter Smith",
    "addresses": [
      {
        "addressType": "physical",
        "addressLine1": "8 High Street",
        "addressLine2": null,
        "addressLine3": null,
        "town": "Luton",
        "county": "Bedfordshire",
        "postalCode": "LT12 6TY"
      }
    ]
  }
}

Successful Response

This response can be used when the upload was successful:

{
  "properties": {
    "appendBlobCommittedBlockCount": 0,
    "blobTierInferred": true,
    "blobTierLastModifiedTime": "2023-06-02T15:46:18+00:00",
    "blobType": "Block",
    "contentMD5": "dVrygBeGvgzwZOzwr+HH3A==",
    "contentType": "text/plain; charset=utf-8",
    "created": "2023-06-02T15:46:18+00:00",
    "creationTime": "2023-06-02T15:46:18+00:00",
    "eTag": "\"0x8DB63808180D351\"",
    "isIncrementalCopy": false,
    "isServerEncrypted": true,
    "lastModified": "2023-06-02T15:46:18+00:00",
    "leaseDuration": "Infinite",
    "leaseState": "Available",
    "leaseStatus": "Unlocked",
    "length": 23,
    "pageBlobSequenceNumber": 0,
    "premiumPageBlobTier": "Hot",
    "standardBlobTier": "Hot"
  },
  "metadata": {}
}

The test case should respond with a HTTP 200 (OK) status code.

Failed Response

This response can be used when the upload failed because a blob with the same name already exists in the container:

{
  "code": "ServiceProviderActionFailed",
  "message": "The service provider action failed with error code 'BadRequest' and error message 'The specified blob named 'thisIsMyBlob' in container 'thisIsMyContainer' already exists.'."
}

The test case should respond with a HTTP 400 (Bad Request) status code.

This response can be used when the blob content is missing in the request:

{
  "code": "ServiceProviderActionFailed",
  "message": "The service provider action failed with error code 'ServiceOperationRequiredParameterMissing' and error message 'The required parameter 'content' for the service provider '/serviceProviders/AzureBlob' operation 'uploadBlob' is missing.'."
}

The test case should respond with a HTTP 400 (Bad Request) status code.

Clone this wiki locally