Skip to main content

Notifications

Power Automate - Connector Development
Unanswered

Not able to send ci/cd alert to microsoft teams with github actions

(0) ShareShare
ReportReport
Posted on by
- Have created teams workflows (post to channel when receving webhook request), test the webhook in postman, but while using it with github actions not able to send alert to teams and getting below error
 
{"error":{"code":"DirectApiAuthorizationRequired","message":"The request must be authenticated only by Shared Access scheme."}}
have added teams workflow webhook to github secrets
 
below is example ci//cd step
- name: Notify on success
if: ${{ success() }}
run: |
PACKAGE_VERSION=$(npm run version --silent)
BASE_BRANCH=$(echo $GITHUB_REF | awk -F/ '{print $3}')
MERGE_COMMIT_SHA=$(git log --merges --format="%H" -n 1)
MERGE_AUTHOR=$(git show -s --format="%an" $MERGE_COMMIT_SHA)
cat << EOF > message.json
{"@type":"MessageCard","@context":"https://schema.org/extensions","summary":"Pipeline Success!","themeColor":"00FF00","title":"$GITHUB_REPOSITORY pipeline Success ✅✅ ","sections":[{"facts":[{"name":"Repository:","value":"$GITHUB_REPOSITORY"},{"name":"Branch:","value":"$GITHUB_REF_NAME"},{"name":"Package Version:","value":"$PACKAGE_VERSION"}]}],"potentialAction":[{"@type":"OpenUri","name":"View on GitHub","targets":[{"os":"default","uri":"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"}]}],"text":"$MERGE_AUTHOR merged commits into $BASE_BRANCH"}
EOF
curl -X POST ${{ secrets.TEAMS_WEBHOOK_URL }} --header 'Content-Type: application/json' -d @message.json
 
 
Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard

Featured topics