-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
Hi @TianoMS, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution! TTYL, AZPRBOT; |
Can one of the admins verify this patch? |
@TianoMS Please either sign the CLA or join the org if you are Microsoft internal (http://aka.ms/azuregithub) |
@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? |
On demand job here: http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-demand/696/ |
LGTM! Thanks @TianoMS |
@azuresdkci add to whitelist |
#> | ||
function Test-AzureLocation | ||
{ | ||
$providerLocations = Get-AzureRmLocation |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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).
The new job on demand: http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-demand/698/ |
The latest on demand job: http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-demand/699/ |
No description provided.