Skip to content

Commit 0c32b13

Browse files
committed
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
2 parents a8592b4 + 7a22019 commit 0c32b13

File tree

59 files changed

+98888
-142646
lines changed

Some content is hidden

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

59 files changed

+98888
-142646
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ This checklist is used to make sure that common guidelines for a pull request ar
2626

2727
### [Cmdlet Signature Guidelines](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md#cmdlet-signature-guidelines)
2828
- [ ] New cmdlets that make changes or have side effects should implement `ShouldProcess` and have `SupportShouldProcess=true` specified in the cmdlet attribute. You can find more information on `ShouldProcess` [here](https://gist.github.com/markcowl/338e16fe5c8bbf195aff9f8af0db585d#what-is-the-change).
29-
- [ ] Cmdlet specifies `OutputType` attribute if any output is produced - if the cmdlet produces no output, it should implement a `PassThrough` parameter.
29+
- [ ] Cmdlet specifies `OutputType` attribute if any output is produced - if the cmdlet produces no output, it should implement a `PassThru` parameter.
3030

3131
### [Cmdlet Parameter Guidelines](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md#cmdlet-parameter-guidelines)
3232
- [ ] Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
3333
- [ ] Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
34-
- [ ] Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.
34+
- [ ] Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This repository contains a set of PowerShell cmdlets for developers and administ
3636
* Scheduler
3737
* StorSimple
3838
* Redis Cache
39-
39+
4040
* Windows Azure Pack
4141
* Web Site: CRUD web site, deployment, configure and get log, start/stop/restart/show web site
4242
* Service Bus: CRD namespace
@@ -46,7 +46,7 @@ This repository contains a set of PowerShell cmdlets for developers and administ
4646
* Windows Azure Stack
4747
* Azure Stack Administration
4848
* Storage Service Management
49-
49+
5050

5151
For detail descriptions and examples of the cmdlets, type
5252
* ```help azure``` to get all the cmdlets.
@@ -92,7 +92,7 @@ You can also find the standalone installers for all the versions at [Downloads](
9292

9393
In general, follow these steps to start using Microsoft Azure PowerShell
9494

95-
* Get yourself authenticated with Microsoft Azure. For details, please check out [this article](https://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/).
95+
* Get yourself authenticated with Microsoft Azure. For details, please check out [this article](https://docs.microsoft.com/powershell/azureps-cmdlets-docs/).
9696
* Option 1: Login with your Microsoft account or Organizational account directly from PowerShell. Microsoft Azure Active Directory authentication is used in this case. No management certificate is needed.
9797
* Starting from 1.0.0, you can use ```Add-AzureRmAccount -Credential``` to avoid the browser pop up for Organizational account.
9898
* To use RDFE cmdlets, use ```Add-AzureAccount```

src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSSiteRecoveryClient.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,12 @@ public CustomRequestHeaders GetRequestHeaders(bool shouldSignRequest = true)
312312
/// <returns>Site Recovery Management client</returns>
313313
private SiteRecoveryManagementClient GetSiteRecoveryClient()
314314
{
315+
if (string.IsNullOrEmpty(asrVaultCreds.ResourceName) ||
316+
string.IsNullOrEmpty(asrVaultCreds.ResourceGroupName))
317+
{
318+
throw new InvalidOperationException(Properties.Resources.MissingVaultSettings);
319+
}
320+
315321
SiteRecoveryManagementClient siteRecoveryClient =
316322
AzureSession.ClientFactory.CreateCustomClient<SiteRecoveryManagementClient>(
317323
asrVaultCreds.ResourceName,
@@ -426,4 +432,4 @@ public static T Deserialize(string xmlString)
426432
return propertyBagContainer;
427433
}
428434
}
429-
}
435+
}

src/ResourceManager/Sql/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
## Current Release
21+
* Added new return parameter "AuditType" to Get-AzureRmSqlDatabaseAuditingPolicy and Get-AzureRmSqlServerAuditingPolicy returned object
22+
- This parameter value indicates the returned auditing policy type - Table or Blob.
2123

2224
## Version 2.4.0
2325
* Added storage properties to cmdlets for Azure SQL threat detection policy management at database and server level

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

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,7 @@ function Test-DatatabaseAuditingTypeMigration
975975

976976
# Assert
977977
Assert-AreEqual $policy.EventType.Length 1
978+
Assert-AreEqual $policy.AuditType ([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditType]::Table)
978979
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditEventType]::PlainSQL_Success)}
979980

