Skip to content

Commit 3ed4632

Browse files
committed
Merge branch 'preview' of https://github.com/Azure/azure-powershell into siteRecoveryChanges
2 parents e872698 + 3ea604f commit 3ed4632

File tree

31 files changed

+11093
-4099
lines changed

31 files changed

+11093
-4099
lines changed

src/ResourceManager/AnalysisServices/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Remove validate set of location into dynamic lookup so that all clouds are supported.
2122

2223
## Version 0.5.0
2324
* Fixed Synchronize-AzureAsInstance command to work with new AsAzure REST API for sync

src/ResourceManager/AnalysisServices/Commands.AnalysisServices/Commands/NewAzureRmAnalysisServicesServer.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ public class NewAnalysisServicesServer : AnalysisServicesCmdletBase
4141
[Parameter(ValueFromPipelineByPropertyName = true, Position = 2, Mandatory = true,
4242
HelpMessage = "Azure region where the server should be created.")]
4343
[ValidateNotNullOrEmpty]
44-
[ValidateSet("North Central US", "South Central US", "Central US", "West Europe", "North Europe", "West US",
45-
"East US",
46-
"East US 2", "Japan East", "Japan West", "Brazil South", "Southeast Asia", "East Asia", "Australia East",
47-
"Australia Southeast", IgnoreCase = true)]
44+
[LocationCompleter("Microsoft.AnalysisServices/servers")]
4845
public string Location { get; set; }
4946

