Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Issues

The application deployed and First-Time setup was successful, however you 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 state.

Cause

Admin App secret configuration and/or Azure SQL configuration values became corrupted for whatever reason.

Steps for Recovering the Application

1) Clear Configuration Parameters & Force Admin App's First-Time Setup

On this step, we need to clear all the data records created during first time setup.

  1. Please make sure to stop ODS API and Admin App websites under IIS or within the Azure portal App Service.

            Ex (in Azure):  EdFiOdsApiWebSite-{environment}-{resourceGroupid}

...

Code Block
titleSQL
BEGIN TRAN   
DECLARE @ApplicationId INT;

SELECT @ApplicationId = ApplicationId FROM dbo.Applications WHERE ApplicationName = 'Ed-Fi ODS Admin App'    

DELETE FROM dbo.ClientAccessTokens WHERE EXISTS (
        SELECT 1 FROM dbo.ApiClients
        WHERE ClientAccessTokens.ApiClient_ApiClientId = ApiClients.ApiClientId
        AND Application_ApplicationId = @ApplicationId 
) 

    DELETE FROM dbo.ApiClients WHERE Application_ApplicationId = @ApplicationId
    DELETE FROM dbo.ApplicationEducationOrganizations WHERE Application_ApplicationId = @ApplicationId
    DELETE FROM dbo.ProfileApplications WHERE Application_ApplicationId = @ApplicationId
    DELETE FROM dbo.Applications WHERE ApplicationId = @ApplicationId
    DELETE FROM dbo.OdsInstances
    DELETE FROM adminapp.SecretConfigurations
COMMIT  TRAN

5.) Please      5. Once the SQL commands executed successfully. Please start the ODS API and Admin App websites under IIS or within the Azure portal once the SQL commands executed successfully.

...

App Service. 

2) Update the Admin App Configuration Parameters

There is a table in the EdFi_Admin database called adminapp.AzureSqlConfigurations. This table holds the encrypted configuration parameters used by the admin app.

The format of this string is JSON and specifies a few key: value pairs.

The string looks something like this: {"AdminCredentials":{"Password":"[dbpassword]","UserName":"[dbuser]"},"HostName":"[the SQL Server: sql.somthing.com]","ProductionApiCredentials":{"Password":"[SecurePassword]","UserName":"EdFiOdsProductionApi"},"AdminAppCredentials":{"Password":"[SecurePassword]","UserName":"EdFiOdsAdminApp"}}

Code Block
languagejs
titleSQL
{
	"AdminCredentials":{ //These are the credentials used to access the EdFi_Admin database.
			"Password":"[dbpassword]",
			"UserName":"[dbuser]"
	},
	"HostName":"[the SQL Server: sql.somthing.com]", // This is the address of the MsSQL server. This can be a DNS or an IP Address.
	"ProductionApiCredentials":{ // These are the credentials that will be stored encrypted that the Admin App will use to connect to the Ed-Fi ODS API
			"Password":"[SecurePassword]",
			"UserName":"EdFiOdsProductionApi"
	},
	"AdminAppCredentials":{
			"Password":"[SecurePassword]",
			"UserName":"EdFiOdsAdminApp"
	}
}


Code Block
languagesql
titleSQL
BEGIN TRAN   
{"AdminCredentials":{"Password":"PW Specified in Deployment Script","UserName":"SERVER Master UN"},"HostName":"","ProductionApiCredentials":{"Password":"Enter PW","UserName":"EdFiOdsProductionApi"},"AdminAppCredentials":{"Password":"","UserName":"EdFiOdsAdminApp"}}
COMMIT  TRAN


3) Update Admin App web site on IIS or Azure

Note: That older versions of Admin app need the presence of “SetupRequired.txt” file. This indicates to the first 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 enforce the First time setup process to run again.

...