Skip to main content

Notifications

Community site session details

Community site session details

Session Id : q4EsekFAai+08Y6gvKW14p
Power Automate - Connector Development
Unanswered

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

Like (0) ShareShare
ReportReport
Posted on 4 Sep 2024 09:47:08 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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Automate - Connector Development

#1
RohanWadiwala Profile Picture

RohanWadiwala 16

#2
sdr7893 Profile Picture

sdr7893 2

Overall leaderboard

Featured topics

Loading started