You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduced a $Step variable to track progress during API app creation and included the step in error logs for better troubleshooting. Added -maxRetries 3 to key New-GraphPOSTRequest calls to improve reliability of application password, identifier URI, and service principal creation.
Copy file name to clipboardExpand all lines: Modules/CIPPCore/Public/Authentication/New-CIPPAPIConfig.ps1
+9-4Lines changed: 9 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -63,18 +63,23 @@ function New-CIPPAPIConfig {
63
63
if ($PSCmdlet.ShouldProcess($AppName,'Create API App')) {
64
64
Write-Information'Creating app'
65
65
Write-Information$CreateBody
66
+
$Step='Creating Application'
66
67
$APIApp=New-GraphPOSTRequest-uri 'https://graph.microsoft.com/v1.0/applications'-AsApp $true-NoAuthCheck $true-type POST -body $CreateBody
67
68
Write-Information'Creating password'
68
-
$APIPassword=New-GraphPOSTRequest-uri "https://graph.microsoft.com/v1.0/applications/$($APIApp.id)/addPassword"-AsApp $true-NoAuthCheck $true-type POST -body "{`"passwordCredential`":{`"displayName`":`"Generated by API Setup`"}}"
69
+
$Step='Creating Application Password'
70
+
$APIPassword=New-GraphPOSTRequest-uri "https://graph.microsoft.com/v1.0/applications/$($APIApp.id)/addPassword"-AsApp $true-NoAuthCheck $true-type POST -body "{`"passwordCredential`":{`"displayName`":`"Generated by API Setup`"}}"-maxRetries 3
0 commit comments