At a glance
For: platform and DevOps engineers on Azure who want events explained before they reach them · Setup time: an alert rule, an app registration and five n8n nodes for the alert; a GitHub trigger, an AI node and an image API for the posts · Stack: self-hosted n8n, Azure Monitor activity log alerts, an Entra ID app registration, a chat model through OpenRouter, Telegram, GitHub, HCTI.io, LinkedIn
Last verified: 2026-09-25
When an Azure deployment fails, a Telegram message tells you who ran it, what failed, why, and which parameter to change. When you push a Bicep file to GitHub, a LinkedIn post with a caption and an image of the code goes live about 30 seconds later. Both are small n8n workflows I built on my own server, and they share one pattern: an event comes in, n8n fetches the context the event lacks, an AI step turns it into words, and the last node sends the result.

The problem: an event is half a message
A failed Azure deployment alert tells you that something broke. It doesn't tell you who deployed it, what failed or why. Finding that out means opening the portal, finding the deployment and reading the error. It takes about 20 minutes, and usually at a bad moment.
Sharing code has the same gap on a smaller scale. To post a Bicep snippet on LinkedIn, I took a screenshot (or made it look nice with a tool like Carbon), saved the image, opened LinkedIn, wrote a caption, uploaded the image and posted. It's not hard work. It's context switching.
The obvious fix for both is a fixed integration: an alert that emails you, or Zapier's "GitHub to LinkedIn". Neither adds what is missing. The alert payload carries no error details, and a fixed integration has no place for your own rendering step or a model with a detailed system prompt.
Both workflows share four steps
| Step | Failure alert | LinkedIn post |
|---|---|---|
| Trigger | an Azure Action Group calls an n8n webhook | a GitHub trigger fires on a push |
| Fetch context | the deployment from the Azure management API | the changed file from GitHub |
| AI step | summary, root cause and fixes | the post text and the lines worth showing |
| Send | a Telegram message | a LinkedIn post with the code as an image |
The pattern is the part to reuse. The last node is the easiest to swap: email or a Teams message instead of Telegram, a row in a database (Postgres, Airtable, Supabase) that a simple dashboard can read, or a document on a file share.
Self-hosted n8n keeps the data yours
I run n8n on my own server, deployed with Coolify, so the payloads, the prompts and the credentials stay on a machine I control. Both workflows need one thing from the setup: a public HTTPS address for n8n, because Azure and GitHub call it from the internet. The Azure app registration, the Telegram bot, the GitHub and LinkedIn accounts and the image API key are n8n credentials, never values typed into a node. What I use n8n for beyond these two is in n8n.
Steps: a failure alert in 5 steps
Workflow 1: Azure calls a webhook when a deployment fails, n8n fetches the deployment details, an AI model summarises them, and a Telegram message arrives with the cause and a fix. It has five nodes and solves one narrow problem.
1. Create an Action Group that calls n8n
Create an Action Group with one action: call a webhook. The URL is the one from the n8n Webhook node.

2. Alert on every failed deployment
Create an activity log alert rule on the subscription with the signal Create Deployment and the status Failed.

Under Actions, select the Action Group from step 1. The webhook now fires on every failed deployment.

3. Give n8n read access to deployments
n8n needs read access to the deployment details, because the webhook doesn't carry them.
App registration. Create a new app registration in Entra ID.

Client secret. Add a secret and store it in the n8n OAuth2 credential.

Role assignment. Give the service principal the Reader role on the subscription. Its */read permission covers deployments (Reader role).

4. Build five nodes in n8n

- Webhook. The endpoint the Action Group calls. It receives the alert payload.
- Edit Fields (Set). Picks the fields I need from the payload:
caller,deploymentIdandcorrelationId. - HTTP Request ("Get DeploymentDetails"). Calls the Azure management API (Deployments – Get) with the
deploymentId, authenticated with the service principal's OAuth2 credential. This returns the full error. - AI Agent. A system message and a user message tell the model what to produce: a summary, the root cause, and step-by-step fixes, in Markdown. Any chat model works; I use one through OpenRouter.
- Telegram. Sends the result to my chat.
5. Fail a deployment and read the message
To test it, deploy something that fails, such as a subnet whose address range overlaps an existing one. A failed subnet deployment ends up as this message. It names the overlapping address range and the parameter to change, so I rarely need to open the deployment in the portal.

Steps: a LinkedIn post in 4 steps
Workflow 2: I push a file to a GitHub repository, and n8n writes the caption, renders the code as an image and publishes both to LinkedIn. I built it as an experiment, to see whether GitHub, a language model, an image API and LinkedIn would fit into one flow. It was easy to build and fun to play with.

