Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for Azure SQL by adding Active Directory authentication methods #53

Merged
merged 8 commits into from
Sep 22, 2020

Conversation

dataders
Copy link
Collaborator

rehash of #49 but to master branch now. @NandanHegde15 will add some more documentation and test this PR does not break the existing on-prem SQL Server connection methods

Comment on lines +66 to +71
if self.windows_login is True:
self.authentication = "Windows Login"


return 'server', 'database', 'schema', 'port', 'UID', \
'authentication', 'encrypt'
Copy link
Contributor

@NandanHegde15 NandanHegde15 Sep 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So instead of displaying windows_login as True in dbt debug output , this changes would display authentication: Windows Login
We could have added windows auth as an Authentication value within the profiles config but
to have backward compatibility for Windows Auth with the config property : windows_login otherwise dbt debug window would display authentication=sql

@mikaelene

@NandanHegde15
Copy link
Contributor

rehash of #49 but to master branch now. @NandanHegde15 will add some more documentation and test this PR does not break the existing on-prem SQL Server connection methods

I have tested out both the Windows auth and SQL auth part for an On Prem SQL server with this branch Connections.py
image

@dataders
Copy link
Collaborator Author

dataders commented Sep 18, 2020

@mikaelene this PR is all that is needed to enable Azure SQL, which would pretty cool! Like @NandanHegde15 said, we can authenticate and found all the dbt commands to be working.

what do you think is a good roll-out strategy for this? Make a release cut and have people (besides us) test it before squashing to master?

con_str.append(f"PWD={{{credentials.PWD}}}")

if not getattr(credentials, 'encrypt', False):
con_str.append(f"Encrypt={credentials.encrypt}")

con_str_concat = ';'.join(con_str)
logger.debug(f'Using connection string: {con_str_concat}')
Copy link
Contributor

@NandanHegde15 NandanHegde15 Sep 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code logger.debug(f'Using connection string: {con_str_concat}') displays the credentials in the dbt logs without any encryption. So we would prefer this line be commented out and can be used only during debugging purposes.
This fix can be made in a separate PR but wanted to highlight you this scenario.

Added a description of Azure SQL requiring tires greater than S2 for column store index to be created in README file
Copy link
Collaborator

@mikaelene mikaelene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good @NandanHegde15 ! I'll merge it to master and see if I can try it out before pushing to pipi. Feel free to submit at PR for the credentials debug log as well so we solve that security hole.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants