I am using the following to add in the AzureAD
Import-Module AzureAD -UseWindowsPowerShell
I have also added in 'AzureAD' = '2.*' in the requirements.psd1
Yet when I run the function I am getting the following error message:
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.Exception :Type : System.InvalidOperationExceptionMessage : 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.InnerException :Type : System.Management.Automation.CmdletInvocationExceptionErrorRecord :Exception :Type : System.ArgumentExceptionMessage : The -OutputModule parameter does not resolve to a path, and a user module path cannot be found for the provided name.TargetSite :Name : ThrowTerminatingErrorDeclaringType : System.Management.Automation.MshCommandRuntime, System.Management.Automation, Version=7.2.4.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35MemberType : MethodModule : System.Management.Automation.dllSource : System.Management.AutomationHResult : -2147024809StackTrace :at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)TargetObject : Microsoft.PowerShell.Commands.ExportPSSessionCommandCategoryInfo : InvalidArgument: (Microsoft.PowerShel…ortPSSessionCommand:ExportPSSessionCommand) [Export-PSSession], ArgumentExceptionFullyQualifiedErrorId : ExportPSSession_ErrorModuleNameOrPath,Microsoft.PowerShell.Commands.ExportPSSessionCommandInvocationInfo :MyCommand : Export-PSSessionHistoryId : 1InvocationName : Export-PSSessionCommandOrigin : InternalScriptStackTrace : at , C:\home\site\wwwroot\TimerTrigger1\run.ps1: line 3TargetSite :Name : InvokeDeclaringType : System.Management.Automation.Runspaces.PipelineBase, System.Management.Automation, Version=7.2.4.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35MemberType : MethodModule : System.Management.Automation.dllMessage : The -OutputModule parameter does not resolve to a path, and a user module path cannot be found for the provided name.InnerException :Type : System.ArgumentExceptionMessage : The -OutputModule parameter does not resolve to a path, and a user module path cannot be found for the provided name.TargetSite :Name : ThrowTerminatingErrorDeclaringType : System.Management.Automation.MshCommandRuntime, System.Management.Automation, Version=7.2.4.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35MemberType : MethodModule : System.Management.Automation.dllSource : System.Management.AutomationHResult : -2147024809StackTrace :at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)Source : System.Management.AutomationHResult : -2146233087StackTrace :at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)at System.Management.Automation.Runspaces.Pipeline.Invoke()at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)at System.Management.Automation.RemoteDiscoveryHelper.InvokeNestedPowerShell(PowerShell powerShell, PSCmdlet cmdlet, PSInvocationSettings invocationSettings, String errorMessageTemplate, CancellationToken cancellationToken)+MoveNext()at System.Management.Automation.RemoteDiscoveryHelper.EnumerateWithCatch[T](IEnumerable1 enumerable, Action1 exceptionHandler)+MoveNext()HResult : -2146233079CategoryInfo : NotSpecified: (:) [Import-Module], InvalidOperationExceptionFullyQualifiedErrorId :
I tried to reproduce the same in my environment and got the same error:
I created a Function App with configuration settings like below:
To resolve the error, make sure to set the Runtime version as 4 like below:
I added 'AzureAD' = '2.*' in the requirements.psd1 file:
I created Http trigger function and got the module imported successfully like below:
using namespace System.Net
param($Request, $TriggerMetadata)
Import-Module -Name 'AzureAD' -UseWindowsPowershell
Push-OutputBinding -Name Response -Value ([HttpResponseContext]#{
StatusCode = [HttpStatusCode]::OK
Body = $body
})
Response:
If still the error persists, try creating a new Function App from scratch with latest versions.
Alternatively, you can also invoke the Http trigger multiple times to get the response successfully.
Reference:
Azure function - import module error by MayankBargali-MSFT
I encountered a problem when using the swupdate image built by yocto.
Software Update started !
[network_initializer] : Software update started
[extract_file_to_tmp] : Found file
[extract_file_to_tmp] : filename sw-description
[extract_file_to_tmp] : size 303
[get_common_fields] : Version 0.1.0
[get_common_fields] : Description Firmware update for XXXXX Project
[parse_hw_compatibility] : Accepted Hw Revision : 1.0
[parse_hw_compatibility] : Accepted Hw Revision : 1.2
[parse_hw_compatibility] : Accepted Hw Revision : 1.3
[_parse_images] : Found Image: rootfs.ext4.gz in device : /dev/mmcblk2p4 for handler raw
[check_hw_compatibility] : Hardware myir Revision: 1.0
[check_hw_compatibility] : Hardware compatibility verified
[extract_files] : Found file
[extract_files] : filename rootfs.ext4.gz
[extract_files] : size 373258053 required
ERROR : Not enough free space to extract rootfs.ext4.gz (needed 373258053, got 223219712)
Image invalid or corrupted. Not installing ...
[network_initializer] : Main thread sleep again !
Waiting for requests...
ERROR : Writing to IPC fails due to Broken pipe
As shown in the figure, it indicates that there is not enough space, and then I use resize2fs /dev/mmcblk2p4 to expand the space. Now it has 1g of space. But still the same hint. Please let me know what you think.
Try using the installed-directly flag in the sw-description file.
files: (
{
filename = "rootfs.ext4.gz";
sha256 = "bc57b9c737033d0d6826db51618d596da7ecf3fdc0cb48dc9986a6094f529413";
type = "archive";
path = "/path/to/extract";
preserve-attributes = true;
installed-directly = true; <---------- this option
properties: {
create-destination = "true";
}
}
Currently, I'm Using the Connect-PnPOnline in a Powershell script:
Connect-PnPOnline -ClientId $tenant_client_id -ClientSecret $tenant_client_secret -Url $TenantUrl
When I run this code in the Windows PowerShell ISE, Works perfectly but if I try to run this in an Azure function this error appears:
ERROR: The type initializer for 'OfficeDevPnP.Core.Utilities.TokenHelper' threw an exception.
Exception :
Type : System.TypeInitializationException
TypeName : OfficeDevPnP.Core.Utilities.TokenHelper
TargetSite :
Name : ProcessRecord
DeclaringType : PnP.PowerShell.Commands.Base.ConnectOnline
MemberType : Method
Module : PnP.PowerShell.Online.Commands.dll
StackTrace :
at PnP.PowerShell.Commands.Base.ConnectOnline.ProcessRecord()
at System.Management.Automation.Cmdlet.DoProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
Message : The type initializer for 'OfficeDevPnP.Core.Utilities.TokenHelper' threw an exception.
Data : System.Collections.ListDictionaryInternal
InnerException :
Type : System.TypeLoadException
Message : Could not load type 'System.Web.Configuration.WebConfigurationManager' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
TypeName : System.Web.Configuration.WebConfigurationManager
TargetSite : Void .cctor()
StackTrace :
at OfficeDevPnP.Core.Utilities.TokenHelper..cctor()
Source : OfficeDevPnP.Core
HResult : -2146233054
Source : PnP.PowerShell.Online.Commands
HResult : -2146233036
CategoryInfo : NotSpecified: (:) [Connect-PnPOnline], TypeInitializationException
FullyQualifiedErrorId : System.TypeInitializationException,PnP.PowerShell.Commands.Base.ConnectOnline
InvocationInfo :
MyCommand : Connect-PnPOnline
ScriptLineNumber : 36
OffsetInLine : 1
HistoryId : 1
I need to use the Credential ID and The Client Secret to authenticate.
You may need to switch your Azure function to Version 1.0.
According to documentation version 2 is .NET Core 2 and function app version 1.0 ~. That should be the cause why it prompt "Could not load type 'System.Web.Configuration.WebConfigurationManager'.
I'm trying to the state of the PRM_RSTST register of my ARM Cortex A8 processor to find the reason of resets because WDIOC_GETBOOTSTATUS isn't implemented for my processor, a TI8148. I know for the datasheet that the offset/adress is supposed to be 0xA8. However if I try to read in in my kernel driver with __raw_readl(0xA8) I get a seg fault. The other idea I had was to use /dev/mem, however if I go in with devmem2 0xA8 I get
/dev/mem opened.Unhandled fault: Precise External Abort on non-linefetch (0x018) at 0x401270a8
Memory mapped at address 0x40127000.
Bus error (core dumped)
So I looked at the mapping of memory with cat /proc/iomem
00000000-00000000 : omap2-nand.0
08000000-08000003 : omap2-nand
20000000-2fffffff : pcie-nonprefetch
47400000-47400fff : usbss
47401000-474017ff : musb0
47401000-474017ff : musb0
47401800-47401fff : musb1
47401800-47401fff : musb1
48010000-480100ff : omap-iommu.1
48010000-480100ff : omap-iommu.1
48020000-48021fff : omap_uart.0
48020000-48021fff : omap_uart
48022000-48023fff : omap_uart.1
48022000-48023fff : omap_uart
48024000-48025fff : omap_uart.2
48024000-48025fff : omap_uart
48028000-48028fff : omap_i2c.1
48028000-48028fff : omap_i2c
4802a000-4802afff : omap_i2c.2
4802a000-4802afff : omap_i2c
48030100-480301ff : omap2_mcspi.1
48030100-480301ff : omap2_mcspi.1
48032000-48032fff : omap_gpio.0
48038000-4803afff : mcasp
48038000-4803afff : davinci-mcasp
4803c000-4803efff : mcasp
4803c000-4803efff : davinci-mcasp
4804c000-4804cfff : omap_gpio.1
48080000-48081fff : omap2_elm.1
48080000-48081fff : omap2_elm.1
480c0000-480c0fff : omap_rtc
480c0000-480c0fff : omap_rtc
480c8000-480c8143 : omap-mailbox
48105500-481058ff : ti81xxvin
48105a00-48105dff : ti81xxvin
481a0100-481a01ff : omap2_mcspi.2
481a0100-481a01ff : omap2_mcspi.2
481a2100-481a21ff : omap2_mcspi.3
481a2100-481a21ff : omap2_mcspi.3
481a4100-481a41ff : omap2_mcspi.4
481a4100-481a41ff : omap2_mcspi.4
481a6000-481a7fff : omap_uart.3
481a6000-481a7fff : omap_uart
481a8000-481a9fff : omap_uart.4
481a8000-481a9fff : omap_uart
481aa000-481abfff : omap_uart.5
481aa000-481abfff : omap_uart
481ac000-481acfff : omap_gpio.2
481ae000-481aefff : omap_gpio.3
481c7000-481c7fff : omap_wdt
481c7000-481c7fff : omap_wdt
481cc000-481cffff : d_can
481cc000-481cffff : d_can
481d8100-481e80ff : mmci-omap-hs.0
481d8100-481e80ff : mmci-omap-hs
49000000-49007fff : edma_cc0
49000000-49007fff : edma
49800000-498003ff : edma_tc0
49900000-499003ff : edma_tc1
49a00000-49a003ff : edma_tc2
49b00000-49b003ff : edma_tc3
4a100000-4a1007ff : cpsw.0
4a100000-4a1007ff : eth0
4a100800-4a1008ff : davinci_mdio.0
4a100800-4a1008ff : davinci_mdio.0
4a100900-4a1009ff : cpsw.0
4a100900-4a1009ff : eth0
4a140000-4a150fff : ahci.0
51000000-51003fff : pcie-regs
55082000-550820ff : omap-iommu.0
55082000-550820ff : omap-iommu.0
80000000-bfffffff : pcie-inbound0
80000000-917fffff : System RAM
80044000-8058cfff : Kernel text
8058e000-8061770f : Kernel data
bd000000-bf7fffff : System RAM
So apparently 0x40127000, where devmem2 wants to look isn't mapped.
So where do I find the register with offset 0xA8?
I want to reserve a page in physical memory so that kernel will not allocate it for anything else. Standard solution is to use memmap. I defined it in my uboot parameter (memmap=4K$0xA4D000) but it is not taking effect. I have verified full argument passed to the kernel from /proc/commandline. Is there any kernel configuration that needs to be enabled?
*uname -a
Linux hostname 3.12.19-rt30 #5 SMP Thu Sep 1 23:23:49 IST 2016 ppc64 GNU/Linux*
*cat /proc/cmdline
root=/dev/mtdblock9 rw rootfstype=jffs2 init=/init siq_board_type=CU_200103 default_hugepagesz=256m hugepagesz=256m hugepages=1 usdpaa_mem=256M bportals=s0 qportals=s0 isolcpus=1,2,3,4,7 DEBUG_MODE=y memmap=4K$0xA4D000 memblock=debug console=ttyS1,115200 HOSTNAME=airv_cu PRIPART=4 ip=10.208.26.101:10.204.1.3:10.208.26.254:255.255.255.0:airv_cu:eth0:off panic=1*
cat /proc/iomem
00000000-bfffffff : System RAM
fe8000000-fefffffff : fe8000000.nor
ffe008000-ffe008fff : mpc85xx_mc_err
ffe009000-ffe009fff : mpc85xx_mc_err
ffe11c500-ffe11c507 : serial
ffe11c600-ffe11c607 : serial
ffe11d500-ffe11d507 : serial
ffe11d600-ffe11d607 : serial
ffe1e0000-ffe1e07ff : rman-inbound-block0
ffe1e0b00-ffe1e0fff : rman-uio
ffe1e1000-ffe1e17ff : rman-inbound-block1
ffe1e2000-ffe1e27ff : rman-inbound-block2
ffe1e3000-ffe1e37ff : rman-inbound-block3
ffe400000-ffe4fffff : fman
ffe400000-ffe47ffff : fman-muram
ffe482000-ffe482fff : fman-port-hc
ffe483000-ffe483fff : fman-port-hc
ffe484000-ffe484fff : fman-port-hc
ffe485000-ffe485fff : fman-port-hc
ffe486000-ffe486fff : fman-port-hc
ffe487000-ffe487fff : fman-port-hc
ffe488000-ffe488fff : fman-port-hc
ffe489000-ffe489fff : fman-port-hc
ffe48a000-ffe48afff : fman-port-hc
ffe48b000-ffe48bfff : fman-port-hc
ffe48c000-ffe48cfff : fman-port-hc
ffe48d000-ffe48dfff : fman-port-hc
ffe490000-ffe490fff : fman-port-hc
ffe491000-ffe491fff : fman-port-hc
ffe4a8000-ffe4a8fff : fman-port-hc
ffe4a9000-ffe4a9fff : fman-port-hc
ffe4aa000-ffe4aafff : fman-port-hc
ffe4ab000-ffe4abfff : fman-port-hc
ffe4ac000-ffe4acfff : fman-port-hc
ffe4ad000-ffe4adfff : fman-port-hc
ffe4b0000-ffe4b0fff : fman-port-hc
ffe4b1000-ffe4b1fff : fman-port-hc
ffe4dc000-ffe4dcfff : fman-vsp
ffe4e0000-ffe4e0fff : mac
ffe4e2000-ffe4e2fff : mac
ffe4e4000-ffe4e4fff : mac
ffe4e6000-ffe4e6fff : mac
ffe4fe000-ffe4fefff : fman-rtc