Skip to content

Commit 552f4ba

Browse files
authored
Merge branch 'release-2020-03-10' into master
2 parents d0d5597 + 414561b commit 552f4ba

18 files changed

+291
-95
lines changed

src/ApiManagement/ApiManagement/ChangeLog.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,15 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21-
* Added support for retrieving and configuring Custom Domain on the DeveloperPortal Endpoint
22-
https://github.com/Azure/azure-powershell/issues/11007
23-
24-
* **Export-AzApiManagementApi** Added support for downloading Api Definition in Json format
25-
https://github.com/Azure/azure-powershell/issues/9987
26-
27-
* **Import-AzApiManagementApi** Added support for importing OpenApi 3.0 definition from Json document
28-
29-
* **New-AzApiManagementIdentityProvider** and **Set-AzApiManagementIdentityProvider** Added support for configuring `Signin Tenant` for AAD B2C Provider
30-
https://github.com/Azure/azure-powershell/issues/9784
31-
21+
* Added support for retrieving and configuring Custom Domain on the DeveloperPortal Endpoint [#11007]
22+
* `Export-AzApiManagementApi` Added support for downloading Api Definition in Json format [#9987]
23+
* `Import-AzApiManagementApi` Added support for importing OpenApi 3.0 definition from Json document
24+
* `New-AzApiManagementIdentityProvider` and `Set-AzApiManagementIdentityProvider` Added support for configuring `Signin Tenant` for AAD B2C Provider [#9784]
3225

3326
## Version 1.3.4
34-
* **Get-AzApiManagementApiSchema** Fixed getting Open-Api Schema associated with an API
35-
https://github.com/Azure/azure-powershell/issues/10626
36-
37-
* **New-AzApiManagementProduct*** and **Set-AzApiManagementProduct**
38-
- Fix documentation for https://github.com/Azure/azure-powershell/issues/10472
39-
40-
* **Set-AzApiManagementApi**
41-
Added example to show how to update the ServiceUrl using the cmdlet
27+
* `Get-AzApiManagementApiSchema` Fixed getting Open-Api Schema associated with an API [#10626]
28+
* `New-AzApiManagementProduct` and `Set-AzApiManagementProduct` Fixed documentation for [#10472]
29+
* `Set-AzApiManagementApi` Added example to show how to update the ServiceUrl using the cmdlet
4230

4331
## Version 1.3.3
4432
* Update references in .psd1 to use relative path

src/Blueprint/Blueprint/ChangeLog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21-
* Show DependsOn property value in the table view
22-
* Add support to accept PolicyDefinitionParameter empty
21+
* Showed DependsOn property value in the table view
22+
* Added support to accept PolicyDefinitionParameter empty
2323

2424
## Version 0.2.10
2525
* Added support to include subfolders when deploying blueprints with artifacts

src/DataLakeStore/DataLakeStore/ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21-
* Add reference to System.Buffers explicitly in csproj and psd1.
21+
* Added reference to System.Buffers explicitly in csproj and psd1.
2222

2323
## Version 1.2.6
2424
* Update references in .psd1 to use relative path

src/IotHub/IotHub/ChangeLog.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21-
* Add support to manage devices in an Iot Hub. New Cmdlets are:
22-
- Add-AzIotHubDevice
23-
- Get-AzIotHubDevice
24-
- Remove-AzIotHubDevice
25-
- Set-AzIotHubDevice
26-
* Add support to manage modules on a target Iot device in an Iot Hub. New Cmdlets are:
27-
- Add-AzIotHubModule
28-
- Get-AzIotHubModule
29-
- Remove-AzIotHubModule
30-
- Set-AzIotHubModule
31-
* Add cmdlet to get the connection string of a target IoT device in an Iot Hub.
32-
* Add cmdlet to get the connection string of a module on a target IoT device in an Iot Hub.
33-
* Add support to get/set parent device of an IoT device. New Cmdlets are:
34-
- Get-AzIotHubDeviceParent
35-
- Set-AzIotHubDeviceParent
36-
* Add support to manage device parent-child relationship.
21+
* Added support to manage devices in an Iot Hub. New Cmdlets are:
22+
- `Add-AzIotHubDevice`
23+
- `Get-AzIotHubDevice`
24+
- `Remove-AzIotHubDevice`
25+
- `Set-AzIotHubDevice`
26+
* Added support to manage modules on a target Iot device in an Iot Hub. New Cmdlets are:
27+
- `Add-AzIotHubModule`
28+
- `Get-AzIotHubModule`
29+
- `Remove-AzIotHubModule`
30+
- `Set-AzIotHubModule`
31+
* Added cmdlet to get the connection string of a target IoT device in an Iot Hub.
32+
* Added cmdlet to get the connection string of a module on a target IoT device in an Iot Hub.
33+
* Added support to get/set parent device of an IoT device. New Cmdlets are:
34+
- `Get-AzIotHubDeviceParent`
35+
- `Set-AzIotHubDeviceParent`
36+
* Added support to manage device parent-child relationship.
3737

3838
## Version 2.1.0
3939
* Added support to manage devices in an Iot Hub. New Cmdlets are:

src/Maintenance/Maintenance/ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
-->
2020

2121
## Upcoming Release
22-
* Get Az-MaintenanceConfiguration will honor filters while listing maintenance configurations
22+
* Got `Az-MaintenanceConfiguration` will honor filters while listing maintenance configurations
2323

2424
## Version 0.1.2
2525
* Update command will display pending updates by default

src/Sql/Sql/Az.Sql.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ CmdletsToExport = 'Get-AzSqlDatabaseTransparentDataEncryption',
252252
'Enable-AzSqlDatabaseSensitivityRecommendation',
253253
'Disable-AzSqlDatabaseSensitivityRecommendation',
254254
'Enable-AzSqlInstanceDatabaseSensitivityRecommendation',
255-
'Disable-AzSqlInstanceDatabaseSensitivityRecommendation'
255+
'Disable-AzSqlInstanceDatabaseSensitivityRecommendation',
256+
'Disable-AzSqlServerActiveDirectoryOnlyAuthentication'
256257

257258
# Variables to export from this module
258259
# VariablesToExport = @()

src/Sql/Sql/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* Added support for cross subscription point in time restore on Managed Instances.
2828
* Added support for changing existing Sql Managed Instance hardware generation
2929
* Fixed `Update-AzSqlServerVulnerabilityAssessmentSetting` help examples: parameter/property output - EmailAdmins
30+
* Updating Azure SQL Server Active Azure administrator API to use 2019-06-01-preview api version.
3031

3132
## Version 2.2.0
3233
Fix New-AzSqlDatabaseSecondary cmdlet to check for PartnerDatabaseName existence instead of DatabaseName existence.

src/Sql/Sql/ServerActiveDirectoryAdministrator/Cmdlet/AzureSqlServerActiveDirectoryAdministratorCmdletBase.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
16-
using Microsoft.Azure.Commands.Common.Authentication.Models;
1715
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
1816
using Microsoft.Azure.Commands.Sql.Common;
1917
using Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model;

src/Sql/Sql/ServerActiveDirectoryAdministrator/Cmdlet/SetAzureSqlServerActiveDirectoryAdministrator.cs

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
// See the License for the specific language governing permissions and
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
14-
15-
using Hyak.Common;
1614
using Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model;
15+
using Microsoft.Rest.Azure;
1716
using System;
1817
using System.Collections.Generic;
1918
using System.Linq;
@@ -24,7 +23,7 @@ namespace Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Cmdlet
2423
/// <summary>
2524
/// Cmdlet to create a new Azure SQL Server Active Directory administrator
2625
/// </summary>
27-
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlServerActiveDirectoryAdministrator",ConfirmImpact = ConfirmImpact.Medium, SupportsShouldProcess = true), OutputType(typeof(AzureSqlServerActiveDirectoryAdministratorModel))]
26+
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlServerActiveDirectoryAdministrator", ConfirmImpact = ConfirmImpact.Medium, SupportsShouldProcess = true), OutputType(typeof(AzureSqlServerActiveDirectoryAdministratorModel))]
2827
public class SetAzureSqlServerActiveDirectoryAdministrator : AzureSqlServerActiveDirectoryAdministratorCmdletBase
2928
{
3029
/// <summary>
@@ -47,19 +46,33 @@ public class SetAzureSqlServerActiveDirectoryAdministrator : AzureSqlServerActiv
4746
[ValidateNotNullOrEmpty()]
4847
public Guid ObjectId { get; set; }
4948

49+
/// <summary>
50+
/// Only Azure Active Directory authentication allowed
51+
/// </summary>
52+
[Parameter(Mandatory = false,
53+
ValueFromPipelineByPropertyName = true,
54+
Position = 4,
55+
HelpMessage = "Specifies if only Azure Active Directory authentication is allowed.")]
56+
[ValidateNotNullOrEmpty()]
57+
public bool? IsAzureOnlyAuthentication { get; set; }
58+
5059
/// <summary>
5160
/// Get the entities from the service
5261
/// </summary>
5362
/// <returns>The list of entities</returns>
5463
protected override IEnumerable<AzureSqlServerActiveDirectoryAdministratorModel> GetEntity()
5564
{
5665
List<AzureSqlServerActiveDirectoryAdministratorModel> currentActiveDirectoryAdmins = null;
66+
5767
try
5868
{
59-
currentActiveDirectoryAdmins = new List<AzureSqlServerActiveDirectoryAdministratorModel>()
69+
AzureSqlServerActiveDirectoryAdministratorModel model = ModelAdapter.GetServerActiveDirectoryAdministrator(this.ResourceGroupName, this.ServerName);
70+
71+
if (model != null)
6072
{
61-
ModelAdapter.GetServerActiveDirectoryAdministrator(this.ResourceGroupName, this.ServerName),
62-
};
73+
currentActiveDirectoryAdmins = new List<AzureSqlServerActiveDirectoryAdministratorModel>();
74+
currentActiveDirectoryAdmins.Add(model);
75+
}
6376
}
6477
catch (CloudException ex)
6578
{
@@ -69,6 +82,14 @@ protected override IEnumerable<AzureSqlServerActiveDirectoryAdministratorModel>
6982
throw;
7083
}
7184
}
85+
catch (Exception ex)
86+
{
87+
if ((ex.InnerException is CloudException ex1) &&
88+
ex1.Response.StatusCode != System.Net.HttpStatusCode.NotFound)
89+
{
90+
throw ex.InnerException ?? ex;
91+
}
92+
}
7293

7394
return currentActiveDirectoryAdmins;
7495
}
@@ -80,13 +101,14 @@ protected override IEnumerable<AzureSqlServerActiveDirectoryAdministratorModel>
80101
/// <returns>A list of models that was passed in</returns>
81102
protected override IEnumerable<AzureSqlServerActiveDirectoryAdministratorModel> ApplyUserInputToModel(IEnumerable<AzureSqlServerActiveDirectoryAdministratorModel> model)
82103
{
83-
List<Model.AzureSqlServerActiveDirectoryAdministratorModel> newEntity = new List<AzureSqlServerActiveDirectoryAdministratorModel>();
104+
List<Model.AzureSqlServerActiveDirectoryAdministratorModel> newEntity = new List<AzureSqlServerActiveDirectoryAdministratorModel>();
84105
newEntity.Add(new AzureSqlServerActiveDirectoryAdministratorModel()
85106
{
86107
ResourceGroupName = ResourceGroupName,
87108
ServerName = ServerName,
88109
DisplayName = DisplayName,
89110
ObjectId = ObjectId,
111+
IsAzureADOnlyAuthentication = IsAzureOnlyAuthentication,
90112
});
91113
return newEntity;
92114
}

src/Sql/Sql/ServerActiveDirectoryAdministrator/Model/AzureSqlServerActiveDirectoryAdministratorModel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,10 @@ public class AzureSqlServerActiveDirectoryAdministratorModel
4040
/// Gets or sets the unique ID of the Azure SQL Server Active administrator admin object id
4141
/// </summary>
4242
public Guid ObjectId { get; set; }
43+
44+
/// <summary>
45+
/// Gets or sets the value to indicate if only Azure AD Only authentication is allowed
46+
/// </summary>
47+
public bool? IsAzureADOnlyAuthentication { get; set; }
4348
}
4449
}

src/Sql/Sql/ServerActiveDirectoryAdministrator/Services/AzureSqlServerActiveDirectoryAdministratorAdapter.cs

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
1616
using Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model;
17-
using Microsoft.Azure.Commands.Sql.Services;
18-
using Microsoft.Azure.Management.Sql.LegacySdk.Models;
17+
using Microsoft.Azure.Management.Sql.Models;
1918
using Microsoft.Azure.Graph.RBAC.Version1_6.ActiveDirectory;
2019
using System;
2120
using System.Collections.Generic;
@@ -113,10 +112,7 @@ internal ICollection<AzureSqlServerActiveDirectoryAdministratorModel> ListServer
113112
/// <returns>The upserted Azure SQL Server Active Directory administrator</returns>
114113
internal AzureSqlServerActiveDirectoryAdministratorModel UpsertServerActiveDirectoryAdministrator(string resourceGroup, string serverName, AzureSqlServerActiveDirectoryAdministratorModel model)
115114
{
116-
var resp = Communicator.CreateOrUpdate(resourceGroup, serverName, new ServerAdministratorCreateOrUpdateParameters()
117-
{
118-
Properties = GetActiveDirectoryInformation(model.DisplayName, model.ObjectId)
119-
});
115+
var resp = Communicator.CreateOrUpdate(resourceGroup, serverName, GetActiveDirectoryInformation(model.DisplayName, model.ObjectId, model.IsAzureADOnlyAuthentication));
120116

121117
return CreateServerActiveDirectoryAdministratorModelFromResponse(resourceGroup, serverName, resp);
122118
}
@@ -131,40 +127,59 @@ public void RemoveServerActiveDirectoryAdministrator(string resourceGroupName, s
131127
Communicator.Remove(resourceGroupName, serverName);
132128
}
133129

130+
/// <summary>
131+
/// Disable Azure Active Directory only authentication on a Azure SQL Server
132+
/// </summary>
133+
/// <param name="resourceGroup">The name of the resource group</param>
134+
/// <param name="serverName">The name of the Azure Sql ServerActiveDirectoryAdministrator Server</param>
135+
/// <returns>The upserted Azure SQL Server Active Directory administrator</returns>
136+
internal AzureSqlServerActiveDirectoryAdministratorModel DisableAzureADOnlyAuthenticaion(string resourceGroup, string serverName)
137+
{
138+
var resp = Communicator.Disable(resourceGroup, serverName);
139+
140+
return CreateServerActiveDirectoryAdministratorModelFromResponse(resourceGroup, serverName, resp);
141+
}
142+
134143
/// <summary>
135144
/// Converts the response from the service to a powershell database object
136145
/// </summary>
137146
/// <param name="resourceGroupName">The resource group the server is in</param>
138147
/// <param name="serverName">The name of the Azure Sql ServerActiveDirectoryAdministrator Server</param>
139148
/// <param name="admin">The service response</param>
140149
/// <returns>The converted model</returns>
141-
public static AzureSqlServerActiveDirectoryAdministratorModel CreateServerActiveDirectoryAdministratorModelFromResponse(string resourceGroup, string serverName, Management.Sql.LegacySdk.Models.ServerAdministrator admin)
150+
public static AzureSqlServerActiveDirectoryAdministratorModel CreateServerActiveDirectoryAdministratorModelFromResponse(string resourceGroup, string serverName, Management.Sql.Models.ServerAzureADAdministrator admin)
142151
{
143-
AzureSqlServerActiveDirectoryAdministratorModel model = new AzureSqlServerActiveDirectoryAdministratorModel();
144-
145-
model.ResourceGroupName = resourceGroup;
146-
model.ServerName = serverName;
147-
model.DisplayName = admin.Properties.Login;
148-
model.ObjectId = admin.Properties.Sid;
152+
if (admin != null)
153+
{
154+
AzureSqlServerActiveDirectoryAdministratorModel model = new AzureSqlServerActiveDirectoryAdministratorModel();
155+
156+
model.ResourceGroupName = resourceGroup;
157+
model.ServerName = serverName;
158+
model.DisplayName = admin.Login;
159+
model.ObjectId = admin.Sid;
160+
model.IsAzureADOnlyAuthentication = admin.AzureADOnlyAuthentication;
161+
return model;
162+
}
149163

150-
return model;
164+
return null;
151165
}
152166

153167
/// <summary>
154168
/// Verifies that the Azure Active Directory user or group exists, and will get the object id if it is not set.
155169
/// </summary>
156170
/// <param name="displayName">Azure Active Directory user or group display name</param>
157171
/// <param name="objectId">Azure Active Directory user or group object id</param>
172+
/// <param name="isAzureADOnlyAuthentication">Allow only Azure Active Directory authentication</param>
158173
/// <returns></returns>
159-
protected ServerAdministratorCreateOrUpdateProperties GetActiveDirectoryInformation(string displayName, Guid objectId)
174+
protected ServerAzureADAdministrator GetActiveDirectoryInformation(string displayName, Guid objectId, bool? isAzureADOnlyAuthentication)
160175
{
161176
// Gets the default Tenant id for the subscriptions
162177
Guid tenantId = GetTenantId();
163178

164179
// Check for a Azure Active Directory group. Recommended to always use group.
165180
IEnumerable<PSADGroup> groupList = null;
166181

167-
var filter = new ADObjectFilterOptions()
182+
var filter = new ADObjectFilterOptions()
168183
{
169184
Id = (objectId != null && objectId != Guid.Empty) ? objectId.ToString() : null,
170185
SearchString = displayName,
@@ -190,11 +205,13 @@ protected ServerAdministratorCreateOrUpdateProperties GetActiveDirectoryInformat
190205
throw new ArgumentException(string.Format(Microsoft.Azure.Commands.Sql.Properties.Resources.InvalidADGroupNotSecurity, displayName));
191206
}
192207

193-
return new ServerAdministratorCreateOrUpdateProperties()
208+
209+
return new ServerAzureADAdministrator()
194210
{
195211
Login = group.DisplayName,
196212
Sid = group.Id,
197213
TenantId = tenantId,
214+
AzureADOnlyAuthentication = isAzureADOnlyAuthentication,
198215
};
199216
}
200217

@@ -238,11 +255,12 @@ protected ServerAdministratorCreateOrUpdateProperties GetActiveDirectoryInformat
238255
// Only one user was found. Get the user display name and object id
239256
var obj = userList.First();
240257

241-
return new ServerAdministratorCreateOrUpdateProperties()
258+
return new ServerAzureADAdministrator()
242259
{
243260
Login = displayName,
244261
Sid = obj.Id,
245262
TenantId = tenantId,
263+
AzureADOnlyAuthentication = isAzureADOnlyAuthentication,
246264
};
247265
}
248266
}

0 commit comments

Comments
 (0)