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
Copy file name to clipboardExpand all lines: Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Administration/Application Approval/Invoke-ExecCreateAppTemplate.ps1
+98-14Lines changed: 98 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ function Invoke-ExecCreateAppTemplate {
11
11
param($Request,$TriggerMetadata)
12
12
13
13
$APIName=$TriggerMetadata.FunctionName
14
-
Write-LogMessage-user$Request.headers.'x-ms-client-principal'-API $APINAME-message 'Accessed this API'-Sev 'Debug'
14
+
Write-LogMessage-headers$Request.headers-API $APINAME-message 'Accessed this API'-Sev 'Debug'
15
15
16
16
try {
17
17
$TenantFilter=$Request.Body.TenantFilter
@@ -47,7 +47,7 @@ function Invoke-ExecCreateAppTemplate {
47
47
$RequiredResourceAccess=@()
48
48
}
49
49
} catch {
50
-
Write-LogMessage-user$Request.headers.'x-ms-client-principal'-API $APINAME-message "Could not retrieve app registration for $AppId - will extract from service principal"-Sev 'Warning'
50
+
Write-LogMessage-headers$Request.headers-API $APINAME-message "Could not retrieve app registration for $AppId - will extract from service principal"-Sev 'Warning'
51
51
$RequiredResourceAccess=@()
52
52
}
53
53
@@ -56,16 +56,91 @@ function Invoke-ExecCreateAppTemplate {
56
56
$Permissions=$RequiredResourceAccess
57
57
} else {
58
58
# No permissions found - warn the user
59
-
Write-LogMessage-user$Request.headers.'x-ms-client-principal'-API $APINAME-message "No permissions found for $AppId. The app registration may not have configured API permissions."-Sev 'Warning'
59
+
Write-LogMessage-headers$Request.headers-API $APINAME-message "No permissions found for $AppId. The app registration may not have configured API permissions."-Sev 'Warning'
Write-LogMessage-user$Request.headers.'x-ms-client-principal'-API $APINAME-message "Permission set created with ID: $PermissionSetId for $($Permissions.Count) resource(s)"-Sev 'Info'
192
+
Write-LogMessage-headers$Request.headers-API $APINAME-message "Permission set created with ID: $PermissionSetId for $($Permissions.Count) resource(s)"-Sev 'Info'
118
193
}
119
194
120
195
# Create the template
@@ -156,24 +231,33 @@ function Invoke-ExecCreateAppTemplate {
156
231
}
157
232
158
233
$Message="Template created: $DisplayName with $PermissionCount permission(s)"
0 commit comments