-
Notifications
You must be signed in to change notification settings - Fork 53
Connect-EXOPSSession Unavailable in Azure Functions #503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
HI @luckerby -- By default, the only cmdlets available in the Azure Functions Service is whatever ships with PowerShell Core 6.2 or 7 (depending on the version you are using in your function app). However, you can install additional modules for your function app using Managed Dependencies. For more information, please see https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-powershell#dependency-management. Here is what the # This file enables modules to be automatically managed by the Functions service.
# See https://aka.ms/functionsmanageddependency for additional information.
#
@{
'MSApiConnect'= '1.0.0'
}
Please keep in mind that the module needs to be PowerShell Core compliant. If this is not the case, we can provide you with a potential work around. Let us know. Cheers, |
There's currently 2 versions of the Exchange Online modules. Each consists of a limited set of cmdlets. Upon using a Connect-* type of cmdlet ( For the Exchange Online V1 module (which Microsoft no longer recommends using in favor of V2), it's explicitly stated that "The Exchange Online Remote PowerShell Module is not supported in PowerShell Core (macOS, Linux, or Windows Nano Server)". You mentioned a workaround for this, but since V1 is not the preferred way anymore, let's look at the next version. For V2 - which contains both 9 new cmdlets as well as the old ones in V1, the
Can you let me know more details around the workaround ? |
One more thing that could affect us - trying to run V2 module's
|
Hello @luckerby , Here is the potential workaround for the V2 module which might have some dependencies that are not Core CLR compliant.
|
Another workaround is to spawn a powershell.exe process from the function: #232 (comment). |
For those still experiencing this issue, this might do the trick |
Azure CloudShell has been offering for some time now the ability of using Connect-EXOPSSession, without importing any module manually.
However trying to use the Connect-EXOPSSession cmdlet within an Azure Function results in the error below. Is there anything extra required to have this working - along with other Exchange Online cmdlets - or it's simply not supported for now ?
The text was updated successfully, but these errors were encountered: