Skip to main content

Notifications

Power Automate - Connector Development
Unanswered

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

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:

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,745

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard

Featured topics