web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Authentication (OAuth/Office365) from SSIS script

(0) ShareShare
ReportReport
Posted on by 5

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?

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I'm curious - why do you need to reinvent the wheel where there are Kingsway soft adapters that does all the work for you?

  • ASC Profile Picture
    5 on at

    Because they are commercial and i have a complex SSIS project where i just need to change the way of authentication in code behind.

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    I don't plan to argue. In my opinion - those adapters are worth every cent invested.

    I would recommend changing Office365 authentication (this authentication eventually goes away for such integration scenarios) to app user and it actually might be a reason why your code doesn't work.

    Here are few articles you might consider helpful:

    blog.magnetismsolutions.com/.../setting-up-an-application-user-in-dynamics-365

    docs.microsoft.com/.../use-connection-strings-xrm-tooling-connect

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Office365 auth is deprecated and you should be using Oauth/Clientsecret.

    Please see below blog

    docs.microsoft.com/.../authenticate-office365-deprecation

  • ASC Profile Picture
    5 on at

    Hi,

    i tested both, OAuth and Office 365 authentication. Both are working in the stand alone application but not in the SSIS solution. So i am wondering what is wrong.

    I agree that investing in existing solutions is at the end much cheaper. But before updating Dynamics to some new version everything was working. Due to the update i need to purchase a library  for more than 1k USD (for something that has been working well). This is really disappointing.

    Nevertheless, i will try the KingswaySoft adapters.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Can you please provide the version of the code that used to work?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans