Skip to content

Commit 55da2b4

Browse files
NoriZCVeryEarly
andauthored
[Az.Resources] Do not error out when AppId is null (#25110)
* Update ActiveDirectoryClientExtensions.cs * Update PSADServicePrincipal.cs * Update src/Resources/Resources/ActiveDirectory/Models/ActiveDirectoryClientExtensions.cs Co-authored-by: Yabo Hu <[email protected]> --------- Co-authored-by: Yabo Hu <[email protected]>
1 parent 19b7589 commit 55da2b4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Resources/Resources/ActiveDirectory/Models/ActiveDirectoryClientExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static PSADServicePrincipal ToPSADServicePrincipal(this MicrosoftGraphSer
103103
DisplayName = servicePrincipal.DisplayName,
104104
Id = servicePrincipal.Id,
105105
DeletionTimestamp = servicePrincipal.DeletedDateTime,
106-
ApplicationId = Guid.Parse(servicePrincipal.AppId),
106+
ApplicationId = String.IsNullOrEmpty(servicePrincipal.AppId)? (Guid?)null : Guid.Parse(servicePrincipal.AppId),
107107
Type = "ServicePrincipal",
108108
ServicePrincipalNames = servicePrincipal.ServicePrincipalNames.ToArray(),
109109
AdditionalProperties = servicePrincipal.AdditionalProperties

src/Resources/Resources/ActiveDirectory/Models/PSADServicePrincipal.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class PSADServicePrincipal : PSADObject
2020
{
2121
public string[] ServicePrincipalNames { get; set; }
2222

23-
public Guid ApplicationId { get; set; }
23+
public Guid? ApplicationId { get; set; }
2424

2525
public string ObjectType => "ServicePrincipal";
2626
}

0 commit comments

Comments
 (0)