Skip to content

Commit 7235a52

Browse files
Merge remote-tracking branch 'vinaya/pstestfail' into record-2017-11-01
2 parents e44a46e + 8334ee2 commit 7235a52

File tree

162 files changed

+563697
-1411453
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+563697
-1411453
lines changed

documentation/Using-Azure-TestFramework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ To use this option, set the following environment variable before starting Visua
144144

145145
## Record or Playback Tests
146146

147-
1. Run the test and make sure that you got a generated .json file that matches the test name in the bin folder under *SessionRecords folder
147+
1. [Run the test](https://github.com/Azure/azure-powershell/wiki/Azure-Powershell-Developer-Guide#running-tests) and make sure that you got a generated .json file that matches the test name in the bin folder under *SessionRecords folder
148148
2. Copy SessionRecords folder inside the test project and add all *.json files in Visual Studio setting "Copy to Output Directory" property to "Copy if newer"
149149
3. To assure that the records work fine, delete the connection string (default mode is Playback mode) OR change HttpRecorderMode within the connection string to "Playback"
150150

documentation/azure-powershell-modules.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Below is a table of modules containing ARM cmdlets found in the [`AzureRM`](http
1717
| ------------------------------------- | --------------------------------------- | ----------------------- |
1818
| Analysis Services | `AzureRM.AnalysisServices` | [![Analysis Services](https://img.shields.io/powershellgallery/v/AzureRM.AnalysisServices.svg?style=flat-square&label=AzureRM.AnalysisServices)](https://www.powershellgallery.com/packages/AzureRM.AnalysisServices/) |
1919
| API Management | `AzureRM.ApiManagement` | [![API Management](https://img.shields.io/powershellgallery/v/AzureRM.ApiManagement.svg?style=flat-square&label=AzureRM.ApiManagement)](https://www.powershellgallery.com/packages/AzureRM.ApiManagement/) |
20+
| Application Insights | `AzureRM.ApplicationInsights` | [![Application Insights](https://img.shields.io/powershellgallery/v/AzureRM.ApplicationInsights.svg?style=flat-square&label=AzureRM.ApplicationInsights)](https://www.powershellgallery.com/packages/AzureRM.ApplicationInsights/) |
2021
| Automation | `AzureRM.Automation` | [![Automation](https://img.shields.io/powershellgallery/v/AzureRM.Automation.svg?style=flat-square&label=AzureRM.Automation)](https://www.powershellgallery.com/packages/AzureRM.Automation/) |
2122
| Backup | `AzureRM.Backup` | [![Backup](https://img.shields.io/powershellgallery/v/AzureRM.Backup.svg?style=flat-square&label=AzureRM.Backup)](https://www.powershellgallery.com/packages/AzureRM.Backup/)
2223
| Batch | `AzureRM.Batch` | [![Batch](https://img.shields.io/powershellgallery/v/AzureRM.Batch.svg?style=flat-square&label=AzureRM.Batch)](https://www.powershellgallery.com/packages/AzureRM.Batch/) |
@@ -31,6 +32,7 @@ Below is a table of modules containing ARM cmdlets found in the [`AzureRM`](http
3132
| Data Factory V2 | `AzureRM.DataFactoryV2` | [![Data Factory V2](https://img.shields.io/powershellgallery/v/AzureRM.DataFactoryV2.svg?style=flat-square&label=AzureRM.DataFactoryV2)](https://www.powershellgallery.com/packages/AzureRM.DataFactoryV2/) |
3233
| Data Lake Analytics | `AzureRM.DataLakeAnalytics` | [![Data Lake Analytics](https://img.shields.io/powershellgallery/v/AzureRM.DataLakeAnalytics.svg?style=flat-square&label=AzureRM.DataLakeAnalytics)](https://www.powershellgallery.com/packages/AzureRM.DataLakeAnalytics/) |
3334
| Data Lake Store | `AzureRM.DataLakeStore` | [![Data Lake Store](https://img.shields.io/powershellgallery/v/AzureRM.DataLakeStore.svg?style=flat-square&label=AzureRM.DataLakeStore)](https://www.powershellgallery.com/packages/AzureRM.DataLakeStore/) |
35+
| Data Migration | `AzureRM.DataMigration` | [![Data Migration](https://img.shields.io/powershellgallery/v/AzureRM.DataMigration.svg?style=flat-square&label=AzureRM.DataMigration)](https://www.powershellgallery.com/packages/AzureRM.DataMigration/) |
3436
| DevTest Labs | `AzureRM.DevTestLabs` | [![DevTest Labs](https://img.shields.io/powershellgallery/v/AzureRM.DevTestLabs.svg?style=flat-square&label=AzureRM.DevTestLabs)](https://www.powershellgallery.com/packages/AzureRM.DevTestLabs/) |
3537
| DNS | `AzureRM.Dns` | [![DNS](https://img.shields.io/powershellgallery/v/AzureRM.Dns.svg?style=flat-square&label=AzureRM.Dns)](https://www.powershellgallery.com/packages/AzureRM.Dns/) |
3638
| Event Grid | `AzureRM.EventGrid` | [![Event Grid](https://img.shields.io/powershellgallery/v/AzureRM.EventGrid.svg?style=flat-square&label=AzureRM.EventGrid)](https://www.powershellgallery.com/packages/AzureRM.EventGrid/) |
@@ -54,6 +56,7 @@ Below is a table of modules containing ARM cmdlets found in the [`AzureRM`](http
5456
| Recovery Services - Site Recovery | `AzureRM.RecoveryServices.SiteRecovery` | [![Recovery Services - Site Recovery](https://img.shields.io/powershellgallery/v/AzureRM.RecoveryServices.SiteRecovery.svg?style=flat-square&label=AzureRM.RecoveryServices.SiteRecovery)](https://www.powershellgallery.com/packages/AzureRM.RecoveryServices.SiteRecovery/) |
5557
| Redis Cache | `AzureRM.RedisCache` | [![Redis Cache](https://img.shields.io/powershellgallery/v/AzureRM.RedisCache.svg?style=flat-square&label=AzureRM.RedisCache)](https://www.powershellgallery.com/packages/AzureRM.RedisCache/) |
5658
| Relay | `AzureRM.Relay` | [![Relay](https://img.shields.io/powershellgallery/v/AzureRM.Relay.svg?style=flat-square&label=AzureRM.Relay)](https://www.powershellgallery.com/packages/AzureRM.Relay/) |
59+
| Reservations | `AzureRM.Reservations` | [![Reservations](https://img.shields.io/powershellgallery/v/AzureRM.Reservations.svg?style=flat-square&label=AzureRM.Reservations)](https://www.powershellgallery.com/packages/AzureRM.Reservations/) |
5760
| Resources | `AzureRM.Resources` | [![Resources](https://img.shields.io/powershellgallery/v/AzureRM.Resources.svg?style=flat-square&label=AzureRM.Resources)](https://www.powershellgallery.com/packages/AzureRM.Resources/) |
5861
| Scheduler | `AzureRM.Scheduler` | [![Scheduler](https://img.shields.io/powershellgallery/v/AzureRM.Scheduler.svg?style=flat-square&label=AzureRM.Scheduler)](https://www.powershellgallery.com/packages/AzureRM.Scheduler/) |
5962
| Server Management | `AzureRM.ServerManagement` | [![Server Management](https://img.shields.io/powershellgallery/v/AzureRM.ServerManagement.svg?style=flat-square&label=AzureRM.ServerManagement)](https://www.powershellgallery.com/packages/AzureRM.ServerManagement/) |

src/ResourceManager/AnalysisServices/AnalysisServices.sln

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.
2626
EndProject
2727
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authentication.ResourceManager", "..\Common\Commands.Common.Authentication.ResourceManager\Commands.Common.Authentication.ResourceManager.csproj", "{69C2EB6B-CD63-480A-89A0-C489706E9299}"
2828
EndProject
29+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authorization", "..\..\Common\Commands.Common.Authorization\Commands.Common.Authorization.csproj", "{24508E26-154D-47F1-80EE-439BF0710996}"
30+
EndProject
31+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Graph.RBAC", "..\..\Common\Commands.Common.Graph.RBAC\Commands.Common.Graph.RBAC.csproj", "{269ACF73-0A34-42DC-AB9C-4B15931A489D}"
32+
EndProject
33+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Network", "..\..\Common\Commands.Common.Network\Commands.Common.Network.csproj", "{1338F7AE-7111-4ED3-8916-2D0FECC876F4}"
34+
EndProject
35+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Storage", "..\..\Common\Commands.Common.Storage\Commands.Common.Storage.csproj", "{65C3A86A-716D-4E7D-AB67-1DB00B3BF72D}"
36+
EndProject
2937
Global
3038
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3139
Debug|Any CPU = Debug|Any CPU
@@ -76,6 +84,22 @@ Global
7684
{69C2EB6B-CD63-480A-89A0-C489706E9299}.Debug|Any CPU.Build.0 = Debug|Any CPU
7785
{69C2EB6B-CD63-480A-89A0-C489706E9299}.Release|Any CPU.ActiveCfg = Release|Any CPU
7886
{69C2EB6B-CD63-480A-89A0-C489706E9299}.Release|Any CPU.Build.0 = Release|Any CPU
87+
{24508E26-154D-47F1-80EE-439BF0710996}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
88+
{24508E26-154D-47F1-80EE-439BF0710996}.Debug|Any CPU.Build.0 = Debug|Any CPU
89+
{24508E26-154D-47F1-80EE-439BF0710996}.Release|Any CPU.ActiveCfg = Release|Any CPU
90+
{24508E26-154D-47F1-80EE-439BF0710996}.Release|Any CPU.Build.0 = Release|Any CPU
91+
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
92+
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.Debug|Any CPU.Build.0 = Debug|Any CPU
93+
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.Release|Any CPU.ActiveCfg = Release|Any CPU
94+
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.Release|Any CPU.Build.0 = Release|Any CPU
95+
{1338F7AE-7111-4ED3-8916-2D0FECC876F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
96+
{1338F7AE-7111-4ED3-8916-2D0FECC876F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
97+
{1338F7AE-7111-4ED3-8916-2D0FECC876F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
98+
{1338F7AE-7111-4ED3-8916-2D0FECC876F4}.Release|Any CPU.Build.0 = Release|Any CPU
99+
{65C3A86A-716D-4E7D-AB67-1DB00B3BF72D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
100+
{65C3A86A-716D-4E7D-AB67-1DB00B3BF72D}.Debug|Any CPU.Build.0 = Debug|Any CPU
101+
{65C3A86A-716D-4E7D-AB67-1DB00B3BF72D}.Release|Any CPU.ActiveCfg = Release|Any CPU
102+
{65C3A86A-716D-4E7D-AB67-1DB00B3BF72D}.Release|Any CPU.Build.0 = Release|Any CPU
79103
EndGlobalSection
80104
GlobalSection(SolutionProperties) = preSolution
81105
HideSolutionNode = FALSE

src/ResourceManager/Common/Commands.Common.Strategies/NestedResourceConfig.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public sealed class NestedResourceConfig<TModel, TParenModel> : IEntityConfig<TM
3636
/// </summary>
3737
public IEntityConfig<TParenModel> Parent { get; }
3838

39-
public Func<TModel> CreateModel { get; }
39+
public Func<string, TModel> CreateModel { get; }
4040

4141
public IResourceConfig Resource => Parent.Resource;
4242

@@ -46,7 +46,7 @@ public NestedResourceConfig(
4646
NestedResourceStrategy<TModel, TParenModel> strategy,
4747
IEntityConfig<TParenModel> parent,
4848
string name,
49-
Func<TModel> createModel)
49+
Func<string, TModel> createModel)
5050
{
5151
Strategy = strategy;
5252
Name = name;

src/ResourceManager/Common/Commands.Common.Strategies/NestedResourceConfigExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static NestedResourceConfig<TModel, TParenModel> CreateConfig<TModel, TPa
2222
this NestedResourceStrategy<TModel, TParenModel> strategy,
2323
IEntityConfig<TParenModel> parent,
2424
string name,
25-
Func<TModel> createModel)
25+
Func<string, TModel> createModel)
2626
where TModel : class
2727
where TParenModel : class
2828
=> new NestedResourceConfig<TModel, TParenModel>(strategy, parent, name, createModel);

src/ResourceManager/Common/Commands.Common.Strategies/NestedResourceStrategy.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
using System;
1616
using System.Collections.Generic;
17+
using System.Linq;
1718

1819
namespace Microsoft.Azure.Commands.Common.Strategies
1920
{
@@ -48,5 +49,37 @@ public static NestedResourceStrategy<TModel, TParentModel> Create<TModel, TParen
4849
name => new[] { provider, name},
4950
get,
5051
createOrUpdate);
52+
53+
public static NestedResourceStrategy<TModel, TParentModel> Create<TModel, TParentModel>(
54+
string provider,
55+
Func<TParentModel, IList<TModel>> getList,
56+
Action<TParentModel, IList<TModel>> setList,
57+
Func<TModel, string> getName,
58+
Action<TModel, string> setName)
59+
where TModel : class
60+
where TParentModel : class
61+
=> Create<TModel, TParentModel>(
62+
provider,
63+
(parentModel, name) => getList(parentModel)?.FirstOrDefault(model => getName(model) == name),
64+
(parentModel, name, model) =>
65+
{
66+
setName(model, name);
67+
var list = getList(parentModel);
68+
if (list == null)
69+
{
70+
list = new List<TModel> { model };
71+
setList(parentModel, list);
72+
return;
73+
}
74+
var modelAndIndex = list
75+
.Select((m, i) => new { m, i })
76+
.FirstOrDefault(mi => getName(mi.m) == name);
77+
if (modelAndIndex != null)
78+
{
79+
list[modelAndIndex.i] = model;
80+
return;
81+
}
82+
list.Add(model);
83+
});
5184
}
5285
}

src/ResourceManager/Common/Commands.Common.Strategies/TargetStateExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ sealed class Context
4545

4646
public string Location { get; }
4747

48-
public Context(IState current, string subscription, string location)
48+
public Context(IState current, string subscriptionId, string location)
4949
{
5050
Current = current;
51-
Subscription = subscription;
51+
Subscription = subscriptionId;
5252
Location = location;
5353
}
5454

@@ -84,7 +84,7 @@ public TModel GetOrAdd<TModel, TParentModel>(
8484
var model = config.Strategy.Get(parentModel, config.Name);
8585
if (model == null)
8686
{
87-
model = config.CreateModel();
87+
model = config.CreateModel(Subscription);
8888
config.Strategy.CreateOrUpdate(parentModel, config.Name, model);
8989
}
9090
return model;

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/AzureRM.Storage.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,13 @@ function Get-AzureRmStorageAccountKey
132132
$version = $client.GetType().Assembly.GetName().Version
133133
}
134134
PROCESS {
135-
if ($version.Major -gt 3)
135+
if ($version.Major -gt 5)
136+
{
137+
$getTask = $client.StorageAccounts.ListKeysWithHttpMessagesAsync($ResourceGroupName, $name, $null, [System.Threading.CancellationToken]::None)
138+
$result = $getTask.GetAwaiter().GetResult()
139+
Write-Output $result.Body.Keys
140+
}
141+
elseif ($version.Major -gt 3)
136142
{
137143
$getTask = $client.StorageAccounts.ListKeysWithHttpMessagesAsync($ResourceGroupName, $name, $null, [System.Threading.CancellationToken]::None)
138144
$result = $getTask.GetAwaiter().GetResult()

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Mocks/MockClientFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public TClient CreateCustomArmClient<TClient>(params object[] parameters) where
255255
}
256256
}
257257

258-
if (TestMockSupport.RunningMocked)
258+
if (TestMockSupport.RunningMocked && HttpMockServer.GetCurrentMode() != HttpRecorderMode.Record)
259259
{
260260
IAzureClient azureClient = client as IAzureClient;
261261
if (azureClient != null)

src/ResourceManager/Compute/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+
* Added simplified parameter set to New-AzureRmVmss, which creates a Virtual Machine Scale Set and all required resources using smart defaults
2122
* Added Location Completer to -Location parameters allowing tab completion through valid Locations
2223
* Added ResourceGroup Completer to -ResourceGroup parameters allowing tab completion through resource groups in current subscription
2324
* Obsoleted -Tags in favor of -Tag for New-AzureRmVm and Update-AzureRmVm

0 commit comments

Comments
 (0)