skip to Main Content

I have this powershell script which works very well on my computer. I use the x64 and powershell 7.2.

The problem is when I publish the code to Azure, there is a module missing. The module is a .net System.Data.OleDb.

 ERROR: Exception calling "Open" with "0" argument(s): "The 'MSOLAP' provider is not registered on the local machine."

I have tried to add the .dll file to Module folder, that i created but function app doesn’t load it for some reason.

Structure of the function app

  • host.json
  • local.settings.json
  • powerbitablerefresh
    • run.ps1
    • function.json
  • Modules
    • Microsoft.AnalysisServices.AzureClient.dll
  • profile.ps1
  • requirements.psd1
    • inside requirements I have:
'Az.Keyvault' = '4.*'
'Az.Accounts' = '2.*'
'Az.AnalysisServices' = '1.*'
'SqlServer' = '21.1.18256'

My question is, how do I install .dll on a function app?

2

Answers


  1. Chosen as BEST ANSWER

    The right answer is that add the .dll files to the C:homesitewwwroot and then in the powershell script run it like this

    Add-Type -Path (Join-Path $PSScriptRoot "Microsoft.Identity.Client.dll")
    Add-Type -Path (Join-Path $PSScriptRoot "Microsoft.AnalysisServices.AdomdClient.dll")
    

    It will then create a connection


  2. how do I install .dll on a function app?

    You can install .dll files by following below workaround:

    • Firstly, Login to Azure
    • Then open your Function App
    • Then Click on Advanced tools , then click on Go
    • Then Click on Tools, Then click on Zip Push Depoly like below:

    enter image description here

    • Then Click on your function app
    • Then click on bin folder and after it opens, drag your .dll file over there and then you can reference them in your function app:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search