Skip to content

Commit e532fbe

Browse files
author
Maddie Clayton
authored
Merge branch 'master' into master
2 parents 1625626 + 43bf220 commit e532fbe

25 files changed

+56543
-19
lines changed

src/EventGrid/EventGrid/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+
* Updated the help text for endpoint to indicate that resources should be created before using the create/update event subscription cmdlets.
2122

2223
## Version 1.1.0
2324
* Updated to use the 2019-01-01 API version.

src/EventGrid/EventGrid/Utilities/EventGridConstants.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class EventGridConstants
3131
public const string LabelsHelp = "Labels for the event subscription.";
3232
public const string EndpointTypeHelp = "Endpoint Type. This can be webhook, eventhub, storagequeue, or hybridconnection. Default value is webhook.";
3333
public const string EndpointHelp = "Event subscription destination endpoint. This can be a webhook URL, or the Azure resource ID of an EventHub, storage queue or hybridconnection. For example, the resource ID for a hybrid connection " +
34-
"takes the following form: /subscriptions/[Azure Subscription ID]/resourceGroups/[ResourceGroupName]/providers/Microsoft.Relay/namespaces/[NamespaceName]/hybridConnections/[HybridConnectionName].";
34+
"takes the following form: /subscriptions/[Azure Subscription ID]/resourceGroups/[ResourceGroupName]/providers/Microsoft.Relay/namespaces/[NamespaceName]/hybridConnections/[HybridConnectionName]. It is expected that " +
35+
"the destination endpoint to be created and available for use before executing any Event Grid cmdlets.";
3536
public const string ResourceGroupNameHelp = "The name of the resource group.";
3637
public const string TopicNameHelp = "EventGrid topic name.";
3738
public const string TopicTypeNameHelp = "EventGrid topic type name.";

src/EventGrid/EventGrid/help/New-AzEventGridSubscription.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ Accept wildcard characters: False
147147
148148
### -Endpoint
149149
Event subscription destination endpoint.
150-
This can be a webhook URL or the Azure resource ID of an EventHub.
150+
This can be a webhook URL, or the Azure resource ID of an EventHub, storage queue or hybridconnection. For example, the resource ID for a hybrid connection takes the following form: /subscriptions/[Azure Subscription ID]/resourceGroups/[ResourceGroupName]/providers/Microsoft.Relay/namespaces/[NamespaceName]/hybridConnections/[HybridConnectionName]. It is expected that the destination endpoint to be created and available for use before executing any Event Grid cmdlets.
151+
151152
152153
```yaml
153154
Type: System.String
@@ -175,7 +176,8 @@ Accept wildcard characters: False
175176
176177
### -EndpointType
177178
Endpoint Type.
178-
This can be webhook or eventhub
179+
This can be webhook, eventhub, storagequeue, or hybridconnection. Default value is webhook.
180+
179181
180182
```yaml
181183
Type: System.String

src/EventGrid/EventGrid/help/Update-AzEventGridSubscription.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ Accept wildcard characters: False
115115
116116
### -Endpoint
117117
Event subscription destination endpoint.
118-
This can be a webhook URL or the Azure resource ID of an EventHub.
118+
This can be a webhook URL, or the Azure resource ID of an EventHub, storage queue or hybridconnection. For example, the resource ID for a hybrid connection takes the following form: /subscriptions/[Azure Subscription ID]/resourceGroups/[ResourceGroupName]/providers/Microsoft.Relay/namespaces/[NamespaceName]/hybridConnections/[HybridConnectionName]. It is expected that the destination endpoint to be created and available for use before executing any Event Grid cmdlets.
119+
119120
120121
```yaml
121122
Type: System.String
@@ -131,7 +132,7 @@ Accept wildcard characters: False
131132
132133
### -EndpointType
133134
Endpoint Type.
134-
This can be webhook or eventhub
135+
This can be webhook, eventhub, storagequeue, or hybridconnection. Default value is webhook.
135136
136137
```yaml
137138
Type: System.String

