https://github.com/nhibernate/nhibernate-core/discussions/2694

On Fri, May 14, 2021 at 7:54 PM Jorge Caballero <
georgeguitar.jo...@gmail.com> wrote:

> 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 nhusers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nhusers/b372e5d2-da3c-4e1d-a09e-84fb42e95127n%40googlegroups.com
> <https://groups.google.com/d/msgid/nhusers/b372e5d2-da3c-4e1d-a09e-84fb42e95127n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 nhusers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nhusers/CAAOnFsMM3pi_Z5qO0Z9jLKOMw0gzz8CvmA3pNDjsZOuW9sFM5w%40mail.gmail.com.

Reply via email to