pulumi-azure-native icon indicating copy to clipboard operation
pulumi-azure-native copied to clipboard

Creating Blob with a StringAsset throws Unmarshaling Exception

Open jpmckearin opened this issue 3 years ago • 6 comments

When trying to create a storage blob using a StringAsset and passing in XML, an error is thrown. I was able to get around this for now by using a FileAsset instead.

Expected behavior

I expected the Blob to be created with the string passed into StringAsset to be in the contents of the blob.

Current behavior

The error is thrown: Error: Invalid asset encountered when unmarshaling resource property

Steps to reproduce

Live Preview: https://app.pulumi.com/ContessaHealth/unicode/dev/previews/3acd6512-2146-4071-879c-c941b18f66cc

  1. Create a BlobContainer resource
  2. Attempt to create a Blob resource using a new StringAsset('<?xml version="1.0" encoding="utf-8"?><repository></repository>') as the source

Context (Environment)

const dataProtectionBlob = new Blob(
  'dataProtectionBlob',
  {
    blobName: 'data-protection-key.xml',
    accountName: currentStorageAccount.name,
    containerName: dataProtectionContainer.name,
    type: 'Block',
    contentType: 'application/xml',
    source: new StringAsset('<?xml version="1.0" encoding="utf-8"?><repository></repository>'),
    resourceGroupName
  },
  { ignoreChanges: ['source'] }
)

jpmckearin avatar Mar 08 '21 14:03 jpmckearin