isPowerAutomateURL returns true if the webhook URL is a Power Automate Workflow URL (*.powerplatform.com or legacy *.logic.azure.com) rather than a legacy Office 365 Connector URL.
(webhookURL string)
| 106 | // isPowerAutomateURL returns true if the webhook URL is a Power Automate Workflow URL |
| 107 | // (*.powerplatform.com or legacy *.logic.azure.com) rather than a legacy Office 365 Connector URL. |
| 108 | func isPowerAutomateURL(webhookURL string) bool { |
| 109 | u, err := url.Parse(webhookURL) |
| 110 | if err != nil { |
| 111 | return false |
| 112 | } |
| 113 | hostname := strings.ToLower(u.Hostname()) |
| 114 | return strings.HasSuffix(hostname, ".powerplatform.com") || strings.HasSuffix(hostname, ".logic.azure.com") |
| 115 | } |
| 116 | |
| 117 | // postPowerAutomateMessage sends a webhook message to a Power Automate Workflow URL |
| 118 | // using the Adaptive Card format wrapped in a message envelope. |