Error Importing dependency MicrosoftTeams module
See original GitHub issueHi, 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
This is the repo test which is generating the issue: https://github.com/alessiodecastro/TestFunction
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Hi @Francisco-Gamino thanks for your quick reply, I added the module as follow:
and removed the target from requirements.psd1 in order to avoid the download from the PSgallery. This is working!
Thanks