Datastore.register_azure_sql_database requires base SQL servername, not FQDN.
The following snippet:
sql_datastore_name="azuresqldatastore" server_name=os.getenv("SQL_SERVERNAME", "<my_server_name>") # Name of the Azure SQL server database_name=os.getenv("SQL_DATABASENAME", "<my_database_name>") # Name of the Azure SQL database username=os.getenv("SQL_USER_NAME", "<my_sql_user_name>") # The username of the database user. password=os.getenv("SQL_USER_PASSWORD", "<my_sql_user_password>") # The password of the database user.
Should call out that server_name needs to be the base server name, not servername.database.windows.net. This is confusing customers and leads to a lot of time spent debugging. Perhaps server_name=os.getenv("SQL_SERVERNAME", "<my_server_name>") # Base name of the Azure SQL server
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: b35c96a9-b082-7b3f-3c26-15b6ec753b75
- Version Independent ID: 771cf70f-497b-23b4-4a87-a9d12f129b24
- Content: azureml.core.Datastore class - Azure Machine Learning Python
- Content Source: AzureML-Docset/stable/docs-ref-autogen/azureml-core/azureml.core.Datastore(class).yml
- Service: machine-learning
- Sub-service: core
- GitHub Login: @debfro
- Microsoft Alias: debfro
thanks for the feedback. we will follow up for doc update
The sdk docs have further clarification in the parameters section: server_name The SQL server name. For fully qualified domain name like "sample.database.windows.net", the server_name value should be "sample", and the endpoint value should be "database.windows.net". https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.datastore(class)?view=azure-ml-py#register-azure-sql-database-workspace--datastore-name--server-name--database-name--tenant-id-none--client-id-none--client-secret-none--resource-url-none--authority-url-none--endpoint-none--overwrite-false--username-none--password-none----kwargs-
#please-close