Date: Thu, 28 Mar 2024 19:21:57 -0500 (CDT) Message-ID: <911046830.30182.1711671717101@PUBEDFIPRDWEB5.public.local> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_30181_681785127.1711671717096" ------=_Part_30181_681785127.1711671717096 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The application deployed and First-Time setup was successful, however yo= u are unable to proceed further with the Admin App settings page or you get= an error message saying that the key and secret can not be used in that st= ate.
Admin App secret configuration and/or Azure SQL configuration values bec= ame corrupted for whatever reason.
On this step, we need to clear all the data records created during first= time setup.
Ex (in Azure): EdFiOdsAp= iWebSite-{environment}-{resourceGroupid}
EdFiOdsAdminAppWebSite-{enviro= nment}-{resourceGroupid}
2. Connect to SQL Server on SSMS or use Azure Query= Editor
3. Select the EdFi_Admin database.
4. Execute the following sql commands for clearing = all the data records created during first time setup process.
BEGIN= TRAN DECLARE @ApplicationId INT; SELECT @ApplicationId =3D ApplicationId FROM dbo.Applications WHERE ClaimSe= tName =3D 'Ed-Fi ODS Admin App' DELETE FROM dbo.ClientAccessTokens WHERE EXISTS ( SELECT 1 FROM dbo.ApiClient= s WHERE ClientAccessTokens.Ap= iClient_ApiClientId =3D ApiClients.ApiClientId AND Application_Application= Id =3D @ApplicationId=20 ) DELETE FROM dbo.ApiClients WHERE Application_Applic= ationId =3D @ApplicationId DELETE FROM dbo.ApplicationEducationOrganizations W= HERE Application_ApplicationId =3D @ApplicationId DELETE FROM dbo.ProfileApplications WHERE Applicati= on_ApplicationId =3D @ApplicationId DELETE FROM dbo.Applications WHERE ApplicationId = =3D @ApplicationId DELETE FROM dbo.OdsInstances DELETE FROM adminapp.SecretConfigurations COMMIT TRAN
5. Once the SQL commands executed successfully. Plea= se start the ODS API and Admin App websites under IIS or within the Azure p= ortal App Service.
There is a table in the EdFi_Admin database called&n= bsp;adminapp.AzureSqlConfigurations. This table holds the encrypted configu= ration parameters used by the admin app.
The format of this string is JSON and specifies a few key: value pairs.<= /p>
Here is a template of how it looks: {"AdminCredentials":{"Password":"[db= password]","UserName":"[dbuser]"},"HostName":"[the SQL Server: sql.somthing= .com]","ProductionApiCredentials":{"Password":"[SecurePassword]","UserName"= :"EdFiOdsProductionApi"},"AdminAppCredentials":{"Password":"[SecurePassword= ]","UserName":"EdFiOdsAdminApp"}}
The following JSON code block explains the parameters required and their= intention:
{ =09//These are the credentials used to access the EdFi_Admin database. =09"AdminCredentials":{=20 =09=09=09"Password":"[dbpassword]", =09=09=09"UserName":"[dbuser]" =09}, =09// This is the address of the MsSQL server. This can be a DNS or an IP A= ddress. =09"HostName":"[the SQL Server: sql.somthing.com]",=20 =09// These are the credentials that will be stored encrypted that the Admi= n App will use to connect to the Ed-Fi ODS API =09"ProductionApiCredentials":{=20 =09=09=09"Password":"[SecurePassword]", =09=09=09"UserName":"EdFiOdsProductionApi" =09}, =09"AdminAppCredentials":{ =09=09=09"Password":"[SecurePassword]", =09=09=09"UserName":"EdFiOdsAdminApp" =09} }
Modify the SQL statement below by providing= the User Name and Password for the required fields marked with square brak= ets "[...]"
Following the steps above open SSMS or Azur= e Query Editor and execute the following statement against the EdFi_Admin d= atabase.
BEGIN TR= AN UPDATE adminapp.AzureSqlConfigurations set field=3D'{"AdminCredentials":{"P= assword":"PW Specified in Deployment Script","UserName":"SERVER Master UN"}= ,"HostName":"","ProductionApiCredentials":{"Password":"Enter PW","UserName"= :"EdFiOdsProductionApi"},"AdminAppCredentials":{"Password":"","UserName":"E= dFiOdsAdminApp"}}' WHERE Id=3D1; COMMIT TRAN
Note: That older versions of Admin app need th= e presence of =E2=80=9CSetupRequired=E2=80=9D file. This indicates to the f= irst time setup process that it has not run. If the file not present, this = means that the first-time setup was completed. Recreating the file will enf= orce the First time setup process to run again.
To create this file just create text file with the name =E2=80=9CSetupRe= quired=E2=80=9D and set the content of it to: Placeholder file to let the A= dminApp know additional setup of the system is required.
On IIS or Azure, proceed to restart the application. Once the restart ha= s finished use your web browser and navigate to the Admin App URL. You shou= ld be able to continue the First Time Setup within Admin App.
Deployed pages and resources can be accessed on Azure portal.
https://www.gslab.com/blogs/kudu-azure-= web-app
If you have any questions on how to connect to the EdFi-Admin database p= lease refer to this articles below:
https://docs.mi= crosoft.com/en-us/azure/azure-sql/database/connect-query-portal
https://docs.micr= osoft.com/en-us/azure/azure-sql/database/connect-query-ssms