Hi everyone,

I'm trying to connect to Azure SQL Database by using VM Managed Identity 
but I get this error during the SessionFactory creation:

System.Data.SqlClient.SqlException: 'Login failed for user ''.'

The connection string is:

Data Source=tcp:customproject.database.windows.net,1433;Initial 
Catalog=custom-db;Persist Security Info=False;Connect 
Timeout=30;Encrypt=True;TrustServerCertificate=False

Code:
// Creating NHibernate session factory
hibernateConfig.DataBaseIntegration(db =>
{
db.Driver<SqlAzureClientDriver>();
db.ConnectionStringName = "DBConnectionString";
//db.ConnectionString = 
"Server=tcp:ukspprddnssql01.database.windows.net,1433;Initial 
Catalog=CAPO-DB;Persist Security Info=False;User 
ID=dnsrestapi;Password=Pa$$w0rd.dns;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection
 
Timeout=30;";
db.Dialect<MsSqlAzure2008Dialect>();
db.BatchSize = 20;
db.LogFormattedSql = true;
})
.AddMapping(domainMapping);

return hibernateConfig.BuildSessionFactory(); // ==> Here the exception is 
thrown.

Do you know what is the right NHbinernate configuration?

Thank you in advanced

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nhusers/b372e5d2-da3c-4e1d-a09e-84fb42e95127n%40googlegroups.com.

Reply via email to