0

I'm working in Azure Logic Apps and I'm trying to dynamically update a blob in Azure Blob Storage using Azure Logic Apps workflow action named 'Update Blob (V2)'. My goal is to write an integer value to a blob in a container. The blob name is based on a customer name retrieved during a For each loop. I am using 'Customer one' as an example name. When I use a customer name with just one word (e.g., Corp.json), it's works perfectly fine. But as soon as I want to dynamically fill in a customer name with spaces, it gives error.

When I hardcode the blob name (e.g., Customer one.json), it works fine and updates the blob correctly. However, when I fill in the blob name dynamically like this:

encodeUriComponent(concat(trim(string(items('For_each')?['customerName'])), '.json'))

I consistently get the following error:

"body": {
    "status": 404,
    "message": "Specified blob Customer one.json does not exist.\r\nclientRequestId: 11111111-1111-1111-1111-11111111111",
    "error": {
        "message": "Specified blob Customer one.json does not exist."
    },
    "source": "azureblob-we.azconn-we-223.p.azurewebsites.net"
}

What I've already tried:

  • Wrapping the customer name with string() and trim() to prevent datatype or whitespace issues
  • Using encodeUriComponent() to handle spaces
  • Confirmed that the blob exists and can be updated. I did update the blob using hardcoded changes
  • Verified that the blob is in the correct container and directory
  • Used the Compose action to print the final blob name (= identical)

Additional Info:

  • The blob names do include spaces, like "Van Der Dadels.json".
  • The blob is confirmed to exist and be accessible.
  • Logic Apps is using the "Update blob" action.
  • Container access level is private, but credentials and connection are configured correctly.

This is where the error occurs: enter image description here

But hard coding the name works: enter image description here

3
  • If you select the blob with the space in the name via the file selector, check the code view to see what that looks like, is it as you would enter it via the item() expression? Commented Aug 5 at 20:53
  • @Skin Thank you for your message. This is what I see in the code view, I'm not sure if this is what you mean. In the last run, I clicked on the Blob workflow action -> Code View -> "path": "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('https://temp.blob.core.windows.net/'))}/files/@{encodeURIComponent(encodeURIComponent('/name-of-container-I-am-using/',concat(trim(string(items('For_each')?['customerName'])), '.json')))} Let me know if this is not the right info please ;) Commented Aug 6 at 7:36
  • To debug the issue, you can try creating a blob this way instead of updating it - then you can check if a new blob was created in the storage. It might clarify what's going on. Commented Aug 6 at 9:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.