Sunday, 24 February 2019

Removing AzureCredential keeps looping

For some reason, you might have more than 1 Credentials.

Error: When you tried to Remove Credential A, system will return an error saying that cannot update the Credential B. Then if you try to remove Credential B, another error says Cannot Remove

Message: Update to existing credential with KeyId 'xxx' is not allowed.



Solution: This script will remove your all current certificates from a particular Service Principal

Remove-AzureRmADSpCredential -ServicePrincipalName "00000015-0000-0000-c000-000000000000"


Thursday, 21 February 2019

Deployment failed due to FinancialReporting Issue

Message: Module FinancialReporting failed
Detail:
System.InvalidOperationException: An error was encountered. Details may be found in the deployment logs at 'C:\ProgramData\Microsoft Dynamics ERP\Management Reporter\Logs' System.ServiceModel.FaultException 1 [Microsoft.Dynamics.Performance.Common.Contract.Reporting.ServiceFault]: (Faul Detail is equal to Microsoft.Dynamics.Performance.Common.Contract.Reporting.ServiceFault). at Microsoft.Dynamics.Performance.Deployment.FinancialReportingDeployer.Program.Main(String[]args) at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, String[] args) at System.AppDomain.ExecuteAssembly(String  assemblyFile, String[] args) at SetupCore.SetupManager.LaunchProcessInAppDomain(String startupExe, String workingDir, StringcurrentFolder, String[] moduleArgs) at SetupCore.Setupmanager.<>c_DisplayClass12_1.<InvokeModules>b__6()
ErrorCode: 0
MemberName: ErrorPrettify
SourceFile E:\Work\131\s\Source\LocalAgentEvents\LocalAgentEventSource.cs 
SourceLineNumber: 79




Solution
Check the FinancialReporting database if there are reports not checked out: 
  
select * from reporting.ControlReport where CheckedOutTo is not null 

If the query returns something then we can run those scripts for FinancialReporting: 
update Reporting.ControlReport 
set CheckedOutTo = null 

update Reporting.ControlRowMaster 
set CheckedOutTo = null 

update Reporting.ControlColumnMaster 
set CheckedOutTo = null 

update Reporting.ControlTreeMaster 
set CheckedOutTo = null