src/GuestConfiguration/GuestConfiguration/Az.GuestConfiguration.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# RootModule = ''
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.10.4'
15+
ModuleVersion = '0.10.5'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
@@ -107,7 +107,7 @@ PrivateData = @{
107107
# IconUri = ''
108108

109109
# ReleaseNotes of this module
110-
ReleaseNotes = '* Fix cmdlets failure when an initiative definition in subscription does not have category set.'
110+
ReleaseNotes = '- Fixed cmdlets failure when a subscription has an incorrect format initiative definition for GuestConfiguration category.'
111111

112112
# Prerelease string of this module
113113
# Prerelease = ''

src/GuestConfiguration/GuestConfiguration/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+
22+
## Version 0.10.5
2123
- Fixed cmdlets failure when a subscription has an incorrect format initiative definition for GuestConfiguration category.
2224

2325
## Version 0.10.4

src/GuestConfiguration/GuestConfiguration/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
[assembly: CLSCompliant(false)]
2626
[assembly: Guid("d28548d3-2673-4508-a28b-a69e0470faf7")]
2727

28-
[assembly: AssemblyVersion("0.10.4")]
29-
[assembly: AssemblyFileVersion("0.10.4")]
28+
[assembly: AssemblyVersion("0.10.5")]
29+
[assembly: AssemblyFileVersion("0.10.5")]

src/Sql/Sql.Test/ScenarioTests/Common.ps1

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -716,18 +716,17 @@ function Create-ManagedInstanceForTest ($resourceGroup, $subnetId)
716716
.SYNOPSIS
717717
Create a virtual network
718718
#>
719-
function CreateAndGetVirtualNetworkForManagedInstance ($vnetName, $subnetName, $location = "westcentralus")
719+
function CreateAndGetVirtualNetworkForManagedInstance ($vnetName, $subnetName, $location = "westcentralus", $resourceGroupName = "cl_one")
720720
{
721721
$vNetAddressPrefix = "10.0.0.0/16"
722-
$defaultResourceGroupName = "cl_one"
723722
$defaultSubnetAddressPrefix = "10.0.0.0/24"
724723

725724
try {
726-
$getVnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $defaultResourceGroupName
725+
$getVnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $resourceGroupName
727726
return $getVnet
728727
} catch {
729728
$virtualNetwork = New-AzVirtualNetwork `
730-
-ResourceGroupName $defaultResourceGroupName `
729+
-ResourceGroupName $resourceGroupName `
731730
-Location $location `
732731
-Name $vNetName `
733732
-AddressPrefix $vNetAddressPrefix
@@ -738,7 +737,7 @@ function CreateAndGetVirtualNetworkForManagedInstance ($vnetName, $subnetName, $
738737
$virtualNetwork | Set-AzVirtualNetwork
739738
$routeTableMiManagementService = New-AzRouteTable `
740739
-Name 'myRouteTableMiManagementService' `
741-
-ResourceGroupName $defaultResourceGroupName `
740+
-ResourceGroupName $resourceGroupName `
742741
-location $location
743742
Set-AzVirtualNetworkSubnetConfig `
744743
-VirtualNetwork $virtualNetwork `
@@ -747,15 +746,15 @@ function CreateAndGetVirtualNetworkForManagedInstance ($vnetName, $subnetName, $
747746
-RouteTable $routeTableMiManagementService | `
748747
Set-AzVirtualNetwork
749748
Get-AzRouteTable `
750-
-ResourceGroupName $defaultResourceGroupName `
749+
-ResourceGroupName $resourceGroupName `
751750
-Name "myRouteTableMiManagementService" `
752751
| Add-AzRouteConfig `
753752
-Name "ToManagedInstanceManagementService" `
754753
-AddressPrefix 0.0.0.0/0 `
755754
-NextHopType "Internet" `
756755
| Set-AzRouteTable
757756

758-
$getVnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $defaultResourceGroupName
757+
$getVnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $resourceGroupName
759758
return $getVnet
760759
}
761760
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.ScenarioTest.SqlTests;
16+
using Microsoft.Azure.ServiceManagement.Common.Models;
17+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
18+
using Xunit;
19+
using Xunit.Abstractions;
20+
using RestTestFramework = Microsoft.Rest.ClientRuntime.Azure.TestFramework;
21+
22+
namespace Microsoft.Azure.Commands.Sql.Test.ScenarioTests
23+
{
24+
public class VirtualClusterCrudScenarioTests : SqlTestsBase
25+
{
26+
protected override void SetupManagementClients(RestTestFramework.MockContext context)
27+
{
28+
var sqlClient = GetSqlClient(context);
29+
var newResourcesClient = GetResourcesClient(context);
30+
var networkClient = GetNetworkClient(context);
31+
Helper.SetupSomeOfManagementClients(sqlClient, newResourcesClient, networkClient);
32+
}
33+
34+
public VirtualClusterCrudScenarioTests(ITestOutputHelper output) : base(output)
35+
{
36+
}
37+
38+
[Fact]
39+
[Trait(Category.AcceptanceType, Category.CheckIn)]
40+
public void TestGetVirtualCluster()
41+
{
42+
RunPowerShellTest("Test-GetVirtualCluster");
43+
}
44+
45+
[Fact]
46+
[Trait(Category.AcceptanceType, Category.CheckIn)]
47+
public void TestRemoveVirtualCluster()
48+
{
49+
RunPowerShellTest("Test-RemoveVirtualCluster");
50+
}
51+
}
52+
}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Tests Getting a VirtualCluster
18+
.DESCRIPTION
19+
SmokeTest
20+
#>
21+
function Test-GetVirtualCluster
22+
{
23+
# Setup
24+
$location = Get-ProviderLocation "Microsoft.Sql/virtualclusters"
25+
$rg = Create-ResourceGroupForTest $location
26+
27+
$rgName = $rg.ResourceGroupName
28+
$vnetName = "cl_initial"
29+
$subnetName = "Cool"
30+
31+
# Setup VNET
32+
$virtualNetwork = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $location $rgName
33+
$subnetId = $virtualNetwork.Subnets.where({ $_.Name -eq $subnetName })[0].Id
34+
35+
$managedInstance = Create-ManagedInstanceForTest $rg $subnetId
36+
37+
try
38+
{
39+
# Test using all parameters
40+
$virtualClusterList = Get-AzSqlVirtualCluster
41+
$virtualCluster = $virtualClusterList.where({$_.SubnetId -eq $subnetId})
42+
Assert-AreEqual $rgName $virtualCluster.ResourceGroupName
43+
$virtualClusterName = $virtualCluster.VirtualClusterName
44+
45+
$virtualClusterList = Get-AzSqlVirtualCluster -ResourceGroupName $rgName
46+
$virtualCluster = $virtualClusterList.where({$_.SubnetId -eq $subnetId})
47+
Assert-AreEqual $rgName $virtualCluster.ResourceGroupName
48+
Assert-AreEqual $virtualClusterName $virtualCluster.VirtualClusterName
49+
50+
$virtualCluster = Get-AzSqlVirtualCluster -ResourceGroupName $rgName -Name $virtualClusterName
51+
Assert-AreEqual $rgName $virtualCluster.ResourceGroupName
52+
Assert-AreEqual $virtualClusterName $virtualCluster.VirtualClusterName
53+
Assert-AreEqual $subnetId $virtualCluster.SubnetId
54+
}
55+
finally
56+
{
57+
Remove-ResourceGroupForTest $rg
58+
}
59+
}
60+
61+
<#
62+
.SYNOPSIS
63+
Tests Removing a VirtualCluster
64+
.DESCRIPTION
65+
SmokeTest
66+
#>
67+
function Test-RemoveVirtualCluster
68+
{
69+
# Setup
70+
$location = Get-ProviderLocation "Microsoft.Sql/virtualclusters"
71+
$rg = Create-ResourceGroupForTest $location
72+
73+
$rgName = $rg.ResourceGroupName
74+
$vnetName = "cl_initial"
75+
$subnetName = "Cool"
76+
77+
# Setup VNET
78+
$virtualNetwork = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $location $rgName
79+
$subnetId = $virtualNetwork.Subnets.where({ $_.Name -eq $subnetName })[0].Id
80+
81+
$managedInstance = Create-ManagedInstanceForTest $rg $subnetId
82+
83+
try
84+
{
85+
$virtualClusterList = Get-AzSqlVirtualCluster -ResourceGroupName $rgName
86+
$virtualCluster = $virtualClusterList.where({$_.SubnetId -eq $subnetId})
87+
$virtualClusterName = $virtualCluster.VirtualClusterName
88+
89+
# Remove the managed instance first
90+
$managedInstance | Remove-AzSqlInstance -Force
91+
92+
# Remove virtual cluster
93+
$virtualCluster | Remove-AzSqlVirtualCluster
94+
95+
$all = Get-AzSqlVirtualCluster -ResourceGroupName $rgName
96+
$virtualCluster = $all.where({$_.VirtualClusterName -eq $virtualClusterName})
97+
Assert-AreEqual $virtualCluster.Count 0
98+
}
99+
finally
100+
{
101+
Remove-ResourceGroupForTest $rg
102+
}
103+
}

src/Sql/Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.VirtualClusterCrudScenarioTests/TestGetVirtualCluster.json

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

src/Sql/Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.VirtualClusterCrudScenarioTests/TestRemoveVirtualCluster.json

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

src/Sql/Sql.Test/Sql.Test.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.Sql" Version="1.28.0-preview" />
14+
<PackageReference Include="Microsoft.Azure.Management.Sql" Version="1.29.0-preview" />
1515
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.3.0" />
1616
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.10.0-preview" />
1717
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.2.0-preview" />

src/Sql/Sql/Az.Sql.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ CmdletsToExport = 'Get-AzSqlDatabaseTransparentDataEncryption',
217217
'Remove-AzSqlDatabaseSensitivityClassification',
218218
'Remove-AzSqlInstanceDatabaseSensitivityClassification',
219219
'Get-AzSqlDatabaseSensitivityRecommendation',
220-
'Get-AzSqlInstanceDatabaseSensitivityRecommendation'
220+
'Get-AzSqlInstanceDatabaseSensitivityRecommendation',
221+
'Get-AzSqlVirtualCluster', 'Remove-AzSqlVirtualCluster'
221222

222223
# Variables to export from this module
223224
# VariablesToExport = @()

src/Sql/Sql/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
## Version 1.8.0
2525
* Support Database Data Classification.
26+
* Add Get/Remove AzSqlVirtualCluster cmdlets.
2627

2728
## Version 1.7.0
2829
* Add Vulnerability Assessment cmdlets on Server and Managed Instance

src/Sql/Sql/Sql.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.Sql" Version="1.28.0-preview" />
14+
<PackageReference Include="Microsoft.Azure.Management.Sql" Version="1.29.0-preview" />
1515
<PackageReference Include="System.Security.Permissions" Version="4.5.0" />
1616
<PackageReference Include="Microsoft.Azure.Management.Monitor" Version="0.21.0-preview" />
1717
</ItemGroup>

0 commit comments

Comments
 (0)