question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error Importing dependency MicrosoftTeams module

See original GitHub issue

Hi, I have an Azure Function Powershell the function is in production and is correctly using commands belonging to the imported module requirement:

@{
    # For latest supported version, go to 'https://www.powershellgallery.com/packages/Az'.
    'MicrosoftTeams' = '3.*'
}

We receive the following trace, seems like it is trying to download the new version but get error:

2022-03-02T13:36:26  Welcome, you are now connected to log-streaming service. The default timeout is 2 hours. Change the timeout with the App Setting SCM_LOGSTREAM_TIMEOUT (in seconds).
2022-03-02T13:37:49.841 [Information] Executing 'Functions.HttpTriggerTest' (Reason='This function was programmatically called via the host APIs.', Id=43f38b60-f050-4e08-9051-13e8d42d3ff3)
2022-03-02T13:37:56.477 [Warning] The first managed dependency download is in progress, function execution will continue when it's done. Depending on the content of requirements.psd1, this can take a few minutes. Subsequent function executions will not block and updates will be performed in the background.
2022-03-02T13:38:24.665 [Error] Executed 'Functions.HttpTriggerTest' (Failed, Id=ce955a0a-89a5-4387-a48a-62b38ad34ed6, Duration=120283ms)Result: FailureException: Failed to install function app dependencies. Error: 'Failed to install function app dependencies. Error: 'The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to save the module 'MicrosoftTeams'.''Stack:    at Microsoft.Azure.Functions.PowerShellWorker.DependencyManagement.DependencyManager.WaitOnDependencyInstallationTask() in /home/vsts/work/1/s/src/DependencyManagement/DependencyManager.cs:line 248at Microsoft.Azure.Functions.PowerShellWorker.DependencyManagement.DependencyManager.WaitForDependenciesAvailability(Func`1 getLogger) in /home/vsts/work/1/s/src/DependencyManagement/DependencyManager.cs:line 165at Microsoft.Azure.Functions.PowerShellWorker.RequestProcessor.ProcessInvocationRequest(StreamingMessage request) in /home/vsts/work/1/s/src/RequestProcessor.cs:line 253

The MicrosoftTeams module is available from the PS gallery, the PS core version used is 7.0 image

This is the repo test which is generating the issue: https://github.com/alessiodecastro/TestFunction

Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Francisco-Gaminocommented, May 20, 2022

Thank you for your feedback @nmwael. I have opened an issue in the PowerShell Get repo to make the temp folder in Save-Module configurable. Having this functionality will help us unblock this scenario.

1reaction
alessiodecastrocommented, Mar 3, 2022

Hi @Francisco-Gamino thanks for your quick reply, I added the module as follow:

PSFunctionApp
 | - MyFunction
 | | - run.ps1
 | | - function.json
 | - Modules
 | | - MicrosoftTeams
 | | | - 3.1.1
 | | | | - ....ps1
 | - local.settings.json
 | - host.json
 | - requirements.psd1

and removed the target from requirements.psd1 in order to avoid the download from the PSgallery. This is working!

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect-MicrosoftTeams not working
1. Whether powershell can find other cmdlets in that module. Run Import-Module -Name MicrosoftTeams. Then type add-team then press tab to see if ......
Read more >
Error Importing dependecy MicrosoftTeams module above ...
Hi, I have an Azure Function Powershell the function is in production and is correctly using commands belonging to the imported module ......
Read more >
[SOLVED] Issues loading MicrosoftTeams module
I installed the MicrosoftTeams module by running Install-Module -Name MicrosoftTeams as per instructions. So it looks like there's some kind of ...
Read more >
HELP : Module Import failure : r/PowerShell
If we just run "Import-Module MicrosoftTeams", it runs fine and then the script can be run in the same window.
Read more >
no valid module file was found in any module directory ...
Problem: When trying to import the PnP PowerShell module, I got an error message “Import-Module: The specified module 'SharePointPnPPowerShellOnline' was ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found