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

Add new module azure_rm_account_info to get facts for current logged in user #922

Merged

Conversation

mandar242
Copy link
Contributor

SUMMARY

Add new module azure_rm_account_info.
Provides output equivalent to az account show.

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

azure_rm_account_info

ADDITIONAL INFORMATION

Makes use of below to create a output containing details similar to and of similar format to az account show

Copy link
Contributor

@abikouo abikouo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mandar242 Thanks for this pull request.
Could you please add some integration tests for this module?

except CloudError as exc:
self.fail("Failed to list all subscriptions - {0}".format(str(exc)))

results['id'] = subscription_list_response[0].subscription_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a choice to return only the first subscription [0] for the account?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the documentation and based on my trial-errors for az account show here: https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az-account-show
I felt that it returns a single subscription, so adding [0]th subscription.
I could be wrong here though. Thoughts?

plugins/modules/azure_rm_account_info.py Outdated Show resolved Hide resolved
@mandar242 mandar242 requested a review from abikouo July 20, 2022 16:17
@mandar242 mandar242 requested a review from abikouo July 25, 2022 20:18
@Fred-sun Fred-sun added new_module_pr Add new modules medium_priority Medium priority work in In trying to solve, or in working with contributors labels Jul 26, 2022
Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider deleting lines in the module that are not useful for modifying comments. Thank you very much!

@Fred-sun Fred-sun added ready_for_review The PR has been modified and can be reviewed and merged and removed work in In trying to solve, or in working with contributors labels Jul 27, 2022
@xuzhang3
Copy link
Collaborator

xuzhang3 commented Aug 1, 2022

LGTM

@xuzhang3 xuzhang3 merged commit 6a4e5da into ansible-collections:dev Aug 1, 2022
@mandar242 mandar242 deleted the new-module-azure-rm-account-info branch September 21, 2022 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority new_module_pr Add new modules ready_for_review The PR has been modified and can be reviewed and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants