When there are multiple subscriptions under the local azure account, the setup-gh command would fail to discover the correct resource group with error like this:
Error: resource group not found
This is because the resource group validation logic is expecting 1) the local azcli has fetched all subscriptions 2) the resource group is created under the active subscription. However these assumptions are incorrect when running with command like this:
$ draft setup-gh -s <my-sub-id> -g <my-rg-name>
To get the resource group correctly, this pull request added --subscription parameter on the query command. I also enhanced the error message a bit to provide more details on missing resource group error.
Fixes # (issue)
Feature # (details)
Type of change
Please delete options that are not relevant.
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
How Has This Been Tested?
I tested this change from my local with above command.
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[x] Any dependent changes have been merged and published in downstream modules
😊🎉☕️🙏 observation to share; 200 premerge checks are super over eager and we should curb them to more smaller list. Let me open a tracking wi against this.
Description
When there are multiple subscriptions under the local azure account, the
setup-gh
command would fail to discover the correct resource group with error like this:This is because the resource group validation logic is expecting 1) the local
azcli
has fetched all subscriptions 2) the resource group is created under the active subscription. However these assumptions are incorrect when running with command like this:To get the resource group correctly, this pull request added
--subscription
parameter on the query command. I also enhanced the error message a bit to provide more details on missing resource group error.Fixes # (issue) Feature # (details)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I tested this change from my local with above command.
Checklist: