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

estebanreyl/Unified Azure Utilities #332

Conversation

estebanreyl
Copy link

Adds a singleton client for managing Azure credentials/resources internally. This helps facilitate production of further azure connectivity and extends on many of the existing methods adding optimized async support where possible. The client includes the following features:

  • Acquire azureaccount
  • Acquire ContainerRegistry/ResourceGroup management clients
  • Validate sign in
  • Get Azure Container Registries (Optional scoping by Subscription and ResourceGroup
  • Get Azure Subscriptions
  • Get Azure Resource Groups (Optional scoping by Subscription)
  • Get Session Credentials

@estebanreyl estebanreyl changed the title estebanreyl/Unified Azure Credentials estebanreyl/Unified Azure Utilities Aug 2, 2018
//GETTERS
public getAccount(): AzureAccount {
if (this.azureAccount) { return this.azureAccount; }
throw new Error(('Azure account is not present, you may have forgotten to call setAccount'));
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: double parentheses


//CHECKS
//Provides a unified check for login that should be called once before using the rest of the singletons capabilities
public async isLoggedIn(): Promise<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's keep the concept count the same by naming it waitForLogin like AzureAccount.waitForLogin

return this.getAccount().filters.map<SubscriptionModels.Subscription>(filter => {
return {
id: filter.subscription.id,
session: filter.session,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you planning on using session (which isn't in SubscriptionModels.Subscription)?

Copy link
Author

Choose a reason for hiding this comment

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

Not really. GetFilteredSubscriptionList is a function that was already in the program, I just provided a centralized location for it. If its furthermore not in SubscriptionModels.Subscription I think we can safely remove it, thanks!

@StephenWeatherford
Copy link
Contributor

Sorry for the delay, see minor comments.

@estebanreyl
Copy link
Author

No worries, thanks for the comments! I've updated accordingly

@StephenWeatherford StephenWeatherford merged commit 069ed85 into microsoft:master Aug 6, 2018
@microsoft microsoft locked and limited conversation to collaborators Oct 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants