PEPEGA
PEPEGA

Reputation: 2283

Metadata storage path encoded 2 times from azure blob storage

I had a react project that managed files from azure blob storage also using azure search. Before I got the metadata_storage_path property encoded as base64 and I could read it by decoding it with atob(metadata_storage_path.slice(0, -1)). Now I deleted the Azure search to add some new stuff to it. But now I get the metadata_storage_path encoded 2 time.

I get a string that looks like a regular base64 string ex:

Qhhweufineiurfheurnfuierhfn... and so on

And when I decode it I get a string with spaces between every letter

A K T I G H A L J S H S... and so on

If I remove all spaces and decode the output I get a valid path to my file. Is there some weird setting that I have enabled by accident?

I had the same problem before but I recreated the Azure search function several times and it just started to work then.

Upvotes: 1

Views: 758

Answers (2)

Peter S.
Peter S.

Reputation: 106

No, this probably not your fault but rather a defect on our side resulting from the UI. You can use 547271 as tracking item number if talking to someone in the Azure Search team. To fix this, you'll need to:

  • Use a tool such as POSTMAN to edit your Indexer (remove the legacy encoding property)
  • Delete and recreate your Index

Upvotes: 2

8163264128
8163264128

Reputation: 787

It sounds like you have both base64Encode field mapping function and the legacy indexer parameter base64EncodeKeys. Updating your indexer with the indexer parameter base64EncodeKeys set to false should get rid of the extra layer of encoding.

The legacy encoding parameter uses UTF16 encoding, which gives you an extra NUL byte between ASCII characters.

Upvotes: 1

Related Questions