Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 7Emmc/dRb93/sMkJqSuEId
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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

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

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Connector Development

Overall leaderboard

Featured topics

Loading started