Microsoft Teams Post message issue

Hi,

I am deploying package to Linux server. I have a step to post the status to MS Teams page. I am using
“Microsoft Teams - Post a message” template. However, it failed to post the message and throws the following error

The same step is working when deploying windows machine.

Hi @endashaw.adane,

Thanks for reaching out and providing the error.

To get this step to work you will need to install pwsh on the Linux box and make the pwsh command accessible to the account running the tentacle/worker.

Please let me know if that helps or if we need to dig in further.

Best,
Jeremy

@jeremy.miller

Sorry for the delay. I’ve installed pwsh and tried again. but got the following. I wonder where the “D” drive is coming from as the target is a Linux server. The pwsh and accessible to the account which run tentacle

The step failed: Activity Microsoft Teams - Post a message on the Octopus Server failed with error ‘The remote script failed with exit code 1’.
InvalidOperation: The underlying connection was closed: An unexpected error occurred on a receive.

At D:\Octopus\Work\20210323173929-35188-58\Script.ps1:10 char:1

  • Invoke-RestMethod -Method POST -Uri $OctopusParameters[‘HookUrl’] -Bo …

at , D:\Octopus\Work\20210323173929-35188-58\Script.ps1: line 10
at , D:\Octopus\Work\20210323173929-35188-58\Bootstrap.Script.ps1: line 1479
at , : line 1
at , : line 1
The remote script failed with exit code 1
The action Microsoft Teams - Post a message on the Octopus Server failed

Hey @endashaw.adane,

No worries!

Would you be able to DM me a screenshot of how you have the step setup along with the full attached task log? If possible, also a deployment process JSON. To get this go to the Project, then the process section, then click the 3 dots to the right of add step and click download JSON.

Please let me know.

Best,
Jeremy

Hi @endashaw.adane,

Thanks for the screenshot and JSON.

How many workers are in the Default Worker Pool? I’m guessing it’s just the one that you installed pwsh on, but I wanted to be sure.

Please let me know.

Best,
Jeremy

@jeremy.miller ,

Oh Thanks! There is zero worker in the Default Worker Pool. I should have select “This step will run on each deployment target” Now it is working fine

Thanks again!

Endashaw

1 Like

Hi @endashaw.adane,

You’re very welcome!

Thanks for letting me know you’re in a good state.

I hope you have a great rest of your week.

Best,
Jeremy

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.