{
  "id": "IGIdimfXbsBQsxOh",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Beginner\u2019s Tutorial: Manage Azure Storage Account Container & Blob with n8n",
  "tags": [
    {
      "id": "H6NyYd16Iwa0j4cx",
      "name": "azure",
      "createdAt": "2025-08-20T13:18:12.992Z",
      "updatedAt": "2025-08-20T13:18:12.992Z"
    }
  ],
  "nodes": [
    {
      "id": "e85e1121-c0c5-4205-bde6-f1a9de3f0bd7",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        448,
        280
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b9c2618f-3f0e-487a-b8d7-2664b502e069",
      "name": "Generate an image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        752,
        56
      ],
      "parameters": {
        "prompt": "={{ $json.output }}",
        "options": {},
        "resource": "image"
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "fd4d4869-27e2-4848-a78e-441f8cdcf11e",
      "name": "Prompt Generation Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        352,
        56
      ],
      "parameters": {
        "text": "=You're prompt generator agent, you will create prompt for the open-ai image generation model with a random topic among:\n- Education\n- Science \n- Sport\n- Economy\n- Health\nOutput the prompt only, nothing else",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "2ce43600-134f-410d-b960-f43ab32f1571",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -320,
        -92
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ca6f581a-0c4c-4259-8c90-95a23c815633",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -96,
        -92
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "af3e6c69-fbfe-49f4-9c29-3a68a821c5a6",
              "name": "container_name",
              "type": "string",
              "value": "trungtrandemon8n1"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c28e2f34-43d2-41cd-890f-43d028f2f32f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        -736
      ],
      "parameters": {
        "width": 1056,
        "height": 2512,
        "content": "# Beginner\u2019s Tutorial: Manage Azure Storage Account Container & Blob with n8n\n[![Watch the video](https://wisestackai.s3.ap-southeast-1.amazonaws.com/Modern+Top+10+Shocking+Moments+Youtube+Thumbnail.jpg)](https://www.youtube.com/watch?v=vh06fpMkalw)\n> This beginner-friendly n8n workflow shows you how to generate AI images using OpenAI, store them in Azure Blob Storage, and manage blob containers, all with zero code.\n\n## \ud83d\udc64 Who\u2019s it for\n\nThis workflow is perfect for:\n- **Beginners learning Azure + OpenAI integration**\n- **No-code developers** experimenting with image generation\n- **Cloud learners** who want hands-on Blob Storage use cases\n- Anyone who wants to automate storing AI-generated content in the cloud\n\n## \u2699\ufe0f How it works / What it does\n\n1. \ud83d\uddb1\ufe0f Trigger the workflow manually using the `Execute Workflow` node.\n2. \u270f\ufe0f Use the `Edit Fields` node to input:\n   - `containerName` (e.g., `demo-images`)\n   - `imageIdea` (e.g., \"a robot holding a coffee cup\")\n3. \ud83d\udce6 Create a new Azure Blob container (`Create container`).\n4. \ud83e\udd16 Use an OpenAI-powered **Prompt Generation Agent** to craft the perfect image prompt.\n5. \ud83c\udfa8 Generate an image using OpenAI\u2019s DALL\u00b7E model.\n6. \u2601\ufe0f Upload the generated image to Azure Blob Storage (`Create Blob`).\n7. \ud83d\udcc2 List blobs in the container (`Get many blobs`).\n8. \ud83e\uddf9 Delete any blob as needed (`Delete Blob`).\n9. (Optional) \ud83d\uddd1\ufe0f Remove the entire container (`Delete container`).\n\n## \ud83d\udd27 How to set up\n\n1. **\ud83e\udde0 Set up OpenAI**\n   - Create an OpenAI account and get your API key.\n   - In n8n, go to **Credentials \u2192 OpenAI** and paste your key.\n\n2. **\ud83e\udea3 Set up Azure Blob Storage**\n   - Log in to your Azure Portal.\n   - Create a **Storage Account** (e.g., `mystorageaccount`).\n   - Go to **Access Keys** tab and copy:\n     - **Storage Account Name**\n     - **Key1**\n   - In n8n, create a new **Azure Blob Storage Credential** using:\n     - **Account Name** = your storage account name\n     - **Access Key** = key1 value\n\n   > \ud83d\udcdd This demo uses **Access Key** authentication. You can also configure Shared Access Signatures (SAS) or OAuth in production setups.\n\n3. **Run the Workflow**\n   - Enter your image idea and container name.\n   - Click \u201cExecute Workflow\u201d to test it.\n\n## \ud83d\udccb Requirements\n\n| Requirement            | Description                                      |\n|------------------------|--------------------------------------------------|\n| Azure Storage Account  | With container-level read/write access          |\n| OpenAI API Key         | For image and prompt generation                 |\n| n8n Version            | v1.0+ recommended                               |\n| Image Credits          | OpenAI charges tokens for DALL\u00b7E image creation |\n\n\n## \ud83d\udee0\ufe0f How to customize the workflow\n\n### \ud83e\udde0 Adjust Prompt Generation\nUpdate the **Prompt Agent** to include:\n- Specific style (3D, anime, cyberpunk)\n- Brand elements\n- Multiple language options\n\n### \ud83d\udcc1 Organize by Date/User\nModify the `containerName` to auto-include:\n- Date (e.g., `images-2025-08-20`)\n- Username or session ID\n\n### \ud83d\udce4 Send Image Output\n- Add Slack, Telegram, or Email nodes to deliver the image\n- Create public links using Azure\u2019s blob permissions\n\n### \ud83d\udd01 Cleanup Logic\n- Auto-delete blobs after X days\n- Add versioning or backup logic"
      },
      "typeVersion": 1
    },
    {
      "id": "8247314b-fa19-4b6e-96d5-f2729451236e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        -304
      ],
      "parameters": {
        "width": 352,
        "content": "### 1. \ud83d\uddb1\ufe0f Trigger the Workflow\n**Node:** `When clicking 'Execute workflow'`  \nThis node allows you to manually start the workflow by clicking the \u201cExecute Workflow\u201d button in n8n. Great for testing or interactive usage."
      },
      "typeVersion": 1
    },
    {
      "id": "09234a75-00ef-4d24-b832-4cbf77a70191",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        80
      ],
      "parameters": {
        "height": 256,
        "content": "### 2. \u270d\ufe0f Input Your Fields\n**Node:** `Edit Fields`  \nThis is where you define inputs like:\n- `containerName`: Name of the Azure Blob container\n\nThe input used in the following steps to dynamically name resources and build prompts."
      },
      "typeVersion": 1
    },
    {
      "id": "51421218-ac6a-4254-9460-57fd393cfaeb",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        224
      ],
      "parameters": {
        "height": 192,
        "content": "### 3. \ud83d\udce6 Create Blob Container\n**Node:** `Create container`  \nCreates a new container in your Azure Blob Storage account using the container name you provided. If the container already exists, it will not be duplicated."
      },
      "typeVersion": 1
    },
    {
      "id": "3275fa4c-e3c8-4cb7-9fbe-5fbc18bc43bc",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        224
      ],
      "parameters": {
        "width": 288,
        "height": 144,
        "content": "### 5. \ud83c\udfa8 Generate the Image\n**Node:** `Generate an image`  \nUses the prompt from the previous step to create an AI-generated image (e.g., via DALL\u00b7E). The result is a direct image file output."
      },
      "typeVersion": 1
    },
    {
      "id": "72ad0a7b-b85d-4a78-8e19-b00ea74f055a",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -96
      ],
      "parameters": {
        "width": 432,
        "height": 128,
        "content": "### 4. \ud83e\udd16 Generate AI Prompt\n**Node:** `Prompt Generation Agent`  \nUses OpenAI\u2019s Chat Model to generate a detailed and creative image prompt based on your `imageIdea`. This helps get better and more accurate AI images.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "08afa880-39cc-4aa9-a4c6-60cc4988c86c",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        -144
      ],
      "parameters": {
        "height": 176,
        "content": "### 6. \u2601\ufe0f Upload Image to Azure Blob\n**Node:** `Create Blob`  \nUploads the generated image to the Azure Blob container you created. The image is now stored in the cloud and ready to use or share.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "6f22fd69-6469-4ced-b5b9-adfdc7f4cab0",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        -432
      ],
      "parameters": {
        "width": 272,
        "content": "### 9. \ud83d\uddd1\ufe0f (Optional) Delete the Container\n**Node:** `Delete container`  \nIf needed, you can delete the entire container to clean up your storage environment. Be careful\u2014this deletes all blobs inside."
      },
      "typeVersion": 1
    },
    {
      "id": "00315b96-ca0b-4c64-b796-54e0eb0f5acb",
      "name": "Create container",
      "type": "n8n-nodes-base.azureStorage",
      "position": [
        128,
        56
      ],
      "parameters": {
        "options": {},
        "operation": "create",
        "requestOptions": {},
        "containerCreate": "={{ $json.container_name }}"
      },
      "credentials": {
        "azureStorageSharedKeyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2cc5dc43-64e0-406a-98b0-2854143d2cc9",
      "name": "Get many container",
      "type": "n8n-nodes-base.azureStorage",
      "position": [
        128,
        -240
      ],
      "parameters": {
        "options": {},
        "requestOptions": {}
      },
      "credentials": {
        "azureStorageSharedKeyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0cce44bd-54ad-4444-a351-b395af7e7875",
      "name": "Delete container",
      "type": "n8n-nodes-base.azureStorage",
      "position": [
        440,
        -240
      ],
      "parameters": {
        "container": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.name }}"
        },
        "operation": "delete",
        "requestOptions": {}
      },
      "credentials": {
        "azureStorageSharedKeyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e7fbd4a2-9988-4f2e-8985-4c0691b9ce27",
      "name": "Delete Blob",
      "type": "n8n-nodes-base.azureStorage",
      "position": [
        1424,
        56
      ],
      "parameters": {
        "blob": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.name }}"
        },
        "options": {},
        "resource": "blob",
        "container": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Edit Fields').item.json.container_name }}"
        },
        "operation": "delete",
        "requestOptions": {}
      },
      "credentials": {
        "azureStorageSharedKeyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0b9b0d80-3932-4592-869f-1b88d275c061",
      "name": "Create Blob",
      "type": "n8n-nodes-base.azureStorage",
      "position": [
        976,
        56
      ],
      "parameters": {
        "options": {},
        "resource": "blob",
        "container": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Edit Fields').item.json.container_name }}"
        },
        "operation": "create",
        "blobCreate": "mydemoblob",
        "requestOptions": {}
      },
      "credentials": {
        "azureStorageSharedKeyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9080e615-b339-40e9-a2be-afec373f19e8",
      "name": "Get many blobs",
      "type": "n8n-nodes-base.azureStorage",
      "position": [
        1200,
        56
      ],
      "parameters": {
        "options": {},
        "resource": "blob",
        "container": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Edit Fields').item.json.container_name }}"
        },
        "requestOptions": {}
      },
      "credentials": {
        "azureStorageSharedKeyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "766a2aad-6a08-4fb2-a24d-f897bdcba105",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        224
      ],
      "parameters": {
        "width": 208,
        "content": "### 7. \ud83d\udcc2 List All Blobs\n**Node:** `Get many blobs`  \nRetrieves all the blobs (files) inside your container so you can review, download, or manage them."
      },
      "typeVersion": 1
    },
    {
      "id": "d649dd7f-11c5-4191-ae9b-fdae6581c48a",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        -128
      ],
      "parameters": {
        "content": "### 8. \ud83e\uddf9 Delete Specific Blob\n**Node:** `Delete Blob`  \nDeletes a specific blob (image) from your container. This step can be made dynamic based on blob name or user choice."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6883fbaa-7aae-4627-8ac4-b77da1494f46",
  "connections": {
    "Create Blob": {
      "main": [
        [
          {
            "node": "Get many blobs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Create container",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get many container",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many blobs": {
      "main": [
        [
          {
            "node": "Delete Blob",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create container": {
      "main": [
        [
          {
            "node": "Prompt Generation Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate an image": {
      "main": [
        [
          {
            "node": "Create Blob",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Prompt Generation Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get many container": {
      "main": [
        [
          {
            "node": "Delete container",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prompt Generation Agent": {
      "main": [
        [
          {
            "node": "Generate an image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}