Skip to content

Commit 8bf6e2a

Browse files
authored
Merge pull request #11080 from wastoresh/pitr
[Storage] Support Point in Time Restore
2 parents f5c64cd + ab5d851 commit 8bf6e2a

File tree

105 files changed

+14789
-2543
lines changed

Some content is hidden

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

105 files changed

+14789
-2543
lines changed

documentation/development-docs/help-generation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Install-Module -Name platyPS -Scope CurrentUser
1717
**Note:** this module will need to be installed from the [PowerShell Gallery](http://www.powershellgallery.com/). If, for some reason, this isn't a registered repository when running the `Get-PSRepository` cmdlet, then you will need to register it by running the following command:
1818

1919
```powershell
20-
Register-PSRepository -Name PSGallery -SourceLocation https://www.powershellgallery.com/api/v2/
20+
Register-PSRepository -Default -InstallationPolicy Trusted
2121
```
2222

2323
## Using `platyPS`

src/Accounts/Accounts/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
## Upcoming Release
21+
* Added SubscriptionId, TenantId, and execution time into data of client side telemetry
2122

2223
## Version 1.7.1
2324
* Disable context auto saving when AzureRmContext.json not available

src/CognitiveServices/CognitiveServices.Test/CognitiveServices.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<PsModuleName>CognitiveServices</PsModuleName>
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Azure.Management.CognitiveServices" Version="6.0.0-preview" />
14+
<PackageReference Include="Microsoft.Azure.Management.CognitiveServices" Version="7.0.0-preview" />
1515
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.18.0-preview" />
1616
</ItemGroup>
1717

src/CognitiveServices/CognitiveServices.Test/ScenarioTests/CognitiveServicesAccountTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ public void TestGetAccounts()
8484
{
8585
TestController.NewInstance.RunPsTest(traceInterceptor, "Test-GetAzureCognitiveServiceAccount");
8686
}
87+
88+
[Fact]
89+
[Trait(Category.AcceptanceType, Category.CheckIn)]
90+
public void TestAsyncAccountOperations()
91+
{
92+
TestController.NewInstance.RunPsTest(traceInterceptor, "Test-AsyncAccountOperations");
93+
}
94+
8795
[Fact]
8896
[Trait(Category.AcceptanceType, Category.CheckIn)]
8997
public void TestSetAccount()

src/CognitiveServices/CognitiveServices.Test/ScenarioTests/CognitiveServicesAccountTests.ps1

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,36 @@ function Test-NewAzureRmAllKindsOfCognitiveServicesAccounts
114114
}
115115
}
116116

117+
118+
<#
119+
.SYNOPSIS
120+
Test AsyncAccountOperations
121+
#>
122+
function Test-AsyncAccountOperations
123+
{
124+
# Setup
125+
$rgname = Get-CognitiveServicesManagementTestResourceName;
126+
127+
try
128+
{
129+
# Test
130+
$accountname = 'csa' + $rgname;
131+
$skuname = 'S0';
132+
$accounttype = 'Personalizer';
133+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US 2";
134+
135+
New-AzResourceGroup -Name $rgname -Location $loc;
136+
137+
$createdAccount = New-AzCognitiveServicesAccount -ResourceGroupName $rgname -Name $accountname -Type $accounttype -SkuName $skuname -Location $loc -Force;
138+
Remove-AzCognitiveServicesAccount -ResourceGroupName $rgname -Name $accountname -Force;
139+
}
140+
finally
141+
{
142+
# Cleanup
143+
Clean-ResourceGroup $rgname
144+
}
145+
}
146+
117147
<#
118148
.SYNOPSIS
119149
Test Remove-AzCognitiveServicesAccount

src/CognitiveServices/CognitiveServices.Test/SessionRecords/CognitiveServices.Test.ScenarioTests.CognitiveServicesAccountTests/TestAsyncAccountOperations.json

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

src/CognitiveServices/CognitiveServices/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Update SDK to 7.0
22+
* Improve error message when server responses empty body
2123

2224
## Version 1.2.2
2325
* Update references in .psd1 to use relative path

src/CognitiveServices/CognitiveServices/CognitiveServices.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Azure.Management.CognitiveServices" Version="6.0.0-preview" />
14+
<PackageReference Include="Microsoft.Azure.Management.CognitiveServices" Version="7.0.0-preview" />
1515
</ItemGroup>
1616

1717
</Project>

