Skip to content

[BUG] PnP 2.* not working with Az-Module #3002

@HeKr09

Description

@HeKr09

Reporting an Issue or Missing Feature

I am trying to run PnP and Azure in one PowerShell and receive an error.

Expected behavior

Both cmdlets should work

Actual behavior

I receive an error when I want to get an azure resource group after connecting with PnP.
Error

Steps to reproduce behavior

Connect-PnPOnline -Url $WebUrl -Credentials $Credentials
Connect-AzAccount -Tenant "SOMEID" -Credential $Credentials | Out-Null
Connect-MgGraph -TenantId "SOMEID" -Scopes Group.ReadWrite.All | Out-Null

$AzureResourceGroupName = "SPW_RG"

# Removing Azure resource group
$resource = Get-AzResourceGroup -Name $AzureResourceGroupName

Disconnect-MgGraph
Disconnect-AzAccount
Disconnect-PnPOnline

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

  • Az: 9.4.0
  • Az.Resources: 6.5.2
  • PnP: 2.1.1 (also tested with 2.0.6-nightly) - but worked everything with 1.12.0

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

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

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