Skip to content

Commit 36ddc25

Browse files
[AppService] Fix KeyVaultId deserialization in AppCertificateData/AppCertificatePatch (Azure#34324)
1 parent 69d0604 commit 36ddc25

File tree

10 files changed

+865
-526
lines changed

10 files changed

+865
-526
lines changed

sdk/websites/Azure.ResourceManager.AppService/Azure.ResourceManager.AppService.sln

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio Version 16
3-
VisualStudioVersion = 16.0.30114.105
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.4.33213.308
44
MinimumVisualStudioVersion = 15.0.26124.0
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.AppService", "src\Azure.ResourceManager.AppService.csproj", "{34F1E6F5-F5E7-4F8E-A26B-56EB03E7C15C}"
66
EndProject
@@ -44,18 +44,6 @@ Global
4444
{738C0769-57F8-439C-8078-54498A030BA0}.Release|x64.Build.0 = Release|Any CPU
4545
{738C0769-57F8-439C-8078-54498A030BA0}.Release|x86.ActiveCfg = Release|Any CPU
4646
{738C0769-57F8-439C-8078-54498A030BA0}.Release|x86.Build.0 = Release|Any CPU
47-
{EF7D6C71-0600-4A71-BEC9-297DAF6C7966}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
48-
{EF7D6C71-0600-4A71-BEC9-297DAF6C7966}.Debug|Any CPU.Build.0 = Debug|Any CPU
49-
{EF7D6C71-0600-4A71-BEC9-297DAF6C7966}.Debug|x64.ActiveCfg = Debug|Any CPU
50-
{EF7D6C71-0600-4A71-BEC9-297DAF6C7966}.Debug|x64.Build.0 = Debug|Any CPU
51-
{EF7D6C71-0600-4A71-BEC9-297DAF6C7966}.Debug|x86.ActiveCfg = Debug|Any CPU
52-
{EF7D6C71-0600-4A71-BEC9-297DAF6C7966}.Debug|x86.Build.0 = Debug|Any CPU
53-
{EF7D6C71-0600-4A71-BEC9-297DAF6C7966}.Release|Any CPU.ActiveCfg = Release|Any CPU
54-
{EF7D6C71-0600-4A71-BEC9-297DAF6C7966}.Release|Any CPU.Build.0 = Release|Any CPU
55-
{EF7D6C71-0600-4A71-BEC9-297DAF6C7966}.Release|x64.ActiveCfg = Release|Any CPU
56-
{EF7D6C71-0600-4A71-BEC9-297DAF6C7966}.Release|x64.Build.0 = Release|Any CPU
57-
{EF7D6C71-0600-4A71-BEC9-297DAF6C7966}.Release|x86.ActiveCfg = Release|Any CPU
58-
{EF7D6C71-0600-4A71-BEC9-297DAF6C7966}.Release|x86.Build.0 = Release|Any CPU
5947
{DF15D10D-3646-447E-B00B-49506D142322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6048
{DF15D10D-3646-447E-B00B-49506D142322}.Debug|Any CPU.Build.0 = Debug|Any CPU
6149
{DF15D10D-3646-447E-B00B-49506D142322}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -68,6 +56,18 @@ Global
6856
{DF15D10D-3646-447E-B00B-49506D142322}.Release|x64.Build.0 = Release|Any CPU
6957
{DF15D10D-3646-447E-B00B-49506D142322}.Release|x86.ActiveCfg = Release|Any CPU
7058
{DF15D10D-3646-447E-B00B-49506D142322}.Release|x86.Build.0 = Release|Any CPU
59+
{C5B419AD-A4F3-45D1-AD7E-6D85595169A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
60+
{C5B419AD-A4F3-45D1-AD7E-6D85595169A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
61+
{C5B419AD-A4F3-45D1-AD7E-6D85595169A8}.Debug|x64.ActiveCfg = Debug|Any CPU
62+
{C5B419AD-A4F3-45D1-AD7E-6D85595169A8}.Debug|x64.Build.0 = Debug|Any CPU
63+
{C5B419AD-A4F3-45D1-AD7E-6D85595169A8}.Debug|x86.ActiveCfg = Debug|Any CPU
64+
{C5B419AD-A4F3-45D1-AD7E-6D85595169A8}.Debug|x86.Build.0 = Debug|Any CPU
65+
{C5B419AD-A4F3-45D1-AD7E-6D85595169A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
66+
{C5B419AD-A4F3-45D1-AD7E-6D85595169A8}.Release|Any CPU.Build.0 = Release|Any CPU
67+
{C5B419AD-A4F3-45D1-AD7E-6D85595169A8}.Release|x64.ActiveCfg = Release|Any CPU
68+
{C5B419AD-A4F3-45D1-AD7E-6D85595169A8}.Release|x64.Build.0 = Release|Any CPU
69+
{C5B419AD-A4F3-45D1-AD7E-6D85595169A8}.Release|x86.ActiveCfg = Release|Any CPU
70+
{C5B419AD-A4F3-45D1-AD7E-6D85595169A8}.Release|x86.Build.0 = Release|Any CPU
7171
EndGlobalSection
7272
GlobalSection(SolutionProperties) = preSolution
7373
HideSolutionNode = FALSE

sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Release History
22

3-
## 1.1.0-beta.1 (Unreleased)
4-
5-
### Features Added
6-
7-
### Breaking Changes
3+
## 1.0.1 (2023-02-20)
84

95
### Bugs Fixed
106

7+
- Fixed serialization issue when service returns empty string for `KeyVaultId` in `AppCertificateData` and `AppCertificatePatch`.
8+
119
### Other Changes
1210

11+
- Upgraded dependent `Azure.Core` to `1.28.0`.
12+
- Upgraded dependent `Azure.ResourceManager` to `1.4.0`.
13+
1314
## 1.0.0 (2022-09-29)
1415

1516
This release is the first stable release of the AppService Management library.
@@ -205,4 +206,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur
205206

206207
This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues).
207208

208-
> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet).
209+
> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet).

sdk/websites/Azure.ResourceManager.AppService/src/Azure.ResourceManager.AppService.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<Version>1.1.0-beta.1</Version>
3+
<Version>1.0.1</Version>
44
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
55
<ApiCompatVersion>1.0.0</ApiCompatVersion>
66
<PackageId>Azure.ResourceManager.AppService</PackageId>
Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System;
7+
using System.Collections.Generic;
8+
using System.Text.Json;
9+
using Azure.Core;
10+
using Azure.ResourceManager.AppService.Models;
11+
using Azure.ResourceManager.Models;
12+
13+
namespace Azure.ResourceManager.AppService
14+
{
15+
public partial class AppCertificateData : IUtf8JsonSerializable
16+
{
17+
internal static AppCertificateData DeserializeAppCertificateData(JsonElement element)
18+
{
19+
Optional<string> kind = default;
20+
Optional<IDictionary<string, string>> tags = default;
21+
AzureLocation location = default;
22+
ResourceIdentifier id = default;
23+
string name = default;
24+
ResourceType type = default;
25+
Optional<SystemData> systemData = default;
26+
Optional<string> password = default;
27+
Optional<string> friendlyName = default;
28+
Optional<string> subjectName = default;
29+
Optional<IList<string>> hostNames = default;
30+
Optional<byte[]> pfxBlob = default;
31+
Optional<string> siteName = default;
32+
Optional<string> selfLink = default;
33+
Optional<string> issuer = default;
34+
Optional<DateTimeOffset> issueDate = default;
35+
Optional<DateTimeOffset> expirationDate = default;
36+
Optional<BinaryData> thumbprint = default;
37+
Optional<bool> valid = default;
38+
Optional<byte[]> cerBlob = default;
39+
Optional<string> publicKeyHash = default;
40+
Optional<HostingEnvironmentProfile> hostingEnvironmentProfile = default;
41+
Optional<ResourceIdentifier> keyVaultId = default;
42+
Optional<string> keyVaultSecretName = default;
43+
Optional<KeyVaultSecretStatus> keyVaultSecretStatus = default;
44+
Optional<ResourceIdentifier> serverFarmId = default;
45+
Optional<string> canonicalName = default;
46+
Optional<string> domainValidationMethod = default;
47+
foreach (var property in element.EnumerateObject())
48+
{
49+
if (property.NameEquals("kind"u8))
50+
{
51+
kind = property.Value.GetString();
52+
continue;
53+
}
54+
if (property.NameEquals("tags"u8))
55+
{
56+
if (property.Value.ValueKind == JsonValueKind.Null)
57+
{
58+
property.ThrowNonNullablePropertyIsNull();
59+
continue;
60+
}
61+
Dictionary<string, string> dictionary = new Dictionary<string, string>();
62+
foreach (var property0 in property.Value.EnumerateObject())
63+
{
64+
dictionary.Add(property0.Name, property0.Value.GetString());
65+
}
66+
tags = dictionary;
67+
continue;
68+
}
69+
if (property.NameEquals("location"u8))
70+
{
71+
location = new AzureLocation(property.Value.GetString());
72+
continue;
73+
}
74+
if (property.NameEquals("id"u8))
75+
{
76+
id = new ResourceIdentifier(property.Value.GetString());
77+
continue;
78+
}
79+
if (property.NameEquals("name"u8))
80+
{
81+
name = property.Value.GetString();
82+
continue;
83+
}
84+
if (property.NameEquals("type"u8))
85+
{
86+
type = new ResourceType(property.Value.GetString());
87+
continue;
88+
}
89+
if (property.NameEquals("systemData"u8))
90+
{
91+
if (property.Value.ValueKind == JsonValueKind.Null)
92+
{
93+
property.ThrowNonNullablePropertyIsNull();
94+
continue;
95+
}
96+
systemData = JsonSerializer.Deserialize<SystemData>(property.Value.GetRawText());
97+
continue;
98+
}
99+
if (property.NameEquals("properties"u8))
100+
{
101+
if (property.Value.ValueKind == JsonValueKind.Null)
102+
{
103+
property.ThrowNonNullablePropertyIsNull();
104+
continue;
105+
}
106+
foreach (var property0 in property.Value.EnumerateObject())
107+
{
108+
if (property0.NameEquals("password"u8))
109+
{
110+
password = property0.Value.GetString();
111+
continue;
112+
}
113+
if (property0.NameEquals("friendlyName"u8))
114+
{
115+
friendlyName = property0.Value.GetString();
116+
continue;
117+
}
118+
if (property0.NameEquals("subjectName"u8))
119+
{
120+
subjectName = property0.Value.GetString();
121+
continue;
122+
}
123+
if (property0.NameEquals("hostNames"u8))
124+
{
125+
if (property0.Value.ValueKind == JsonValueKind.Null)
126+
{
127+
property0.ThrowNonNullablePropertyIsNull();
128+
continue;
129+
}
130+
List<string> array = new List<string>();
131+
foreach (var item in property0.Value.EnumerateArray())
132+
{
133+
array.Add(item.GetString());
134+
}
135+
hostNames = array;
136+
continue;
137+
}
138+
if (property0.NameEquals("pfxBlob"u8))
139+
{
140+
if (property0.Value.ValueKind == JsonValueKind.Null)
141+
{
142+
property0.ThrowNonNullablePropertyIsNull();
143+
continue;
144+
}
145+
pfxBlob = property0.Value.GetBytesFromBase64("D");
146+
continue;
147+
}
148+
if (property0.NameEquals("siteName"u8))
149+
{
150+
siteName = property0.Value.GetString();
151+
continue;
152+
}
153+
if (property0.NameEquals("selfLink"u8))
154+
{
155+
selfLink = property0.Value.GetString();
156+
continue;
157+
}
158+
if (property0.NameEquals("issuer"u8))
159+
{
160+
issuer = property0.Value.GetString();
161+
continue;
162+
}
163+
if (property0.NameEquals("issueDate"u8))
164+
{
165+
if (property0.Value.ValueKind == JsonValueKind.Null)
166+
{
167+
property0.ThrowNonNullablePropertyIsNull();
168+
continue;
169+
}
170+
issueDate = property0.Value.GetDateTimeOffset("O");
171+
continue;
172+
}
173+
if (property0.NameEquals("expirationDate"u8))
174+
{
175+
if (property0.Value.ValueKind == JsonValueKind.Null)
176+
{
177+
property0.ThrowNonNullablePropertyIsNull();
178+
continue;
179+
}
180+
expirationDate = property0.Value.GetDateTimeOffset("O");
181+
continue;
182+
}
183+
if (property0.NameEquals("thumbprint"u8))
184+
{
185+
if (property0.Value.ValueKind == JsonValueKind.Null)
186+
{
187+
property0.ThrowNonNullablePropertyIsNull();
188+
continue;
189+
}
190+
thumbprint = BinaryData.FromString(property0.Value.GetRawText());
191+
continue;
192+
}
193+
if (property0.NameEquals("valid"u8))
194+
{
195+
if (property0.Value.ValueKind == JsonValueKind.Null)
196+
{
197+
property0.ThrowNonNullablePropertyIsNull();
198+
continue;
199+
}
200+
valid = property0.Value.GetBoolean();
201+
continue;
202+
}
203+
if (property0.NameEquals("cerBlob"u8))
204+
{
205+
if (property0.Value.ValueKind == JsonValueKind.Null)
206+
{
207+
property0.ThrowNonNullablePropertyIsNull();
208+
continue;
209+
}
210+
cerBlob = property0.Value.GetBytesFromBase64("D");
211+
continue;
212+
}
213+
if (property0.NameEquals("publicKeyHash"u8))
214+
{
215+
publicKeyHash = property0.Value.GetString();
216+
continue;
217+
}
218+
if (property0.NameEquals("hostingEnvironmentProfile"u8))
219+
{
220+
if (property0.Value.ValueKind == JsonValueKind.Null)
221+
{
222+
property0.ThrowNonNullablePropertyIsNull();
223+
continue;
224+
}
225+
hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value);
226+
continue;
227+
}
228+
if (property0.NameEquals("keyVaultId"u8))
229+
{
230+
if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.GetString().Length == 0)
231+
{
232+
property0.ThrowNonNullablePropertyIsNull();
233+
continue;
234+
}
235+
keyVaultId = new ResourceIdentifier(property0.Value.GetString());
236+
continue;
237+
}
238+
if (property0.NameEquals("keyVaultSecretName"u8))
239+
{
240+
keyVaultSecretName = property0.Value.GetString();
241+
continue;
242+
}
243+
if (property0.NameEquals("keyVaultSecretStatus"u8))
244+
{
245+
if (property0.Value.ValueKind == JsonValueKind.Null)
246+
{
247+
property0.ThrowNonNullablePropertyIsNull();
248+
continue;
249+
}
250+
keyVaultSecretStatus = property0.Value.GetString().ToKeyVaultSecretStatus();
251+
continue;
252+
}
253+
if (property0.NameEquals("serverFarmId"u8))
254+
{
255+
if (property0.Value.ValueKind == JsonValueKind.Null)
256+
{
257+
property0.ThrowNonNullablePropertyIsNull();
258+
continue;
259+
}
260+
serverFarmId = new ResourceIdentifier(property0.Value.GetString());
261+
continue;
262+
}
263+
if (property0.NameEquals("canonicalName"u8))
264+
{
265+
canonicalName = property0.Value.GetString();
266+
continue;
267+
}
268+
if (property0.NameEquals("domainValidationMethod"u8))
269+
{
270+
domainValidationMethod = property0.Value.GetString();
271+
continue;
272+
}
273+
}
274+
continue;
275+
}
276+
}
277+
return new AppCertificateData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, password.Value, friendlyName.Value, subjectName.Value, Optional.ToList(hostNames), pfxBlob.Value, siteName.Value, selfLink.Value, issuer.Value, Optional.ToNullable(issueDate), Optional.ToNullable(expirationDate), thumbprint.Value, Optional.ToNullable(valid), cerBlob.Value, publicKeyHash.Value, hostingEnvironmentProfile.Value, keyVaultId.Value, keyVaultSecretName.Value, Optional.ToNullable(keyVaultSecretStatus), serverFarmId.Value, canonicalName.Value, domainValidationMethod.Value, kind.Value);
278+
}
279+
}
280+
}

0 commit comments

Comments
 (0)