WaelHamze / xrm-ci-framework

xRM CI Framework provides you with the tools automate the build and deployment of your CRM Solution. Using the framework to implement a fully automated DevOps pipeline will allow you to deploy more frequently with added consistency and quality.
MIT License
186 stars 117 forks source link

Enable Application User connection strings #234

Closed mlankamp closed 5 years ago

mlankamp commented 5 years ago

In this pull request I enabled the possibility to sign in with an application user (Azure AD application). The connection string for S2S (server 2 server) flows looks like:

AuthType=OAuth;AppID=<GUID>;Url=<DYNAMICSURL>;password=<SECRET>

We really want this functionality because all our users are MFA enabled and we can't use them within our Azure DevOps build/release pipelines.

mlankamp commented 5 years ago

@WaelHamze Any feedback about my solution?

WaelHamze commented 5 years ago

@mlankamp thank for submitting this PR. I think this is a great idea. However MS recently added support for client secrets: https://www.nuget.org/packages/Microsoft.CrmSdk.XrmTooling.CoreAssembly/

I think this would meet your needs right?

mlankamp commented 5 years ago

This could meet our needs, going to have a look. Will let you know

mlankamp commented 5 years ago

The new XrmTooling now has support for client secrets! I have tested the library with connectionstring with the following format:

AuthType=ClientSecret;ClientId=id;ClientSecret=secret;Url=url

I'll close this pull request!

mgr1054 commented 5 years ago

Hey guys, having the exact same issue. However the new connection string did not solve it.

Still getting when I run the pipeline: ##[error]Organization cannot be null or empty. Parameter name: Organization Name

Connection String: "AuthType=ClientSecret; ClientId=;ClientSecret=;Url="

Any suggestions?

Edit: There shouldn't be any quotation marks in the connection string. Deleting the quotation marks solves my problem.