Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,20 @@ def _configure_credentials(self) -> str:
logger.info("Please provide Synapse Workspace settings:")
synapse_workspace = {
"name": self.prompts.question("Enter Synapse workspace name"),
"dedicated_sql_endpoint": self.prompts.question("Enter dedicated SQL endpoint"),
"serverless_sql_endpoint": self.prompts.question("Enter serverless SQL endpoint"),
"sql_user": self.prompts.question("Enter SQL user"),
"sql_password": self.prompts.question("Enter SQL password"),
"tz_info": self.prompts.question("Enter timezone (e.g. America/New_York)", default="UTC"),
"driver": self.prompts.question(
"Enter the ODBC driver installed locally", default="ODBC Driver 18 for SQL Server"
),
}
synapse_workspace["dedicated_sql_endpoint"] = f"{synapse_workspace['name']}.sql.azuresynapse.net"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice catch

synapse_workspace["serverless_sql_endpoint"] = f"{synapse_workspace['name']}-ondemand.sql.azuresynapse.net"

# Azure API Access Settings
logger.info("Please provide Azure API access settings:")
azure_api_access = {
"development_endpoint": self.prompts.question("Enter development endpoint"),
"development_endpoint": f"https://{synapse_workspace['name']}.dev.azuresynapse.net",
"azure_client_id": self.prompts.question("Enter Azure client ID"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I m also thinking of removing client id and rather have them az login? thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1 to this idea. For users who choose to generate a token via az login, it makes this prompt ineffective

"azure_tenant_id": self.prompts.question("Enter Azure tenant ID"),
"azure_client_secret": self.prompts.question("Enter Azure client secret"),
Expand Down
10 changes: 3 additions & 7 deletions tests/unit/assessment/test_assessment.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,10 @@ def test_configure_synapse_credentials(tmp_path):
{
r"Enter secret vault type \(local \| env\)": sorted(['local', 'env']).index("env"),
r"Enter Synapse workspace name": "test-workspace",
r"Enter dedicated SQL endpoint": "test-dedicated-endpoint",
r"Enter serverless SQL endpoint": "test-serverless-endpoint",
r"Enter SQL user": "test-user",
r"Enter SQL password": "test-password",
r"Enter timezone \(e.g. America/New_York\)": "UTC",
r"Enter the ODBC driver installed locally": "ODBC Driver 18 for SQL Server",
r"Enter development endpoint": "test-dev-endpoint",
r"Enter Azure client ID": "test-client-id",
r"Enter Azure tenant ID": "test-tenant-id",
r"Enter Azure client secret": "test-client-secret",
Expand Down Expand Up @@ -85,15 +82,15 @@ def test_configure_synapse_credentials(tmp_path):
'synapse': {
'workspace': {
'name': 'test-workspace',
'dedicated_sql_endpoint': 'test-dedicated-endpoint',
'serverless_sql_endpoint': 'test-serverless-endpoint',
'dedicated_sql_endpoint': 'test-workspace.sql.azuresynapse.net',
'serverless_sql_endpoint': 'test-workspace-ondemand.sql.azuresynapse.net',
'sql_user': 'test-user',
'sql_password': 'test-password',
'tz_info': 'UTC',
'driver': 'ODBC Driver 18 for SQL Server',
},
'azure_api_access': {
'development_endpoint': 'test-dev-endpoint',
'development_endpoint': 'https://test-workspace.dev.azuresynapse.net',
'azure_client_id': 'test-client-id',
'azure_tenant_id': 'test-tenant-id',
'azure_client_secret': 'test-client-secret',
Expand All @@ -115,7 +112,6 @@ def test_configure_synapse_credentials(tmp_path):

with open(file, 'r', encoding='utf-8') as file:
credentials = yaml.safe_load(file)

assert credentials == expected_credentials


Expand Down
Loading