New-TestResources.ps1 does not support subscription config mode without CI flags
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 130
Description
When running locally and using a subscription configuration (for example, to test service principal configurations), the logic is slightly broken. If passing a json subscription config via parameter splatting (i.e. using the `provisioner` parameter set), you must also pass the `-CI` switch flag otherwise the script will break:
```
15:14:04 - Selecting subscription ''
Set-AzContext: /home/ben/sdk/azure-sdk-for-net/eng/common/TestResources/New-TestResources.ps1:410
Line |
410 | … $null = Select-AzSubscription -Subscription $SubscriptionId
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Please provide a valid tenant or a valid subscription.
```
Contributor guide
Research direction
Start with eng/common/TestResources/New-TestResources.ps1, especially the subscription-selection logic around line 410, and reproduce a locally splatted provisioner invocation without -CI. Compare the subscription-config path with the CI path; done means the local configuration selects a valid subscription without requiring the CI switch and no longer produces the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- cloud, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100