Home > front end >  How to get the folder ID from an Azure data storage container?
How to get the folder ID from an Azure data storage container?

Time:10-21

I created a folder called test in a data storage container as shown in the image below:

enter image description here

This folder is used by a logic app that I created and I noticed in the code that it needs the folder id to work properly (see the code below):

"resources":
  [
    {
      "type": "Microsoft.Logic/workflows",
      "apiVersion": "2017-07-01",
      "name": "[parameters('workflows_App_name')]",
      "location": "westus2",
      "properties":
        {
          "state": "Enabled",
          "definition":
            {
              "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
              "contentVersion": "1.0.0.0",
              "parameters":
                { "$connections": { "defaultValue": {}, "type": "Object" } },
              "triggers":
                {
                  "When_a_blob_is_added_or_modified_(properties_only)_(V2)":
                    {
                      "recurrence": { "frequency": "Second", "interval": 10 },
                      "evaluatedRecurrence":
                        { "frequency": "Second", "interval": 10 },
                      "splitOn": "@triggerBody()",
                      "type": "ApiConnection",
                      "inputs":
                        {
                          "queries":
                            {
                              "checkBothCreatedAndModifiedDateTime": false,
                              "folderId": "JTJmb3B0aWDFWRUITTW5zZm9ybWVkLWRhdGEtZnMlMmZ0ZXN0JTJmdGVzd15GHTY9sb2dpYyUyZg=",
                              "maxFileCount": 10
                            }
                        }
                    }
                },
           ....
        ]

"folderId": "JTJmb3B0aWDFWRUITTW5zZm9ybWVkLWRhdGEtZnMlMmZ0ZXN0JTJmdGVzd15GHTY9sb2dpYyUyZg=",

This code was generated thanks to the Logic App UI but I will deploy this template parameterized in production and I won't be able to create the logic app through the UI. I need to find the folder id of the new folder that I will create in my production container. folder id is the last value that I need to deploy this template to production.

Where can I find this folder ID value? I tried to look into the storage explorer with no success, though.

CodePudding user response:

You can retrieve Id by using the get blob metadata using path connector to get blob metadata. That's the folder path in base64 encoded value.

Below Screenshot can help you in getting the right information enter image description here

Another solution is to decode that ID manually and this will generate the location of your folder, something like this:

enter image description here

Thanks for the solution @GauravMantri and @SwethaKandikonda-MT.

Another alternative is to add a compose connector and decode the id. decodeBase64(body('Get_Blob_Metadata_using_path_(V2)')?['Id'])

enter image description here

  • Related