src/CognitiveServices/CognitiveServices/CognitiveServicesAccount/AddAzureCognitiveServicesAccountNetworkRule.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public override void ExecuteCmdlet()
9999
var account = this.CognitiveServicesClient.Accounts.GetProperties(
100100
this.ResourceGroupName,
101101
this.Name);
102-
NetworkRuleSet accountACL = account.NetworkAcls;
102+
NetworkRuleSet accountACL = account.Properties.NetworkAcls;
103103

104104
if (accountACL == null)
105105
{
@@ -156,21 +156,28 @@ public override void ExecuteCmdlet()
156156
break;
157157
}
158158

159-
var properties = new JObject();
160-
properties["networkAcls"] = JToken.FromObject(accountACL);
161-
this.CognitiveServicesClient.Accounts.Update(this.ResourceGroupName, this.Name, null, null, properties);
159+
var properties = new CognitiveServicesAccountProperties();
160+
properties.NetworkAcls = accountACL;
161+
this.CognitiveServicesClient.Accounts.Update(
162+
this.ResourceGroupName,
163+
this.Name,
164+
new CognitiveServicesAccount()
165+
{
166+
Properties = properties
167+
}
168+
);
162169

163170
account = this.CognitiveServicesClient.Accounts.GetProperties(this.ResourceGroupName, this.Name);
164171

165172
switch (ParameterSetName)
166173
{
167174
case NetWorkRuleStringParameterSet:
168175
case NetworkRuleObjectParameterSet:
169-
WriteObject(PSNetworkRuleSet.Create(account.NetworkAcls).VirtualNetworkRules);
176+
WriteObject(PSNetworkRuleSet.Create(account.Properties.NetworkAcls).VirtualNetworkRules);
170177
break;
171178
case IpRuleStringParameterSet:
172179
case IpRuleObjectParameterSet:
173-
WriteObject(PSNetworkRuleSet.Create(account.NetworkAcls).IpRules);
180+
WriteObject(PSNetworkRuleSet.Create(account.Properties.NetworkAcls).IpRules);
174181
break;
175182
}
176183
}

src/CognitiveServices/CognitiveServices/CognitiveServicesAccount/CognitiveServicesAccountBaseCmdlet.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ protected void RunCmdLet(Action action)
8484
}
8585
catch (ErrorException ex)
8686
{
87+
if (ex.Body == null)
88+
{
89+
throw new PSInvalidOperationException(ex.Message, ex);
90+
}
91+
8792
throw new PSInvalidOperationException(ex.Body.ErrorProperty.Message, ex);
8893
}
8994
}

src/CognitiveServices/CognitiveServices/CognitiveServicesAccount/GetAzureCognitiveServicesAccountNetworkRuleSet.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public override void ExecuteCmdlet()
4848
this.ResourceGroupName,
4949
this.Name);
5050

51-
if (account != null && account.NetworkAcls != null)
51+
if (account != null && account.Properties.NetworkAcls != null)
5252
{
53-
WriteObject(PSNetworkRuleSet.Create(account.NetworkAcls));
53+
WriteObject(PSNetworkRuleSet.Create(account.Properties.NetworkAcls));
5454
}
5555
}
5656
}

src/CognitiveServices/CognitiveServices/CognitiveServicesAccount/NewAzureCognitiveServicesAccount.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,21 +110,21 @@ public override void ExecuteCmdlet()
110110

