question

AmermanRichard-0754 avatar image
0 Votes"
AmermanRichard-0754 asked AmermanRichard-0754 commented

Azure Logic App Get Blob Metadata issues

In an Azure Logic App I'm finding files older than a given date in a file storage account and copying them over to a different block blob storage account.

The copy is working fine.

This is my action chain for that:
File: Get file content > Blob: Create block blob (V2)

At this point I'm trying to take the output of the create action and use Blob: Get Blob Metadata (V2) to verify that the file is indeed actually there.

When I am putting something in the Blob field of the Get Blob Metadata action the only options that come up in the list are from the files steps, no usable output from the Create block blob step.


It is my rough understanding that the next action will not even execute if the previous action fails, but this is too important not to do a hard verification. My next step will be deleting the original file so I need to get this right!

Considering that my whole intent is to hard verify that the Blob: Create block blob (V2) step created the file, what are my options?

128842-image.png


azure-logic-apps
image.png (64.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered AmermanRichard-0754 commented

@AmermanRichard-0754 Please confirm if my understanding is correct.
Trigger --> Get all file in container (List blob (V2)) --> Check for all files if it is older than your created date --> if True then Create the file to another storage contanior --> Once the above action is sucessful delete the file from old storage account containor.

The List blob (V2) and Get Blob Metadata (V2) returns the same returns the same BlobMetadata (list blob action having the list of blobmetadata whereas Get Blob Metadata returns only one blob blobmetadata). BlobMetadata doesnot return the CreatedDate of the blob but has the LastModified property. In case if you want CreatedData then unfortunately it is not supported and you cannot use it in your worflow.

But in case if you want to proceeds with the LastModified property then you use condition to to check with your input value. If it is true then only proceeds with the Create Blob and the next action will be Delete Blob (v2) to the delete the file. Condition are used in logic app so in case if your action could fail in certain conition/senario. There is no way to execute the next action if any of your existing action/trigger fails.

If you want to leverage CreatedDate then you need to use Azure Storage REST API with the HTTP action to get this data as unfortuenatley the storage connector doesnot return this field.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The key point you are missing is that the source is not a blob container.

It is an Azure file share.

The cool thing is that I have everything working through and including creating the file in the block blob account (just don't have it creating it directly in the archive tier yet)

My issue is all about how to verify that the file was created and I think the issue I'm running into is that the act of creating the file in the blob account with just the file name and the file contents means I might need to know the ID or full name (path/filename) for the newly created file to then pull up its metadata or any other verification task.

I'm meeting with an MS Solutions Architect in a couple hours to look at this though so if that bears fruit I'll post an update here!

0 Votes 0 ·

I just added an image of the logic app. The condition there is just for test (blocked out) but I have the right condition for doing the date comparison.

Sometimes a visual reference helps.

0 Votes 0 ·

Still drinking my first cup of coffee! :-)
Should have opened my first comment up with a sincere think you for chiming in!

Thanks!

0 Votes 0 ·