1. Trigger on a push and read the file
A GitHub trigger starts the workflow on every push to the repository that holds the snippets. A Code node lists the files the commit added or modified, so each kind can take its own path. GitHub File Download fetches each file, and Extract from File turns it into text for the model.
2. Let an AI Agent write the post
An AI Agent node, connected to a chat model through OpenRouter, writes the post. The system message gives it a role:
"You are a LinkedIn content strategist and copywriter specialising in professional, engaging technical content... Analyze the provided code file and create a LinkedIn post with a compelling narrative."
I also ask it to pick the 10 to 20 most interesting lines of code, so the image doesn't show the whole file. A structured output parser keeps the answer in fields the next nodes can read. The model reads what the code does (for example, "This Bicep module deploys a storage account") and writes an opening line about why it's useful.

3. Render the code as an image
I like code screenshots with the three coloured window dots in the corner, and I didn't want to make them by hand. A Code node assembles an HTML string with Prism.js for syntax highlighting and some CSS for the window frame:
// A snippet of the logic inside the Code Node
const html = `
<div class="code-container">
<div class="header">
<div class="dot dot-red"></div>
<div class="dot dot-yellow"></div>
<div class="dot dot-green"></div>
</div>
<pre><code class="language-${language}">${codeSnippet}</code></pre>
</div>
`;
LinkedIn needs an image, not HTML. An HTTP Request node sends the HTML string to HCTI.io, an HTML/CSS-to-image API (POST https://hcti.io/v1/image), with the font (Fira Code from Google Fonts). It answers with a URL to the rendered PNG.

4. Post the text and the image
The workflow downloads the PNG from that URL, uploads a copy to a GitHub repository for storage, and posts the text and the image to LinkedIn. About 30 seconds after the push, the post is on my profile: the model's text with hashtags, and a clean, high-resolution image of the code.
Pitfalls
- An alert processing rule sends nothing. The first version of this post said to use one. Alert processing rules only add or suppress action groups on alerts that have already fired. The alert itself is an activity log alert rule, as in step 2.
- The webhook payload has no error details. It names the caller and the deployment, not the error. Without the API call in step 4 and the read access from step 3, the model has nothing to explain.
- The model sometimes picks the wrong lines. In the LinkedIn workflow it occasionally chooses the wrong part of the code, or the image is cropped slightly off. As a proof of concept it works better than I expected, but I wouldn't use it for every post.
- The image API returns a URL. HCTI.io hands back a link to the PNG, so the workflow needs a second request to download the image before LinkedIn and GitHub can take it.
FAQ
Do I have to self-host n8n for this?
No. Both workflows only need an n8n instance that Azure and GitHub can reach over HTTPS, so n8n Cloud works too. I self-host so the payloads and credentials stay on my server.
Which AI model do the workflows use?
Any chat model n8n supports. I connect one through OpenRouter, so changing the model doesn't change the workflow.
Can the alert go to Teams or email instead of Telegram?
Yes. Replace the last node. The summary is Markdown, so it also fits a Teams message, an email, or a row in a database behind a dashboard.
Why not use Zapier's GitHub-to-LinkedIn integration?
A fixed integration wouldn't let me put my own HTML rendering step in the middle, run the code through a language model with a detailed system prompt, or treat modified and added files in a commit differently. n8n connects anything with an API.
Does n8n need more than read access in Azure?
No. The Reader role on the subscription covers reading deployments, and the workflow never changes anything in Azure.
History
- 24 Oct 2026 Became use case 4: merged with "Post Bicep snippets to LinkedIn with one git push", which now redirects here. New title, top box, hero diagram, steps, pitfalls and FAQ. IDs in the Azure screenshots blurred.
- 25 Sep 2026 The alert is an activity log alert rule, not an alert processing rule as I wrote first; links to the docs added.
- 24 Dec 2025 The LinkedIn workflow, first published as its own post.
- 29 Nov 2025 First version.
Explain Azure deployment failures and post code to LinkedIn (n8n)
A failed Azure deployment reaches Telegram with its cause and fix; a code file pushed to GitHub becomes a LinkedIn post about 30 seconds later. Two self-hosted n8n workflows, one pattern: an event, the context it lacks, an AI step, a message.
A GitHub repo where a coding agent opens pull requests and can't merge without you, plus a one-page sign-off sheet for whoever approves it.
Get the starter kit