I am struggling to see why Crystal Reports fails with a "Database Logon Failed" message when it is using the same credentials as the .NET application which connects without issue. Running the app in Azure as a Cloud Service, connecting to Azure SQL Database. Crystal runtime is installed as a startup task.
All works fine in local debug, but fails on deployment with same login error.
I have tried a few things, none of which work. Crystal Reports runtime is installed, I have a StartUp.cmd file with:
msiexec.exe /I "CR13SP29MSI64_0-10010309.msi" /qn
robocopy D:inetpubwwwroot E:sitesroot /S
I am deploying the app with CR13SP29MSI64_0-10010309.msi in the root, have a startup task defined in ServiceDefinition.cscfg which is:
<Startup>
<Task commandLine="StartUp.cmd" executionContext="elevated" taskType="background" />
</Startup>
Note, if I RDP to the cloud service and run the MSI it asks if I want to reinstall, so it looks like the install itself is fine.
Tried running reports with
doc.SetDatabaseLogon(conn.UserID, conn.Password, conn.ServerName, conn.DatabaseName, true);
where doc is a ReportDocument and conn contains valid credentials.
Also tried reading from config and using DataSourceConnections...
var connString = ConfigurationManager.ConnectionStrings["myEFconnection"].ConnectionString;
var sCon = new SqlConnectionStringBuilder(connString);
doc.DataSourceConnections[0].SetConnection(sCon.DataSource, sCon.InitialCatalog, sCon.UserID,
sCon.Password);
The user and password are correct, the myEFconnection is what the app uses and all works ok, plus this all works with the same config fine in Visual Studio connecting to the Azure SQL DB. So clearly not a username and password issue and can't be firewall either otherwise other application functions would fail. What else?
Any help much appreciated as the error is particularly unhelpful and I am somewhat stumped as to where else to go.
myEFconnection? Be careful to hide confidential information.