5047
[Parameter(ValueFromPipelineByPropertyName = true, Position = 3, Mandatory = true,

src/ResourceManager/Network/Commands.Network/help/AzureRM.Network.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ Lists network usages for a subscription
239239
### [Get-AzureRmNetworkWatcher](Get-AzureRmNetworkWatcher.md)
240240
Gets the properties of a Network Watcher
241241

242+
### [Get-AzureRmNetworkWatcherReachabilityProvidersList](Get-AzureRmNetworkWatcherReachabilityProvidersList.md)
243+
Lists all available internet service providers for a specified Azure region
244+
245+
### [Get-AzureRMNetworkWatcherReachabilityReport](Get-AzureRMNetworkWatcherReachabilityReport.md)
246+
Gets the relative latency score for internet service providers from a specified location to Azure regions
247+
242248
### [Get-AzureRmNetworkWatcherFlowLogStatus](Get-AzureRmNetworkWatcherFlowLogStatus.md)
243249
Gets the status of flow logging on a resource.
244250

src/ResourceManager/Resources/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
## Current Release
2121
* Fixed issue where Get-AzureRMRoleAssignment would result in a assignments without roledefiniton name for custom roles
2222
- Users can now use Get-AzureRMRoleAssignment with assignments having roledefinition names irrespective of the type of role
23+
* Allow scopes to end with "/"
24+
- Users can now use RoleDefinition and RoleAssignment commandlets with scopes ending with "/" ,consistent with API and CLI
2325

2426
## Version 5.0.0
2527
* Add support for online help

src/ResourceManager/Resources/Commands.Resources.Test/RoleAssignment/RoleAssignmentUnitTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void VerifyInvalidScopes()
3333
scopeAndErrors.Add("test", "Scope 'test' should begin with '/subscriptions' or '/providers'.");
3434
scopeAndErrors.Add("/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/Should be 'ResourceGroups'/any group name", "Scope '/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/Should be 'ResourceGroups'/any group name' should begin with '/subscriptions/<subid>/resourceGroups'.");
3535
scopeAndErrors.Add("/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups", "Scope '/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups' should have even number of parts.");
36-
scopeAndErrors.Add("/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/", "Scope '/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/' should not have any empty part.");
36+
scopeAndErrors.Add("/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/", "Scope '/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups' should have even number of parts.");
3737
scopeAndErrors.Add("/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/groupname/Should be 'Providers'/any provider name", "Scope '/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/groupname/Should be 'Providers'/any provider name' should begin with '/subscriptions/<subid>/resourceGroups/<groupname>/providers'.");
3838
scopeAndErrors.Add("/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/groupname/Providers/providername", "Scope '/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/groupname/Providers/providername' should have at least one pair of resource type and resource name. e.g. '/subscriptions/<subid>/resourceGroups/<groupname>/providers/<providername>/<resourcetype>/<resourcename>'.");
3939
foreach (var kvp in scopeAndErrors)
@@ -52,6 +52,7 @@ public void VerifyValidScopes()
5252
validScopes.Add("/providers/providername");
5353
validScopes.Add("/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/groupname");
5454
validScopes.Add("/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/groupname/Providers/providername/type/typename");
55+
validScopes.Add("/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/groupname/Providers/providername/type/typename/");
5556

5657
foreach (var scope in validScopes)
5758
{

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/RoleAssignmentTests.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function Test-RaDeleteByPSRoleAssignment
7171
Assert-AreEqual 1 $users.Count "There should be at least one user to run the test."
7272

7373
# Test
74-
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleAssignmentNames.Enqueue("fa1a4d3b-2cca-406b-8956-6b6b32377641")
74+
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleAssignmentNames.Enqueue("f747531e-da33-43b9-b726-04675abf1939")
7575
$newAssignment = New-AzureRmRoleAssignment `
7676
-ObjectId $users[0].Id.Guid `
7777
-RoleDefinitionName $definitionName `
@@ -95,14 +95,15 @@ function Test-RaByScope
9595
$subscription = Get-AzureRmSubscription
9696
$resourceGroups = Get-AzureRmResourceGroup | Select-Object -Last 1 -Wait
9797
$scope = '/subscriptions/'+ $subscription[0].Id +'/resourceGroups/' + $resourceGroups[0].ResourceGroupName
98+
$assignmentScope = $scope +"/"
9899
Assert-AreEqual 1 $users.Count "There should be at least one user to run the test."
99100

100101
# Test
101102
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleAssignmentNames.Enqueue("f747531e-da33-43b9-b726-04675abf1939")
102103
$newAssignment = New-AzureRmRoleAssignment `
103104
-ObjectId $users[0].Id.Guid `
104105
-RoleDefinitionName $definitionName `
105-
-Scope $scope
106+
-Scope $assignmentScope
106107

107108
# cleanup
108109
DeleteRoleAssignment $newAssignment
@@ -208,7 +209,7 @@ function Test-RaValidateInputParameters ($cmdName)
208209
Assert-Throws { &$cmdName -Scope $scope -ObjectId $groups[0].Id.Guid -RoleDefinitionName $definitionName } $invalidScope
209210

210211
$scope = "/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/"
211-
$invalidScope = "Scope '/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/' should not have any empty part."
212+
$invalidScope = "Scope '/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups' should have even number of parts."
212213
Assert-Throws { &$cmdName -Scope $scope -ObjectId $groups[0].Id.Guid -RoleDefinitionName $definitionName } $invalidScope
213214

214215
$scope = "/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/groupname/Should be 'Providers'/any provider name"
@@ -220,7 +221,7 @@ function Test-RaValidateInputParameters ($cmdName)
220221
Assert-Throws { &$cmdName -Scope $scope -ObjectId $groups[0].Id.Guid -RoleDefinitionName $definitionName } $invalidScope
221222

222223
# Check if ResourceType is valid
223-
Assert-AreEqual $resource.ResourceType "Microsoft.ServiceBus/namespaces"
224+
Assert-AreEqual $resource.ResourceType "Microsoft.Web/sites"
224225
$subscription = Get-AzureRmSubscription | Select-Object -Last 1 -Wait
225226
# Below invalid resource type should not return 'Not supported api version'.
226227
$resource.ResourceType = "Microsoft.KeyVault/"
@@ -326,7 +327,7 @@ function Test-RaDeletionByScope
326327
Assert-AreEqual 1 $users.Count "There should be at least one user to run the test."
327328

328329
# Test
329-
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleAssignmentNames.Enqueue("fa1a4d3b-2cca-406b-8956-6b6b32377641")
330+
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleAssignmentNames.Enqueue("f747531e-da33-43b9-b726-04675abf1939")
330331
$newAssignment = New-AzureRmRoleAssignment `
331332
-ObjectId $users[0].Id.Guid `
332333
-RoleDefinitionName $definitionName `
@@ -360,7 +361,7 @@ function Test-RaDeletionByScopeAtRootScope
360361
Assert-AreEqual 1 $users.Count "There should be at least one user to run the test."
361362

362363
# Test
363-
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleAssignmentNames.Enqueue("fa1a4d3b-2cca-406b-8956-6b6b32377641")
364+
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleAssignmentNames.Enqueue("f747531e-da33-43b9-b726-04675abf1939")
364365
$newAssignment = New-AzureRmRoleAssignment `
365366
-ObjectId $users[0].Id.Guid `
366367
-RoleDefinitionName $definitionName `

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/RoleDefinitionTests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ function Test-RoleDefinitionCreateTests
3535
# Basic positive case - read from object
3636
$roleDef = Get-AzureRmRoleDefinition -Name "Reader"
3737
$roleDef.Id = $null
38-
$roleDef.Name = "Custom Reader"
38+
$roleDef.Name = "New Custom Reader"
3939
$roleDef.Actions.Add("Microsoft.ClassicCompute/virtualMachines/restart/action")
4040
$roleDef.Description = "Read, monitor and restart virtual machines"
4141
$roleDef.AssignableScopes[0] = "/subscriptions/4004a9fd-d58e-48dc-aeb2-4a4aec58606f"
4242

4343
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleDefinitionNames.Enqueue("032F61D2-ED09-40C9-8657-26A273DA7BAE")
4444
New-AzureRmRoleDefinition -Role $roleDef
45-
$addedRoleDef = Get-AzureRmRoleDefinition -Name "Custom Reader"
45+
$addedRoleDef = Get-AzureRmRoleDefinition -Name "New Custom Reader"
4646

4747
Assert-NotNull $addedRoleDef.Actions
4848
Assert-AreEqual $roleDef.Description $addedRoleDef.Description
@@ -292,7 +292,7 @@ function Test-RdValidateInputParameters ($cmdName)
292292
Assert-Throws { &$cmdName -Scope $scope -Id D46245F8-7E18-4499-8E1F-784A6DA5BE25} $invalidScope
293293

294294
$scope = "/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/"
295-
$invalidScope = "Scope '/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/' should not have any empty part."
295+
$invalidScope = "Scope '/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups' should have even number of parts."
296296
Assert-Throws { &$cmdName -Scope $scope -Id D46245F8-7E18-4499-8E1F-784A6DA5BE25} $invalidScope
297297

298298
$scope = "/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/groupname/Should be 'Providers'/any provider name"
@@ -331,7 +331,7 @@ function Test-RdValidateInputParameters2 ($cmdName)
331331
Assert-Throws { &$cmdName -Role $roleDef } $invalidScope
332332

333333
$scope = "/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/"
334-
$invalidScope = "Scope '/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups/' should not have any empty part."
334+
$invalidScope = "Scope '/subscriptions/e9ee799d-6ab2-4084-b952-e7c86344bbab/ResourceGroups' should have even number of parts."
335335
$roleDef.AssignableScopes[0] = $scope;
336336
Assert-Throws { &$cmdName -Role $roleDef } $invalidScope
337337

src/ResourceManager/Resources/Commands.Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaByResource.json

Lines changed: 983 additions & 327 deletions
Large diffs are not rendered by default.

src/ResourceManager/Resources/Commands.Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaByResourceGroup.json

Lines changed: 1195 additions & 369 deletions
Large diffs are not rendered by default.

src/ResourceManager/Resources/Commands.Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaByScope.json

Lines changed: 1246 additions & 420 deletions
Large diffs are not rendered by default.

src/ResourceManager/Resources/Commands.Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaByServicePrincipal.json

Lines changed: 193 additions & 193 deletions
Large diffs are not rendered by default.

src/ResourceManager/Resources/Commands.Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaByUpn.json

Lines changed: 1210 additions & 384 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)