I am trying to connect and authenticate from a SSIS script task. As VSTA scripts do not support NuGet, i installed all required packages and copied them to my .NET installation folder.
When executing the script task, all the assemblies are located and loaded correctly, but the connection does not work.
I set up a stand alone project (console app) to verify my code and in the code is working in the console application.
Here is the code i am using in both, stand alone application and SSIS task:
private static bool ConnectByOffice365(string organizationUri)
{
string authType = "Office365";
string username = "******";
string password = "************";
string connectionString = $"AuthType={authType}; Url={organizationUri}; UserId={username}; Password={password};";
var serviceProxy = new CrmServiceClient(connectionString);
return serviceProxy.IsReady;
}
I am using
- Microsoft.CrmSdk.XrmTooling.CoreAssembly (9.1.0.110)
Can anybody help?