Skip to content
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

When connecting to Graph in Azure Automation PowerShell 7.2 with a managed identity, the welcome message is still output even though the -NoWelcome switch is specified. #2547

Closed
lrarbin opened this issue Jan 26, 2024 · 3 comments

Comments

@lrarbin
Copy link

lrarbin commented Jan 26, 2024

Describe the bug
When connecting to Graph in Azure Automation PowerShell 7.2 with a managed identity, the welcome message is still output even though the -NoWelcome switch is specified.

$umiGraphAccess = Get-AutomationVariable -Name 'umiGraphAccess'
$graphcon = Connect-MgGraph -NoWelcome -Identity -ClientId $umiGraphAccess

    ClientId:
    TenantId:
    Scopes: {TeamSettings.ReadWrite.All, ChannelSettings.Read.All, Directory.ReadWrite.All, Sites.ReadWrite.All…}
    AuthType: ManagedIdentity
    TokenCredentialType: ManagedIdentity
    CertificateThumbprint: 
    CertificateSubjectName: 
    Account: 
    AppName: 
    ContextScope: Process
    Certificate: 
    PSHostVersion: 7.2.0
    ManagedIdentityId:
    ClientSecret: 
    Environment: Global

To Reproduce
Steps to reproduce the behavior:

  • Execute on Azure Automation PowerShell 7.2 with a managed identity
$umiGraphAccess = Get-AutomationVariable -Name 'umiGraphAccess'
$graphcon = Connect-MgGraph -NoWelcome -Identity -ClientId $umiGraphAccess
  • View Output in Azure Automation job.

Expected behavior
Nothing should be output to the Output Window in Azure Automation PowerShell 7.2 from the Connect-MgGraph cmdlet if the -NoWelcome switch is used.

Debug Output
Cannot get this easily from Azure Automation

Module Version

Please run Get-Module Microsoft.Graph* after cmdlet execution and paste the output below.
If a module cannot be installed or imported, please run Get-Module -ListAvailable and paste the output.

In the available modules

Name IsGlobal Version SizeInBytes Activity
Microsoft.Graph.Applications                    False 2.12.0      3899749    0
Microsoft.Graph.Authentication                  False 2.12.0      6370566    0
Microsoft.Graph.Files                           False 2.12.0     29037842    0
Microsoft.Graph.Groups                          False 2.12.0      5296678    0
Microsoft.Graph.Identity.DirectoryManagement    False 2.12.0      4148344    0
Microsoft.Graph.Sites                           False 2.12.0     16650651    0
Microsoft.Graph.Teams                           False 2.12.0     10951496    0
Microsoft.Graph.Users                           False 2.12.0      3645180    0

In the script

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.12.0                Microsoft.Graph.Authentication      {Add-MgEnvironment, Connect-MgGraph, Disconnect-Mg…

Script     2.12.0                Microsoft.Graph.Identity.Directory… {Confirm-MgContactMemberGroup, Confirm-MgContactMe…

Environment Data

Name                           Value
----                           -----
PSVersion                      7.2.0
PSEdition                      Core
GitCommitId                    7.2.0
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Screenshots

If applicable, add screenshots to help explain your problem.
MicrosoftAzureAutomation

Additional context

Add any other context about the problem here.

@timayabi2020
Copy link
Contributor

@lrarbin are you getting the same result if you try to manually execute via a runbook?

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@lrarbin
Copy link
Author

lrarbin commented Feb 27, 2024

I don't know if an update has fixed it, but welcome message is no longer displayed in my Runbook environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants