Skip to content

Commit eaff68e

Browse files
author
maddieclayton
authored
Merge branch 'preview' into networkhelp
2 parents 79d1b67 + 90a36a0 commit eaff68e

File tree

23 files changed

+10282
-27
lines changed

23 files changed

+10282
-27
lines changed

documentation/Using-Azure-TestFramework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1. This starts VS Dev command prompt in PowerShell
1919
2. Import module that helps in performing basic repository tasks
2020
1. Import-Module Repo-Tasks.psd1
21-
2. Type Get-Commands -Module Repo-Tasks to see list of cmdlets
21+
2. Type Get-Command -Module Repo-Tasks to see list of cmdlets
2222
3. Get-Help <CommandName> to get help on individual commands.
2323

2424
## 2. Accquring TestFramework

src/ResourceManager/Compute/Commands.Compute/help/Add-AzureRMVhd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The command overwrites an existing file.
4444

4545
### Example 3: Add a VHD file and specify the number of threads
4646
```
47-
PS C:\> Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -NumberOfThreads 32
47+
PS C:\> Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -NumberOfUploaderThreads 32
4848
```
4949

5050
This command adds a .vhd file to a storage account.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Locale: en-US
88

99
# AzureRM.MarketplaceOrdering Module
1010
## Description
11-
The topics in this section document the Azure PowerShell cmdlets for Azure MarketplaceOrdering in the Azure Resource Manager (ARM) framework. The cmdlets exist in the Microsoft.Azure.Commands.MarketplaceOrdering namespace. These cmdlets allow azure users to accept the legal terms for a marketplace offering further allowing programmtic deployment for these solutions. Users may also reject set of legal terms already accepted.
11+
The topics in this section document the Azure PowerShell cmdlets for Azure MarketplaceOrdering in the Azure Resource Manager (ARM) framework. The cmdlets exist in the Microsoft.Azure.Commands.MarketplaceOrdering namespace. These cmdlets allow azure users to accept the legal terms for a marketplace offering further allowing programmatic deployment for these solutions. Users may also reject set of legal terms already accepted.
1212

1313
## AzureRM.MarketplaceOrdering Cmdlets
1414
### [Get-AzureRmMarketplaceTerms](Get-AzureRmMarketplaceTerms.md)

src/ResourceManager/Sql/AzureRM.Sql.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ CmdletsToExport = 'Get-AzureRmSqlDatabaseTransparentDataEncryption',
181181
'New-AzureRmSqlServerVirtualNetworkRule',
182182
'Set-AzureRmSqlServerVirtualNetworkRule',
183183
'Get-AzureRmSqlServerVirtualNetworkRule',
184-
'Remove-AzureRmSqlServerVirtualNetworkRule'
184+
'Remove-AzureRmSqlServerVirtualNetworkRule',
185+
'Stop-AzureRmSqlDatabaseActivity'
185186

186187
# Variables to export from this module
187188
# VariablesToExport = @()

src/ResourceManager/Sql/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Adding support for list and cancel the asynchronous updateslo operation on the database
22+
- update existing cmdlet Get-AzureRmSqlDatabaseActivity to return DB updateslo operation status.
23+
- add new cmdlet Stop-AzureRmSqlDatabaseActivity for cancel the asynchronous updateslo operation on the database.
2124

2225
## Version 3.4.1
2326

