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

[Service Connector] az source connection create fabric-sql: Support Fabric SQL as target with passwordless experience #7940

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

brycechen1849
Copy link

@brycechen1849 brycechen1849 commented Sep 2, 2024


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

Create linker

Example: Create linker with user identity

az webapp connection create fabric-sql 
--source-id /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Web/sites/{app_name}
--target-id https://api.fabric.microsoft.com/v1/workspaces/{workspace_id}/SqlDatabases/{sql_id}
--user-identity client-id=3af94a55-9cf5-4e70-8616-c540a08a8374 subs-id=6cd159c1-0ef9-41bc-85b1-e8db1a626465 
--client-type dotnet 
--connstr-props 'Server=tcp:renzo-srv-6ae35870-c362-44b9-8389-ada214a46bb5-51240650dd56.database.windows.net,1433' 'Database=AzureServiceConnectorTestSqlDb-4fdf6efe-23a9-4d74-8c4a-4ecc70c4d323'

Example: Create linker with system identity

az webapp connection create fabric-sql 
--source-id /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Web/sites/{app_name}
--target-id https://api.fabric.microsoft.com/v1/workspaces/{workspace_id}/SqlDatabases/{sql_id}
--system-identity 
--client-type dotnet 
--connstr-props 'Server=tcp:renzo-srv-6ae35870-c362-44b9-8389-ada214a46bb5-51240650dd56.database.windows.net,1433' 'Database=AzureServiceConnectorTestSqlDb-4fdf6efe-23a9-4d74-8c4a-4ecc70c4d323'

Update linker

update linker with user identity

az webapp connection create fabric-sql 
--connection fabric_sql_a973e 
--source-id /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Web/sites/{app_name}
--target-id https://api.fabric.microsoft.com/v1/workspaces/{workspace_id}/SqlDatabases/{sql_id}
--user-identity client-id=3af94a55-9cf5-4e70-8616-c540a08a8374 subs-id=6cd159c1-0ef9-41bc-85b1-e8db1a626465 
--client-type dotnet 
--connstr-props 'Server=tcp:renzo-srv-6ae35870-c362-44b9-8389-ada214a46bb5-51240650dd56.database.windows.net,1433' 'Database=AzureServiceConnectorTestSqlDb-4fdf6efe-23a9-4d74-8c4a-4ecc70c4d323'

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copy link

Validation for Breaking Change Starting...

Thanks for your contribution!

Copy link

Hi @brycechen1849,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

Copy link

Hi @brycechen1849,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@yonzhan
Copy link
Collaborator

yonzhan commented Sep 2, 2024

Service Connector

Copy link

github-actions bot commented Sep 2, 2024

@brycechen1849
Copy link
Author

brycechen1849 commented Sep 2, 2024

Azure cli serviceconnector module change is in PR Azure/azure-cli#29822

Waiting for above PR merge and then this one, since the code depending on code change in serviceconnector module of the azure-cli repo

@brycechen1849 brycechen1849 force-pushed the support_fabric_sql_passwordless branch 4 times, most recently from 96f9fdb to 601c569 Compare September 4, 2024 09:36
Copy link

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@@ -636,6 +644,109 @@ def get_create_query(self):
return [delete_q, role_q, grant_q]


class FabricSqlHandler(TargetHandler):
Copy link
Member

Choose a reason for hiding this comment

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

Could you put the FabricSqlHandler in a new file? It could cause conflict if we change the file at the same time.

logger.warning("Connecting to database...")
self.create_aad_user_in_sql(connection_args, query_list)

def create_aad_user_in_sql(self, connection_args, query_list):
Copy link
Member

Choose a reason for hiding this comment

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

You can inherit the SqlHandler to reuse the create_aad_user_in_sql function if you don't need to change it.

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

Successfully merging this pull request may close these issues.

5 participants