Azure function - import module error

Sasa 31 Reputation points
2022-07-10T16:53:14.313+00:00

HI. I'm having an error "ERROR: Failed to generate proxies for remote module 'azureAD'. The -OutputModule parameter does not resolve to a path, and a user module path cannot be found for the provided name" when running the azure function.

All was worked before and I can't remember that I have done any azure app configuration changes other then importing module in a function profile. Tried to remove that but the same results.

Any help is appreciated.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
2,578 questions
No comments
1 vote

5 answers

Sort by: Most helpful
  1. Jaroslaw Raczynski 11 Reputation points
    2022-07-11T11:24:29.79+00:00

    I had a call with MS about that issue. The MS Engineer advised to change the value in FUNCTION_EXTENSION_VERSION to 3.8.2.0. After the change, the problem was solved.

    How to find it : Function App -> Configuration -> find FUNCTION_EXTENSION_VERSION and change value clicking on a pencil icon. After implemented changes, click Save


  2. Steven R 51 Reputation points
    2022-07-11T10:20:45.427+00:00

    We are also experiencing the exact same issue since last week. I started a thread on this here: https://learn.microsoft.com/en-us/answers/questions/919927/powershell-function-app-fails-to-import-module.html)

    Creating a new function app from scratch works - using the exact same code - for a couple of requests. After an undetermined number of tries, it stops working. Import-Module will always fail with the same error.

    Any suggestions on how to solve this would be much appreciated.

    No comments

  3. Dillon Silzer 33,346 Reputation points
    2022-07-10T18:00:58.217+00:00

    I believe a similar issue was explained below. You need to check your PSModulePath.

    ($env:PSModulePath).split(";")  
    

    https://stackoverflow.com/questions/72916606/custom-powershell-module-fails-to-import-in-azure-funtion

    https://github.com/PowerShell/PowerShell/issues/12532


  4. MayankBargali-MSFT 49,456 Reputation points Microsoft Employee
    2022-07-11T03:37:58.743+00:00

    **Update: **

    @Sasa @vidarak @Steven R
    Apology for the inconvenience due to this issue. The workaround is to update the runtime version to 3.8.2.0 by updating the FUNCTION_EXTENSION_VERSION in tha application configuration of your function app if you are running PowerShell function version 7.
    The product team will be fixing the issue in the latest runtime.

    @Sasa Thanks for reaching out. As per the error it looks like there is issue with the module azureAD. Can you please share your requirements.psd1 file and confirm if you have added the AzureAD in your requirements.psd1. For more details on Dependency management, you can refer to this document.

    @{  
     Az = '1.*'  
     AzureAD = '2.0.2.140'  
    }  
    

    In Az module I don't see AzureAD dependencies. In case if you have added the dependencies correctly then please share sample code so I can verify at my end.


  5. vidarak 1 Reputation point
    2022-07-11T08:09:48.61+00:00

    Having the exact same issue occur with Azure Function App timed functions on 3 separate tenants. Last successful run was on July 6th. Failed runs started on 7th. Seems like MS had made a change that introduced a bug.

    FYI: I've made a support request on our Unified Enterprise support plan about this. Will update if there are any solutions from them.