980981
# Test
@@ -985,6 +986,7 @@ function Test-DatatabaseAuditingTypeMigration
985986

986987
# Assert
987988
Assert-AreEqual $policy.AuditState "Enabled"
989+
Assert-AreEqual $policy.AuditType ([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditType]::Blob)
988990
Assert-AreEqual $policy.AuditActionGroup.Length 1
989991
Assert-True {$policy.AuditActionGroup.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditActionGroups]::FAILED_DATABASE_AUTHENTICATION_GROUP)}
990992
Assert-AreEqual $policy.AuditAction.Length 2
@@ -996,16 +998,33 @@ function Test-DatatabaseAuditingTypeMigration
996998

997999
# Assert
9981000
Assert-AreEqual $policy.AuditState "Enabled"
1001+
Assert-AreEqual $policy.AuditType ([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditType]::Table)
9991002
Assert-AreEqual $policy.EventType.Length 1
10001003
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditEventType]::ParameterizedSQL_Failure)}
10011004

1005+
# Test
1006+
Set-AzureRmSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount
1007+
Use-AzureRmSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
1008+
$policy = Get-AzureRmSqlDatabaseAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
1009+
1010+
# Assert
1011+
Assert-AreEqual $policy.AuditType ([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditType]::Table)
1012+
1013+
# Test
1014+
Set-AzureRmSqlDatabaseAuditingPolicy -AuditType Blob -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -StorageAccountName $params.storageAccount
1015+
Use-AzureRmSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
1016+
$policy = Get-AzureRmSqlDatabaseAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
1017+
1018+
# Assert
1019+
Assert-AreEqual $policy.AuditType ([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditType]::Table)
1020+
10021021
# Test
10031022
Remove-AzureRmSqlDatabaseAuditing -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
10041023
$policy = Get-AzureRmSqlDatabaseAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
10051024

10061025
# Assert
10071026
Assert-AreEqual $policy.AuditState "Disabled"
1008-
Assert-AreEqual $policy.AuditAction.Length 2
1027+
Assert-AreEqual $policy.AuditType ([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditType]::Table)
10091028
}
10101029
finally
10111030
{
@@ -1034,6 +1053,7 @@ function Test-ServerAuditingTypeMigration
10341053

10351054
# Assert
10361055
Assert-AreEqual $policy.EventType.Length 1
1056+
Assert-AreEqual $policy.AuditType ([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditType]::Table)
10371057
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditEventType]::PlainSQL_Success)}
10381058

10391059
# Test
@@ -1042,6 +1062,7 @@ function Test-ServerAuditingTypeMigration
10421062

10431063
# Assert
10441064
Assert-AreEqual $policy.AuditState "Enabled"
1065+
Assert-AreEqual $policy.AuditType ([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditType]::Blob)
10451066
Assert-AreEqual $policy.AuditActionGroup.Length 1
10461067
Assert-True {$policy.AuditActionGroup.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditActionGroups]::FAILED_DATABASE_AUTHENTICATION_GROUP)}
10471068
Assert-AreEqual $policy.RetentionInDays 4
@@ -1053,16 +1074,18 @@ function Test-ServerAuditingTypeMigration
10531074
# Assert
10541075
Assert-AreEqual $policy.AuditState "Enabled"
10551076
Assert-AreEqual $policy.EventType.Length 1
1077+
Assert-AreEqual $policy.AuditType ([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditType]::Table)
10561078
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditEventType]::ParameterizedSQL_Failure)}
10571079

10581080
# Test
1059-
Remove-AzureRmSqlDatabaseAuditing -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
1060-
$policy = Get-AzureRmSqlDatabaseAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
1081+
Remove-AzureRmSqlServerAuditing -ResourceGroupName $params.rgname -ServerName $params.serverName
1082+
$policy = Get-AzureRmSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName
10611083

10621084
# Assert
10631085
Assert-AreEqual $policy.AuditState "Disabled"
1086+
Assert-AreEqual $policy.AuditType ([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditType]::Table)
10641087
Assert-AreEqual $policy.AuditAction.Length 0
1065-
1088+
Assert-AreEqual $policy.RetentionInDays 0
10661089
}
10671090
finally
10681091
{

0 commit comments

Comments
 (0)