Skip to content

Commit 9af607a

Browse files
authored
Merge branch 'main' into mitryakh/network-may-22
2 parents 903df83 + fb24126 commit 9af607a

File tree

2,151 files changed

+409888
-123318
lines changed

Some content is hidden

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

2,151 files changed

+409888
-123318
lines changed

.azure-pipelines/code-gen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ parameters:
88
- name: ServiceName
99
displayName: Service to generate
1010
type: string
11-
default: null
11+
default: Databricks
1212

1313
resources:
1414
repositories:

.azure-pipelines/sync-tools-folder.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,36 @@ jobs:
3838
script: >-
3939
./tools/SyncFromMainBranch.ps1 -BranchName $(BranchName) -GithubToken $(GithubToken)
4040
pwsh: true
41+
42+
- pwsh: |
43+
$Headers = @{"Accept" = "application/vnd.github+json"; "Authorization" = "Bearer $(GithubToken)"}
44+
$PrBody = @'
45+
<!-- DO NOT DELETE THIS TEMPLATE -->
46+
47+
## Description
48+
49+
<!-- Please add a brief description of the changes made in this PR. If you have an ongoing or finished cmdlet design, please paste the link below. -->
50+
51+
## Checklist
52+
53+
- [x] Check this box to confirm: **I have read the [_Submitting Changes_](../blob/main/CONTRIBUTING.md#submitting-changes) section of [`CONTRIBUTING.md`](../blob/main/CONTRIBUTING.md) and reviewed the following information:**
54+
55+
* **SHOULD** select appropriate branch. Cmdlets from Autorest.PowerShell should go to [`generation`](https://github.com/Azure/azure-powershell/tree/generation) branch.
56+
* **SHOULD** make the title of PR clear and informative, and in the present imperative tense.
57+
* **SHOULD** update `ChangeLog.md` file(s) appropriately
58+
* For any service, the `ChangeLog.md` file can be found at `src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md`
59+
* A snippet outlining the change(s) made in the PR should be written under the `## Upcoming Release` header in the past tense. Add changelog in description section if PR goes into [`generation`](https://github.com/Azure/azure-powershell/tree/generation) branch.
60+
* Should **not** change `ChangeLog.md` if no new release is required, such as fixing test case only.
61+
* **SHOULD** have approved design review for the changes in [this repository](https://github.com/Azure/azure-powershell-cmdlet-review-pr) ([_Microsoft internal only_](../blob/main/CONTRIBUTING.md#onboarding)) with following situations
62+
* Create new module from scratch
63+
* Create new resource types which are not easy to conform to [Azure PowerShell Design Guidelines](../blob/main/documentation/development-docs/design-guidelines)
64+
* Create new resource type which name doesn't use module name as prefix
65+
* Have design question before implementation
66+
* **SHOULD** regenerate markdown help files if there is cmdlet API change. [Instruction](../blob/main/documentation/development-docs/help-generation.md#updating-all-markdown-files-in-a-module)
67+
* **SHOULD** have proper test coverage for changes in pull request.
68+
* **SHOULD NOT** introduce [breaking changes](../blob/main/documentation/breaking-changes/breaking-changes-definition.md) in Az minor release except preview version.
69+
* **SHOULD NOT** adjust version of module manually in pull request
70+
'@
71+
$RequestBody = @{"title" = "Sync tools code from main branch to generation branch"; "body" = $PrBody; "head" = "syncToolsFolder-generation"; "base" = "generation" }
72+
Invoke-WebRequest -Uri https://api.github.com/repos/Azure/azure-powershell/pulls -method POST -Headers $Headers -Body ($RequestBody | ConvertTo-Json)
73+
displayName: Create PR to generation branch

src/ApiManagement/ApiManagement/ApiManagementClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public PsApiManagement CreateApiManagementService(
129129
string administratorEmail,
130130
Dictionary<string, string> tags,
131131
bool enableClientCertificate,
132-
PsApiManagementSku sku = PsApiManagementSku.Developer,
132+
string sku = SkuType.Developer,
133133
int? capacity = null,
134134
PsApiManagementVpnType vpnType = PsApiManagementVpnType.None,
135135
PsApiManagementVirtualNetwork virtualNetwork = null,
@@ -149,7 +149,7 @@ public PsApiManagement CreateApiManagementService(
149149

150150
if(capacity == null)
151151
{
152-
capacity = (sku == PsApiManagementSku.Consumption ? 0 : 1);
152+
capacity = (sku == SkuType.Consumption ? 0 : 1);
153153
}
154154

155155
var skuProperties = new ApiManagementServiceSkuProperties(skuType, capacity.Value);

src/ApiManagement/ApiManagement/ChangeLog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
*[Breaking Change]: changed the type of parameter Sku from Enum to String in `Add-AzApiManagementRegion`
22+
and `New-AzApiManagement` and `Update-AzApiManagementRegion`.
2123

2224
## Version 3.0.1
23-
* Added warning message for upcoming breaking change: changed the type of parameter Sku from Enum to String
2425
* Supported GraphQL Specification Format
2526

2627
## Version 3.0.0

src/ApiManagement/ApiManagement/Commands/AddAzureApiManagementRegion.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace Microsoft.Azure.Commands.ApiManagement.Commands
1818
using System;
1919
using System.Management.Automation;
2020
using Microsoft.Azure.Commands.ApiManagement.Models;
21+
using Microsoft.Azure.Management.ApiManagement.Models;
2122
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2223
using ResourceManager.Common.ArgumentCompleters;
2324

@@ -39,12 +40,7 @@ public class AddAzureApiManagementRegion : AzureApiManagementCmdletBase
3940
[ValidateNotNullOrEmpty]
4041
public string Location { get; set; }
4142

42-
[CmdletParameterBreakingChange("Sku", OldParamaterType = typeof(PsApiManagementSku), NewParameterTypeName = nameof(String))]
43-
[Parameter(
44-
ValueFromPipelineByPropertyName = false,
45-
Mandatory = false,
46-
HelpMessage = "Tier of the deployment region. Valid and Default value is Premium.")]
47-
public PsApiManagementSku? Sku { get; set; }
43+
4844

4945
[Parameter(
5046
ValueFromPipelineByPropertyName = false,
@@ -76,14 +72,20 @@ public class AddAzureApiManagementRegion : AzureApiManagementCmdletBase
7672
[Parameter(Mandatory = false, HelpMessage = "Standard SKU PublicIpAddress ResoureId for integration into stv2 Virtual Network Deployments")]
7773
public string PublicIpAddressId { get; set; }
7874

75+
[Parameter(
76+
ValueFromPipelineByPropertyName = false,
77+
Mandatory = false,
78+
HelpMessage = "Tier of the deployment region. Valid and Default value is Premium.")]
79+
public string Sku { get; set; }
80+
7981
public override void ExecuteCmdlet()
8082
{
8183
ExecuteCmdLetWrap(
8284
() =>
8385
{
8486
ApiManagement.AddRegion(
8587
Location,
86-
Sku ?? PsApiManagementSku.Premium,
88+
Sku ?? SkuType.Premium,
8789
Capacity ?? 1,
8890
VirtualNetwork,
8991
Zone,

src/ApiManagement/ApiManagement/Commands/NewAzureApiManagement.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace Microsoft.Azure.Commands.ApiManagement.Commands
2020
using System.Management.Automation;
2121
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2222
using System;
23+
using Microsoft.Azure.Management.ApiManagement.Models;
2324

2425
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagement"), OutputType(typeof(PsApiManagement))]
2526
public class NewAzureApiManagement : AzureApiManagementCmdletBase
@@ -60,13 +61,12 @@ public class NewAzureApiManagement : AzureApiManagementCmdletBase
6061
[ValidatePattern(@"^[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)*@([a-zA-Z0-9_]+[a-zA-Z0-9_-]*\.)+[a-zA-Z]{2,63}$")]
6162
public string AdminEmail { get; set; }
6263

63-
[CmdletParameterBreakingChange("Sku", OldParamaterType = typeof(PsApiManagementSku), NewParameterTypeName = nameof(String))]
6464
[Parameter(
6565
ValueFromPipelineByPropertyName = true,
6666
Mandatory = false,
6767
HelpMessage = "The tier of the Azure API Management service. Valid values are Developer, Basic, Standard, Premium and Consumption. The default value is Developer. ")]
6868
[ValidateSet("Developer", "Basic", "Standard", "Premium", "Consumption"), PSDefaultValue(Value = "Developer")]
69-
public PsApiManagementSku? Sku { get; set; }
69+
public string Sku { get; set; }
7070

7171
[Parameter(
7272
ValueFromPipelineByPropertyName = true,
@@ -173,7 +173,7 @@ public override void ExecuteCmdlet()
173173
AdminEmail,
174174
Tag,
175175
EnableClientCertificate.IsPresent,
176-
Sku ?? PsApiManagementSku.Developer,
176+
Sku ?? SkuType.Developer,
177177
Capacity,
178178
VpnType,
179179
VirtualNetwork,

src/ApiManagement/ApiManagement/Commands/NewAzureApiManagementRegion.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
namespace Microsoft.Azure.Commands.ApiManagement.Commands
1717
{
1818
using Microsoft.Azure.Commands.ApiManagement.Models;
19+
using Microsoft.Azure.Management.ApiManagement.Models;
1920
using ResourceManager.Common;
2021
using ResourceManager.Common.ArgumentCompleters;
2122
using System.Management.Automation;
@@ -67,7 +68,7 @@ public override void ExecuteCmdlet()
6768
new PsApiManagementRegion
6869
{
6970
Location = Location,
70-
Sku = PsApiManagementSku.Premium, // additional regions are only supported in Premium Sku
71+
Sku = SkuType.Premium, // additional regions are only supported in Premium Sku
7172
Capacity = Capacity.HasValue ? Capacity.Value : 1,
7273
VirtualNetwork = VirtualNetwork,
7374
Zone = Zone,

src/ApiManagement/ApiManagement/Commands/UpdateAzureApiManagementRegion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class UpdateAzureApiManagementRegion : AzureApiManagementCmdletBase
4444
ValueFromPipelineByPropertyName = true,
4545
Mandatory = true,
4646
HelpMessage = "New tier value for the deployment region. Valid values are Developer, Standard and Premium.")]
47-
public PsApiManagementSku Sku { get; set; }
47+
public string Sku { get; set; }
4848

4949
[Parameter(
5050
ValueFromPipelineByPropertyName = true,

src/ApiManagement/ApiManagement/Helpers/Mappers.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,30 @@ public static PsApiManagementHostnameType MapHostnameType(string hostnameType)
4949
}
5050
}
5151

52-
public static string MapSku(PsApiManagementSku sku)
52+
//public static string MapSku(string sku)
53+
//{
54+
// switch (sku)
55+
// {
56+
// case PsApiManagementSku.Developer: return SkuType.Developer;
57+
// case PsApiManagementSku.Standard: return SkuType.Standard;
58+
// case PsApiManagementSku.Premium: return SkuType.Premium;
59+
// case PsApiManagementSku.Basic: return SkuType.Basic;
60+
// case PsApiManagementSku.Consumption: return SkuType.Consumption;
61+
// case PsApiManagementSku.Isolated: return SkuType.Isolated;
62+
// default: throw new ArgumentException($"Unrecognized Sku '{sku.ToString()}'");
63+
// }
64+
//}
65+
66+
public static string MapSku(string sku)
5367
{
5468
switch (sku)
5569
{
56-
case PsApiManagementSku.Developer: return SkuType.Developer;
57-
case PsApiManagementSku.Standard: return SkuType.Standard;
58-
case PsApiManagementSku.Premium: return SkuType.Premium;
59-
case PsApiManagementSku.Basic: return SkuType.Basic;
60-
case PsApiManagementSku.Consumption: return SkuType.Consumption;
61-
case PsApiManagementSku.Isolated: return SkuType.Isolated;
62-
default: throw new ArgumentException($"Unrecognized Sku '{sku.ToString()}'");
63-
}
64-
}
65-
66-
public static PsApiManagementSku MapSku(string sku)
67-
{
68-
switch (sku)
69-
{
70-
case SkuType.Developer: return PsApiManagementSku.Developer;
71-
case SkuType.Standard: return PsApiManagementSku.Standard;
72-
case SkuType.Premium: return PsApiManagementSku.Premium;
73-
case SkuType.Basic: return PsApiManagementSku.Basic;
74-
case SkuType.Consumption: return PsApiManagementSku.Consumption;
75-
case SkuType.Isolated: return PsApiManagementSku.Isolated;
70+
case SkuType.Developer: return SkuType.Developer;
71+
case SkuType.Standard: return SkuType.Standard;
72+
case SkuType.Premium: return SkuType.Premium;
73+
case SkuType.Basic: return SkuType.Basic;
74+
case SkuType.Consumption: return SkuType.Consumption;
75+
case SkuType.Isolated: return SkuType.Isolated;
7676
default: throw new ArgumentException($"Unrecognized Sku '{sku}'");
7777
}
7878
}

src/ApiManagement/ApiManagement/Models/PsApiManagement.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public PsApiManagement(ApiManagementServiceResource apiServiceResource)
4444
Id = apiServiceResource.Id;
4545
Name = apiServiceResource.Name;
4646
Location = apiServiceResource.Location;
47-
Sku = ApiManagementClient.Mapper.Map<string, PsApiManagementSku>(apiServiceResource.Sku.Name);
47+
Sku = ApiManagementClient.Mapper.Map<string, string>(apiServiceResource.Sku.Name);
4848
Capacity = apiServiceResource.Sku.Capacity;
4949
CreatedTimeUtc = apiServiceResource.CreatedAtUtc;
5050
PublisherEmail = apiServiceResource.PublisherEmail;
@@ -162,7 +162,7 @@ public PsApiManagement(ApiManagementServiceResource apiServiceResource)
162162
public string Location { get; private set; }
163163

164164
[CmdletParameterBreakingChange("Sku", OldParamaterType = typeof(PsApiManagementSku), NewParameterTypeName = nameof(String))]
165-
public PsApiManagementSku Sku { get; set; }
165+
public string Sku { get; set; }
166166

167167
public int Capacity { get; set; }
168168

@@ -258,7 +258,7 @@ public string ResourceGroupName
258258

259259
public PsApiManagementRegion AddRegion(
260260
string location,
261-
PsApiManagementSku sku = PsApiManagementSku.Developer,
261+
string sku = SkuType.Developer,
262262
int capacity = 1,
263263
PsApiManagementVirtualNetwork virtualNetwork = null,
264264
string[] zone = null,
@@ -312,7 +312,7 @@ public bool RemoveRegion(string location)
312312

313313
public void UpdateRegion(
314314
string location,
315-
PsApiManagementSku sku,
315+
string sku,
316316
int capacity,
317317
PsApiManagementVirtualNetwork virtualNetwork,
318318
string[] zone,
@@ -327,7 +327,7 @@ public void UpdateRegion(
327327
var regionToUpdate = AdditionalRegions.FirstOrDefault(r => location.Trim().Equals(r.Location, StringComparison.OrdinalIgnoreCase));
328328
if (regionToUpdate != null)
329329
{
330-
// if this is additional region
330+
// if this is additional region
331331
regionToUpdate.Sku = sku;
332332
regionToUpdate.Capacity = capacity;
333333
regionToUpdate.VirtualNetwork = virtualNetwork;

src/ApiManagement/ApiManagement/Models/PsApiManagementRegion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ internal PsApiManagementRegion(AdditionalLocation additionalLocation)
5959
public int Capacity { get; set; }
6060

6161
[CmdletParameterBreakingChange("Sku", OldParamaterType = typeof(PsApiManagementSku), NewParameterTypeName = nameof(String))]
62-
public PsApiManagementSku Sku { get; set; }
62+
public string Sku { get; set; }
6363

6464
public string Location { get; set; }
6565

src/ApiManagement/ApiManagement/help/New-AzApiManagement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Creates an API Management deployment.
1616

1717
```
1818
New-AzApiManagement -ResourceGroupName <String> -Name <String> -Location <String> -Organization <String>
19-
-AdminEmail <String> [-Sku <PsApiManagementSku>] [-Capacity <Int32>] [-VpnType <PsApiManagementVpnType>]
19+
-AdminEmail <String> [-Sku <string>] [-Capacity <Int32>] [-VpnType <PsApiManagementVpnType>]
2020
[-VirtualNetwork <PsApiManagementVirtualNetwork>]
2121
[-Tag <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
2222
[-AdditionalRegions <PsApiManagementRegion[]>]

src/ApiManagement/ApiManagement/help/Update-AzApiManagementRegion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Updates existing deployment region in PsApiManagement instance.
1414
## SYNTAX
1515

1616
```
17-
Update-AzApiManagementRegion -ApiManagement <PsApiManagement> -Location <String> -Sku <PsApiManagementSku>
17+
Update-AzApiManagementRegion -ApiManagement <PsApiManagement> -Location <String> -Sku <string>
1818
-Capacity <Int32> [-VirtualNetwork <PsApiManagementVirtualNetwork>] [-Zone <String[]>]
1919
[-DisableGateway <Boolean>] [-PublicIpAddressId <String>] [-DefaultProfile <IAzureContextContainer>]
2020
[<CommonParameters>]

src/EventGrid/EventGrid.Test/ScenarioTests/EventSubscriptionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public EventSubscriptionTests(ITestOutputHelper output) : base(output)
2525
{
2626
}
2727

28-
[Fact]
28+
[Fact(Skip = "ServiceBus is generated now. Cannot be recorded now.")]
2929
[Trait(Category.AcceptanceType, Category.CheckIn)]
3030
public void EventGrid_EventSubscription_CustomTopics()
3131
{
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<PsModuleName>EventHub</PsModuleName>
4+
<PsRootModuleName>EventHub</PsRootModuleName>
5+
<PsModuleFolder>EventHub.Autorest</PsModuleFolder>
6+
</PropertyGroup>
7+
8+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.autorest.hybrid.props" />
9+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.Post.props" />
10+
</Project>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="utf-16"?>
2+
<Configuration>
3+
<ViewDefinitions>
4+
<View>
5+
<Name>Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.SchemaGroupProperties</Name>
6+
<ViewSelectedBy>
7+
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.SchemaGroupProperties</TypeName>
8+
</ViewSelectedBy>
9+
<TableControl>
10+
<TableHeaders>
11+
<TableColumnHeader>
12+
<Label>Item</Label>
13+
</TableColumnHeader>
14+
</TableHeaders>
15+
<TableRowEntries>
16+
<TableRowEntry>
17+
<TableColumnItems>
18+
<TableColumnItem>
19+
<PropertyName>Item</PropertyName>
20+
</TableColumnItem>
21+
</TableColumnItems>
22+
</TableRowEntry>
23+
</TableRowEntries>
24+
</TableControl>
25+
</View>
26+
<View>
27+
<Name>Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api10.TrackedResourceTags</Name>
28+
<ViewSelectedBy>
29+
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api10.TrackedResourceTags</TypeName>
30+
</ViewSelectedBy>
31+
<TableControl>
32+
<TableHeaders>
33+
<TableColumnHeader>
34+
<Label>Item</Label>
35+
</TableColumnHeader>
36+
</TableHeaders>
37+
<TableRowEntries>
38+
<TableRowEntry>
39+
<TableColumnItems>
40+
<TableColumnItem>
41+
<PropertyName>Item</PropertyName>
42+
</TableColumnItem>
43+
</TableColumnItems>
44+
</TableRowEntry>
45+
</TableRowEntries>
46+
</TableControl>
47+
</View>
48+
</ViewDefinitions>
49+
</Configuration>

0 commit comments

Comments
 (0)