Azure / Azure/azure-functions-powershell-worker

Failure to connect using the MicrosoftTeams 2.0.0 PowerShell module in function

Open
#611 4 comments 0 reactions 2 assignees Claimed by @stefanushinardi View on GitHub
investigation Partner module
Dominant language
C#
Stars
215
Forks
61
Avg merge
21h 4m
Merged PRs (30d)
6

Description

Trying to use the MicrosoftTeams PowerShell module version 2.0.0 as a managed dependency causes Connect-MicrosoftTeams to error out with the following error message, with chinese characters:

```
Exception calling "GetSteppablePipeline" with "1" argument(s): "Exception calling "GetRemoteNewCsOnlineSession" with "1" argument(s): "Connecting to remote server api.interfaces.records.teams.microsoft.com failed with the following error message : 錐ۈ껰৲ For more information, see the about_Remote_Troubleshooting Help topic.""
```

This happens only when loading the module without the -UseWindowsPowerShell parameter for Import-Module:

## PowerShell example

```PowerShell
Import-Module MicrosoftTeams
$Credential = [pscredential]::new($Username, $Password)
$ConnectionResult = Connect-MicrosoftTeams -Credential $Credential
```

## requirements.psd1

```PowerShell
@{
# 'Az' = '4.*'
"CosmosDB" = "4.4.3"
"MicrosoftTeams" = "2.0.0"
}
```

When using the -UseWindowsPowerShell parameter, I experience my function as unstable, often failing.

I have also tried Save-Module and having the module as files, loading it from there rather than managed dependency. Same issue.

This is a durable PowerShell 7 function.

Edit: Forgot to add the fact that everything works perfectly when running the function runtime locally.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.