111111
RunCmdLet(() =>
112112
{
113-
var properties = new JObject();
113+
var properties = new CognitiveServicesAccountProperties();
114114
if (!string.IsNullOrWhiteSpace(CustomSubdomainName))
115115
{
116-
properties["customSubDomainName"] = CustomSubdomainName;
116+
properties.CustomSubDomainName = CustomSubdomainName;
117117
}
118118
if (NetworkRuleSet != null)
119119
{
120-
properties["networkAcls"] = JToken.FromObject(NetworkRuleSet);
120+
properties.NetworkAcls = NetworkRuleSet.ToNetworkRuleSet();
121121
}
122122

123-
CognitiveServicesAccountCreateParameters createParameters = new CognitiveServicesAccountCreateParameters()
123+
CognitiveServicesAccount createParameters = new CognitiveServicesAccount()
124124
{
125125
Location = Location,
126126
Kind = Type, // must have value, mandatory parameter
127-
Sku = new Sku(SkuName),
127+
Sku = new Sku(SkuName, null),
128128
Tags = TagsConversionHelper.CreateTagDictionary(Tag),
129129
Properties = properties
130130
};

src/CognitiveServices/CognitiveServices/CognitiveServicesAccount/RemoveAzureCognitiveServicesAccountNetworkRule.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public override void ExecuteCmdlet()
102102
var account = this.CognitiveServicesClient.Accounts.GetProperties(
103103
this.ResourceGroupName,
104104
this.Name);
105-
NetworkRuleSet accountACL = account.NetworkAcls;
105+
NetworkRuleSet accountACL = account.Properties.NetworkAcls;
106106

107107
if (accountACL == null)
108108
{
@@ -152,21 +152,28 @@ public override void ExecuteCmdlet()
152152
}
153153

154154

155-
var properties = new JObject();
156-
properties["networkAcls"] = JToken.FromObject(accountACL);
157-
this.CognitiveServicesClient.Accounts.Update(this.ResourceGroupName, this.Name, null, null, properties);
155+
var properties = new CognitiveServicesAccountProperties();
156+
properties.NetworkAcls = accountACL;
157+
this.CognitiveServicesClient.Accounts.Update(
158+
this.ResourceGroupName,
159+
this.Name,
160+
new CognitiveServicesAccount()
161+
{
162+
Properties = properties
163+
}
164+
);
158165

159166
account = this.CognitiveServicesClient.Accounts.GetProperties(this.ResourceGroupName, this.Name);
160167

161168
switch (ParameterSetName)
162169
{
163170
case NetWorkRuleStringParameterSet:
164171
case NetworkRuleObjectParameterSet:
165-
WriteObject(PSNetworkRuleSet.Create(account.NetworkAcls).VirtualNetworkRules);
172+
WriteObject(PSNetworkRuleSet.Create(account.Properties.NetworkAcls).VirtualNetworkRules);
166173
break;
167174
case IpRuleStringParameterSet:
168175
case IpRuleObjectParameterSet:
169-
WriteObject(PSNetworkRuleSet.Create(account.NetworkAcls).IpRules);
176+
WriteObject(PSNetworkRuleSet.Create(account.Properties.NetworkAcls).IpRules);
170177
break;
171178
}
172179
}

src/CognitiveServices/CognitiveServices/CognitiveServicesAccount/SetAzureCognitiveServicesAccount.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ public override void ExecuteCmdlet()
8989
base.ExecuteCmdlet();
9090

9191
bool hasPropertiesChange = false;
92-
var properties = new JObject();
92+
var properties = new CognitiveServicesAccountProperties();
9393
if (!string.IsNullOrWhiteSpace(CustomSubdomainName))
9494
{
9595
hasPropertiesChange = true;
96-
properties["customSubDomainName"] = CustomSubdomainName;
96+
properties.CustomSubDomainName = CustomSubdomainName;
9797
}
9898
if (NetworkRuleSet != null)
9999
{
100100
hasPropertiesChange = true;
101-
properties["networkAcls"] = JToken.FromObject(NetworkRuleSet);
101+
properties.NetworkAcls = NetworkRuleSet.ToNetworkRuleSet();
102102
}
103103

104104
Sku sku = null;
@@ -152,9 +152,13 @@ public override void ExecuteCmdlet()
152152
var updatedAccount = this.CognitiveServicesClient.Accounts.Update(
153153
this.ResourceGroupName,
154154
this.Name,
155-
sku,
156-
tags,
157-
properties);
155+
new CognitiveServicesAccount()
156+
{
157+
Sku = sku,
158+
Tags = tags,
159+
Properties = properties
160+
}
161+
);
158162

159163
WriteCognitiveServicesAccount(updatedAccount);
160164
});

src/CognitiveServices/CognitiveServices/CognitiveServicesAccount/UpdateAzureCognitiveServicesAccountNetworkRuleSet.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public override void ExecuteCmdlet()
114114
var account = this.CognitiveServicesClient.Accounts.GetProperties(
115115
this.ResourceGroupName,
116116
this.Name);
117-
NetworkRuleSet accountACL = account.NetworkAcls;
117+
NetworkRuleSet accountACL = account.Properties.NetworkAcls;
118118

119119
if (accountACL == null)
120120
{
@@ -138,13 +138,20 @@ public override void ExecuteCmdlet()
138138
psNetworkRule.DefaultAction = defaultAction.Value;
139139
}
140140

