Azure / Azure/azure-powershell

Get-AzRoleAssignment returns assignment for soft deleted storage containers

Open
#25,375 7 comments 0 reactions 0 assignees View on GitHub
act-identity-squad bug customer-reported Resource Authorization Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

Follow the steps below to simulate this issue

- create a new Storage Account Container named SSS
- assign role RRR to group GGG
- remove this Container
- create again a new Storage Account Container named SSS
- list assigned roles via Get-AzRoleAssignment

You will receive various inherited role assignments but also assignments for role RRR and group GGG which are actually assigned at the deleted container, not this one newly created!

### Issue script & Debug output

```PowerShell
Get-AzRoleAssignment
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 7.4.2
PSEdition Core
GitCommitId 7.4.2
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0, 5.0, 5.1, 6.0, 7.0}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```

### Module versions

```PowerShell
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.15.0 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault, Connect-AzAc…
Script 6.4.1 Az.Resources {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeploy…
Script 3.0.0 Az.Storage {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagementPolicyAction, Ad
```

### Error output

```PowerShell
No error
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.