src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@
8181
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.14.0.0-preview\lib\net452\Microsoft.Azure.Management.Network.dll</HintPath>
8282
</Reference>
8383
<Reference Include="Microsoft.Azure.Management.Sql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
84-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.1.6.0-preview\lib\net452\Microsoft.Azure.Management.Sql.dll</HintPath>
84+
<SpecificVersion>False</SpecificVersion>
85+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.1.7.0-preview\lib\net452\Microsoft.Azure.Management.Sql.dll</HintPath>
8586
<Private>True</Private>
8687
</Reference>
8788
<Reference Include="Microsoft.Azure.Management.Storage">
@@ -118,11 +119,13 @@
118119
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
119120
</Reference>
120121
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
121-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.8\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
122+
<SpecificVersion>False</SpecificVersion>
123+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.10\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
122124
<Private>True</Private>
123125
</Reference>
124126
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
125-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.7\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
127+
<SpecificVersion>False</SpecificVersion>
128+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.10\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
126129
<Private>True</Private>
127130
</Reference>
128131
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -640,6 +643,9 @@
640643
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudStretchTests\TestStretchDatabaseUpdate.json">
641644
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
642645
</None>
646+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestDatabaseCancelOperation.json">
647+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
648+
</None>
643649
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestDatabaseCreate.json">
644650
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
645651
</None>

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DatabaseCrudTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,12 @@ public void TestDatabaseRemove()
7272
{
7373
RunPowerShellTest("Test-RemoveDatabase");
7474
}
75+
76+
[Fact]
77+
[Trait(Category.AcceptanceType, Category.CheckIn)]
78+
public void TestDatabaseCancelOperation()
79+
{
80+
RunPowerShellTest("Test-CancelDatabaseOperation");
81+
}
7582
}
7683
}

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DatabaseCrudTests.ps1

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,4 +324,62 @@ function Test-RemoveDatabaseInternal ($location = "westcentralus")
324324
{
325325
Remove-ResourceGroupForTest $rg
326326
}
327+
}
328+
329+
330+
<#
331+
.SYNOPSIS
332+
Tests listing and cancelling a database operation
333+
#>
334+
function Test-CancelDatabaseOperation
335+
{
336+
Test-CancelDatabaseOperationInternal "North Europe"
337+
}
338+
339+
<#
340+
.SYNOPSIS
341+
Tests listing and cancelling a database operation
342+
#>
343+
function Test-CancelDatabaseOperationInternal ($location = "westcentralus")
344+
{
345+
# Setup
346+
$rg = Create-ResourceGroupForTest
347+
$server = Create-ServerForTest $rg $location
348+
349+
$databaseName = Get-DatabaseName
350+
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
351+
-Edition Standard -MaxSizeBytes 250GB -RequestedServiceObjectiveName S0
352+
Assert-AreEqual $db.DatabaseName $databaseName
353+
354+
# Database will be Standard s0 with maxsize: 268435456000 (250GB)
355+
356+
try
357+
{
358+
# Alter all properties
359+
$db1 = Set-AzureRmSqlDatabase -ResourceGroupName $db.ResourceGroupName -ServerName $db.ServerName -DatabaseName $db.DatabaseName `
360+
-Edition Standard -RequestedServiceObjectiveName S1
361+
Assert-AreEqual $db1.DatabaseName $db.DatabaseName
362+
Assert-AreEqual $db1.Edition Standard
363+
Assert-AreEqual $db1.CurrentServiceObjectiveName S1
364+
365+
# list and cancel a database operation
366+
$dbactivity = Get-AzureRmSqlDatabaseActivity -ResourceGroupName $db.ResourceGroupName -ServerName $db.ServerName -DatabaseName $db.DatabaseName
367+
Assert-AreEqual $dbactivity.DatabaseName $db.DatabaseName
368+
Assert-AreEqual $dbactivity.Operation "UpdateLogicalDatabase"
369+
370+
$dbactivityId = $dbactivity.OperationId
371+
try
372+
{
373+
$dbactivityCancel = Stop-AzureRmSqlDatabaseActivity -ResourceGroupName $db.ResourceGroupName -ServerName $db.ServerName -DatabaseName $db.DatabaseName -OperationId $dbactivityId
374+
}
375+
Catch
376+
{
377+
$ErrorMessage = $_.Exception.Message
378+
Assert-AreEqual True $ErrorMessage.Contains("Cannot cancel database management operation '" + $dbactivityId + "' in the current state")
379+
}
380+
}
381+
finally
382+
{
383+
Remove-ResourceGroupForTest $rg
384+
}
327385
}

0 commit comments

Comments
 (0)