Skip to content

Create Get-AzureRmLocation Cmdlet #2142

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

Merged
merged 5 commits into from
Apr 26, 2016
Merged

Create Get-AzureRmLocation Cmdlet #2142

merged 5 commits into from
Apr 26, 2016

Conversation

TianoMS
Copy link

@TianoMS TianoMS commented Apr 25, 2016

No description provided.

@azurecla
Copy link

Hi @TianoMS, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.azure.com.

TTYL, AZPRBOT;

@azuresdkci
Copy link

Can one of the admins verify this patch?

@markcowl
Copy link
Member

@TianoMS Please either sign the CLA or join the org if you are Microsoft internal (http://aka.ms/azuregithub)

@TianoMS
Copy link
Author

TianoMS commented Apr 25, 2016

@markcowl I've already joined the Azure organization with this link: http://aka.ms/azuregithub. Do you know why I still get the "cla-required" label?

@TianoMS
Copy link
Author

TianoMS commented Apr 25, 2016

@vivsriaus
Copy link
Contributor

LGTM! Thanks @TianoMS

@markcowl
Copy link
Member

@azuresdkci add to whitelist

#>
function Test-AzureLocation
{
$providerLocations = Get-AzureRmLocation
Copy link
Member

Choose a reason for hiding this comment

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

@TianoMS This test can only be executed against the production AzureCloud endpoint. It will fail if executed against a test endpoint or the AzureChinaCloud, AzureUSGovernment, or AzureGermanCloud endpoints. Please simply test that there is a non-empty list of locations and that each of the properties for each location have the appropriate properties.

Copy link
Author

Choose a reason for hiding this comment

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

Will fix it.

@@ -76,7 +81,8 @@ public ResourcesClient(AzureContext context)
: this(
AzureSession.ClientFactory.CreateClient<ResourceManagementClient>(context, AzureEnvironment.Endpoint.ResourceManager),
new GalleryTemplatesClient(context),
AzureSession.ClientFactory.CreateClient<AuthorizationManagementClient>(context, AzureEnvironment.Endpoint.ResourceManager))
AzureSession.ClientFactory.CreateClient<AuthorizationManagementClient>(context, AzureEnvironment.Endpoint.ResourceManager),
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed the on-demand failures because of this (bundling subscriptionClient with ResourcesClient). Let's not do this anymore. The bundling of other clients with ResourceManagementClient (like the gallery client) has been known to cause issues for us in the past (for instance, when running our cmdlets in a non prod environment, where gallery service may not necessarily be available).

Let's create a separate SubscriptionClient class, instantiate it like below (ClientFactory.CreateClient<>()) and use it in the location cmdlet. This will also ensure that you won't have to fix the failing tests in the on-demand job (and you shouldn't, since there is no need to create one for those who don't call the subscriptions api).

@TianoMS
Copy link
Author

TianoMS commented Apr 26, 2016

@TianoMS
Copy link
Author

TianoMS commented Apr 26, 2016

@hovsepm hovsepm merged commit 87985a2 into Azure:dev Apr 26, 2016
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.

6 participants