Skip to content

Bug report: Running CLI on Azure Function throws errors because of Spinner output #4692

Closed
@martinlingstuyl

Description

@martinlingstuyl

Description

When running the CLI 6.3 and above on an Azure Function, the following vague exceptions are thrown. This is probably caused by the Spinner trying to pipe output to the console, while the Azure Function may not be allowing this type of writing output.

[2023-03-29T11:56:41.954Z] Result: ERROR: - Running command...
[2023-03-29T11:56:41.955Z]
[2023-03-29T11:56:41.956Z] Exception             :
[2023-03-29T11:56:41.957Z]     Type        : System.Management.Automation.RemoteException
[2023-03-29T11:56:41.958Z]     ErrorRecord :
[2023-03-29T11:56:41.959Z]         Exception             :
[2023-03-29T11:56:41.960Z]             Type    : System.Management.Automation.ParentContainsErrorRecordException
[2023-03-29T11:56:41.960Z]             Message : - Running command...
[2023-03-29T11:56:41.961Z]             HResult : -2146233087
[2023-03-29T11:56:41.962Z]         CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
[2023-03-29T11:56:41.963Z]         FullyQualifiedErrorId : RuntimeException
[2023-03-29T11:56:41.965Z]     Message     : - Running command...
[2023-03-29T11:56:41.966Z]     HResult     : -2146233087
[2023-03-29T11:56:41.967Z] TargetObject          : - Running command...
[2023-03-29T11:56:41.968Z] CategoryInfo          : NotSpecified: (- Running command...:String) [], RemoteException
[2023-03-29T11:56:41.969Z] FullyQualifiedErrorId : NativeCommandError
[2023-03-29T11:56:41.970Z] InvocationInfo        :
[2023-03-29T11:56:41.971Z]     MyCommand        : node.exe
[2023-03-29T11:56:41.972Z]     ScriptLineNumber : 24
[2023-03-29T11:56:41.974Z]     OffsetInLine     : 5
[2023-03-29T11:56:41.975Z]     HistoryId        : -1
[2023-03-29T11:56:41.976Z]     ScriptName       : C:\Users\MartinLingstuyl\AppData\Roaming\npm\m365.ps1
[2023-03-29T11:56:41.977Z]     Line             :     & "node$exe"  "$basedir/node_modules/@pnp/cli-microsoft365/dist/index.js" $args
[2023-03-29T11:56:41.978Z]
[2023-03-29T11:56:41.978Z]     PositionMessage  : At C:\Users\MartinLingstuyl\AppData\Roaming\npm\m365.ps1:24 char:5
[2023-03-29T11:56:41.981Z]                        +     & "node$exe"  "$basedir/node_modules/@pnp/cli-microsoft365/dist/i .
[2023-03-29T11:56:41.983Z]                        +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2023-03-29T11:56:41.984Z]     PSScriptRoot     : C:\Users\MartinLingstuyl\AppData\Roaming\npm
[2023-03-29T11:56:42.065Z]     PSCommandPath    : C:\Users\MartinLingstuyl\AppData\Roaming\npm\m365.ps1
[2023-03-29T11:56:42.067Z]     InvocationName   : &
[2023-03-29T11:56:42.069Z]     CommandOrigin    : Internal
[2023-03-29T11:56:42.084Z] ScriptStackTrace      : at <ScriptBlock>, C:\Users\MartinLingstuyl\AppData\Roaming\npm\m365.ps1: line 24

Steps to reproduce

Create a new VS Code project with PowerShell, use a CLI command and press F5

CLI for Microsoft 365 version

6.4 (beta)

nodejs version

16.15.0

Operating system (environment)

Windows, Azure Function

Shell

PowerShell

Additional Info

If we would be able to hide the spinner with a config key, this may be avoided. Also, we should add this config key to the settings that will be added when running the new m365 setup command that is being created in #4216.

Implementation

We agreed on adding a config key showSpinner with the default value true. If it's false the spinner should not be rendered.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions