Hello @Mugileeshwaran J S - Unfortunately, as far as Azure Functions, this doesn't seem possible: https://feedback.azure.com/d365community/idea/564859b0-f224-ec11-b6e6-000d3a4f0da0
I want to run the powershell in Azure function as http trigger, where powershell script has function to open the excel and to read it, while trying to open it it displays the below error
Retrieving the COM class factory for component with CLSID {00000000-0000-0000-0000-000000000000} failed due to the following error: 80040154 Class not registered (0x80040154 (REGDB_E_CLASSNOTREG)).
2023-08-10T10:29:06Z
Register COM Object
I also tried placing the dll file in the location and tried to run, but same error
-
Mike Urnun 9,856 Reputation points Microsoft Employee
2023-09-29T00:04:10.8166667+00:00
1 additional answer
Sort by: Most helpful
-
Ben Gimblett 4,550 Reputation points Microsoft Employee
2023-09-15T13:26:20.3533333+00:00 Generally speaking COM isn't supported in App Service / Functions due to the sandbox that your code runs in
An almost identical Q&A on this (and trying to access Excel) is here https://learn.microsoft.com/en-us/answers/questions/247908/how-to-register-microsoft-component-object-model-i
App Service supports windows containers (as well as AKS), but as far as I know windows containers aren't supported yet by Functions. They are also not supported yet on Container Apps.
So you could host an API in App Service on a windows container - this would give much more access to the guest OS and should unblock you here