141-
var properties = new JObject();
142-
properties["networkAcls"] = JToken.FromObject(psNetworkRule.ToNetworkRuleSet());
143-
this.CognitiveServicesClient.Accounts.Update(this.ResourceGroupName, this.Name, null, null, properties);
141+
var properties = new CognitiveServicesAccountProperties();
142+
properties.NetworkAcls = psNetworkRule.ToNetworkRuleSet();
143+
this.CognitiveServicesClient.Accounts.Update(
144+
this.ResourceGroupName,
145+
this.Name,
146+
new CognitiveServicesAccount()
147+
{
148+
Properties = properties
149+
}
150+
);
144151

145152
account = this.CognitiveServicesClient.Accounts.GetProperties(this.ResourceGroupName, this.Name);
146153

147-
WriteObject(PSNetworkRuleSet.Create(account.NetworkAcls));
154+
WriteObject(PSNetworkRuleSet.Create(account.Properties.NetworkAcls));
148155
}
149156
}
150157
}

src/CognitiveServices/CognitiveServices/Models/PSCognitiveServicesAccount.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ public PSCognitiveServicesAccount(CognitiveServicesModels.CognitiveServicesAccou
2727
this.ResourceGroupName = ParseResourceGroupFromId(cognitiveServicesAccount.Id);
2828
this.AccountName = cognitiveServicesAccount.Name;
2929
this.Id = cognitiveServicesAccount.Id;
30-
this.Endpoint = cognitiveServicesAccount.Endpoint;
30+
this.Endpoint = cognitiveServicesAccount.Properties.Endpoint;
3131
this.Location = cognitiveServicesAccount.Location;
3232
this.Sku = cognitiveServicesAccount.Sku;
3333
this.AccountType = cognitiveServicesAccount.Kind;
3434
this.Etag = cognitiveServicesAccount.Etag;
3535
this.ResourceType = cognitiveServicesAccount.Type;
36-
this.ProvisioningState = cognitiveServicesAccount.ProvisioningState;
36+
this.ProvisioningState = cognitiveServicesAccount.Properties.ProvisioningState;
3737
this.Tags = cognitiveServicesAccount.Tags;
38-
this.CustomSubDomainName = cognitiveServicesAccount.CustomSubDomainName;
38+
this.CustomSubDomainName = cognitiveServicesAccount.Properties.CustomSubDomainName;
3939

40-
if (cognitiveServicesAccount.NetworkAcls != null)
40+
if (cognitiveServicesAccount.Properties.NetworkAcls != null)
4141
{
42-
this.NetworkRuleSet = PSNetworkRuleSet.Create(cognitiveServicesAccount.NetworkAcls);
42+
this.NetworkRuleSet = PSNetworkRuleSet.Create(cognitiveServicesAccount.Properties.NetworkAcls);
4343
}
4444
}
4545

src/Compute/Compute/ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
- Additional information about change #1
2020
-->
2121
## Upcoming Release
22-
* Allow empty value for ProximityPlacementGroupId during update
22+
* Allowed empty value for ProximityPlacementGroupId during update
2323

2424
## Version 3.4.0
2525
* Limit the number of VM status to 100 to avoid throttling when Get-AzVM -Status is performed without VM name.

src/DeviceProvisioningServices/DeviceProvisioningServices.Test/DeviceProvisioningServices.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14+
<PackageReference Include="Microsoft.Azure.Devices" Version="1.18.2" />
1415
<PackageReference Include="Microsoft.Azure.Management.DeviceProvisioningServices" Version="0.10.0-preview" />
1516
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="2.10.0-preview" />
1617
</ItemGroup>

src/EventGrid/EventGrid.Test/EventGrid.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.5.0" />
1616
<PackageReference Include="Microsoft.Azure.Management.Relay" Version="2.0.2" />
1717
<PackageReference Include="Microsoft.Azure.Management.ServiceBus" Version="2.1.0" />
18-
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="14.3.0" />
18+
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="14.4.0" />
1919
</ItemGroup>
2020

2121
</Project>

src/FrontDoor/FrontDoor.Test/ScenarioTests/WebApplicationFireWallPolicyTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,12 @@ public void TestPolicyCrudWithPiping()
4141
{
4242
TestController.NewInstance.RunPowerShellTest(_logger, "Test-PolicyCrudWithPiping");
4343
}
44+
45+
[Fact]
46+
[Trait(Category.AcceptanceType, Category.CheckIn)]
47+
public void TestManagedRuleSetDefinitions()
48+
{
49+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ManagedRuleSetDefinition");
50+
}
4451
}
4552
}

0 commit comments

Comments
 (0)