Azure / Azure/PSRule.Rules.Azure
[BUG] Inherited 25 subscription limit with Export-AzRuleData -All
- Dominant language
- PowerShell
- Stars
- 447
- Forks
- 109
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 23
Description
### Existing rule
_No response_
### Description of the issue
When running `Export-AzRuleData -All` you hit a transparent 25 subscription limit inherited from any `Connect-AzAccount` connection that has used the default settings (such as the default connection in Azure shell). Not so much a bug but certainly fell into the 'unexpected behavior' category for me.
To overcome the limit I reconnect with `Connect-AzAccount -MaxContextPopulation -1` or loop through the subscriptions, setting context each time with `Set-AzContext -Subscription`.
### Error messages
_No response_
### Reproduction
`Connect-AzAccount` followed by `Export-AzRuleData -All` on any tenant with more than 25 subscriptions.
### Version of PSRule
2.9.0
### Version of PSRule for Azure
1.45.1
### Additional context
[connect-azaccount default limit documentation](https://learn.microsoft.com/en-us/powershell/module/az.accounts/connect-azaccount?view=azps-14.3.0#description)
Contributor guide
Assessment
This issue has not been assessed yet.