Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: query resource group under giving subscription id #238

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

bcho
Copy link
Member

@bcho bcho commented Nov 28, 2023

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:

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.

  • 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:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@davidgamero
Copy link
Collaborator

ty for the contribution this looks great!

@Tatsinnit
Copy link
Member

😊🎉☕️🙏 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.

IMG_0392

@Tatsinnit Tatsinnit merged commit d6ff3b3 into Azure:main Jan 6, 2024
200 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants