Skip to content

[BUG] New-PnPTeamsTeam returns nothing on Azure Automation using Managed Identity auth #4902

Open
@SabbeRubbish

Description

@SabbeRubbish

Reporting an Issue or Missing Feature

Creating a new MS Team using New-PnPTeamsTeam

Expected behavior

Return value = the created team object with properties like GroupId to continue modifying this team (adding channels, getting SiteURL to set sharing policies, ...)

Actual behavior

Return value on Azure Automation = $null

Steps to reproduce behavior

  1. Create app registration with Groups.ReadWrite.All app-only permission
  2. Run this code:
Connect-PnPOnline <url> -ManagedIdentity
$team = New-PnPTeamsTeam -DisplayName "doesn't matter" -MailNickName "doesn't matter" -Description "doesn't matter" -Visibility Public -Owners "myuserupn" -Members "myuserupn"
Write-Output "Created team $team"

$team will be $null.

This works on 3.1 and 2.12.0 in my VS Code console (not on Azure Automation). Even works on my local Azure Automation job.

What is the version of the Cmdlet module you are running?

Azure Automation only allows 2.12.0, so that's the version that has the issue.

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Azure Automation

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions