aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Core/DataSource.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.Core/DataSource.cs')
-rw-r--r--Software/Visual_Studio/Tango.Core/DataSource.cs39
1 files changed, 12 insertions, 27 deletions
diff --git a/Software/Visual_Studio/Tango.Core/DataSource.cs b/Software/Visual_Studio/Tango.Core/DataSource.cs
index 511a82267..3803eea5d 100644
--- a/Software/Visual_Studio/Tango.Core/DataSource.cs
+++ b/Software/Visual_Studio/Tango.Core/DataSource.cs
@@ -100,35 +100,20 @@ namespace Tango.Core
case DataSourceType.Azure:
- if (IntegratedSecurity)
- {
- throw new NotSupportedException("Azure integrated security is not supported.");
- //if (!_has_provider)
- //{
- // var provider = new ActiveDirectoryAuthProvider();
- // SqlAuthenticationProvider.SetProvider(SqlAuthenticationMethod.ActiveDirectoryInteractive, provider);
- // _has_provider = true;
- //}
-
- //SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
-
- //builder.DataSource = Address;
- //builder.InitialCatalog = Catalog;
- //builder.UserID = UserName;
- //builder.TrustServerCertificate = true;
- //builder.ConnectTimeout = 15;
- //builder.Pooling = false;
-
- //builder.Authentication = SqlAuthenticationMethod.ActiveDirectoryInteractive;
+ SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
+ builder.DataSource = Address;
+ builder.InitialCatalog = Catalog;
+ builder.UserID = UserName;
+ builder.Password = Password;
+ builder.IntegratedSecurity = false;
+ builder.TrustServerCertificate = true;
+ builder.ConnectTimeout = 15;
+ builder.Pooling = false;
+ builder.Authentication = SqlAuthenticationMethod.ActiveDirectoryPassword;
- //SqlConnection sqlConnection = new SqlConnection(builder.ConnectionString);
+ SqlConnection sqlConnection = new SqlConnection(builder.ConnectionString);
- //return sqlConnection;
- }
- else
- {
- return new SqlConnection(String.Format("Server=tcp:{0},1433;Initial Catalog={1};Persist Security Info=False;User ID={2};Password={3};MultipleActiveResultSets=True;App=EntityFramework;Encrypt=True;TrustServerCertificate=False;Authentication=\"Active Directory Password\";", Address, Catalog, UserName, Password));
- }
+ return sqlConnection;
default: