Skip to content

Commit 2c01e62

Browse files
ExecSamApp
1 parent d3e781a commit 2c01e62

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Setup/Invoke-ExecCreateSAMApp.ps1

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,19 @@ Function Invoke-ExecCreateSAMApp {
8484
Write-Information ($Secret | ConvertTo-Json -Depth 5)
8585
Add-CIPPAzDataTableEntity @DevSecretsTable -Entity $Secret -Force
8686
} else {
87-
$ConfigTable = Get-CippTable -tablename 'Config'
88-
#update the ConfigTable with the latest appId, for caching compare.
89-
$NewConfig = @{
90-
PartitionKey = 'AppCache'
91-
RowKey = 'AppCache'
92-
ApplicationId = $AppId.appId
93-
}
94-
Set-CIPPAzDataTableEntity @ConfigTable -Entity $NewConfig -Force | Out-Null
87+
9588
Set-AzKeyVaultSecret -VaultName $kv -Name 'tenantid' -SecretValue (ConvertTo-SecureString -String $TenantId -AsPlainText -Force)
9689
Set-AzKeyVaultSecret -VaultName $kv -Name 'applicationid' -SecretValue (ConvertTo-SecureString -String $Appid.appId -AsPlainText -Force)
9790
Set-AzKeyVaultSecret -VaultName $kv -Name 'applicationsecret' -SecretValue (ConvertTo-SecureString -String $AppPassword -AsPlainText -Force)
9891
}
92+
$ConfigTable = Get-CippTable -tablename 'Config'
93+
#update the ConfigTable with the latest appId, for caching compare.
94+
$NewConfig = @{
95+
PartitionKey = 'AppCache'
96+
RowKey = 'AppCache'
97+
ApplicationId = $AppId.appId
98+
}
99+
Set-CIPPAzDataTableEntity @ConfigTable -Entity $NewConfig -Force | Out-Null
99100
$Results = @{'message' = "Succesfully $state the application registration. The application ID is $($AppId.appid). You may continue to the next step."; severity = 'success' }
100101
}
101102

0 commit comments

Comments
 (0)