How do I create DSN of Azure databricks? - azure-databricks

I'm trying to connect Azure databricks from another application. I need to create a databricks DSN as per the connection steps mentioned in the application. So I'm trying to create the Databricks DSN mentioning the steps given here But I'm getting following error message [Simba][ThriftExtension] (14) Unexpected response from server during a HTTP connection: Unauthorized/Forbidden error response returned, but no token expired message received.
Sorry I couldn't share with the parameters that I'm using as it's connecting to client's data. Can you suggest me what could be the possible reason for error?

I downloaded and installed odbc driver from this page.
Image for reference:
searched for open data source on start menu and opened it and selected Simba Spark under System DSN.
Image for reference:
filled the required details from azure Databricks, for that
we need to follow below steps:
Navigate to azure Databricks compute option and select the cluster.
Click on at cluster configuration advanced options and select JDBC/ODBC option.
Copy host name, port and http path.
Go to username at left top of data bricks page and select user settings
Generate access token
Copy and save the access token.
By clicking on Simba Spark system DSN
we will get below page
Enter Data source name, description and Enter Server Hostname of Databricks as Host, enter port of Databricks, select Username and password option enter token as username and enter access token of Databricks as password
select HTTP and enter HTTP Path of Databricks as HTTP path click OK.
After above setting I tested the connection I go below error
I selected SSL Option and enabled SSL
I tested again the connection is successful.
In this way I created DSN for Databricks.

Related

SQL Server Managed Backup to Azure

I'm trying to backup SQL Server (Local) to Azure Blob Storage. I have created the SAS Credential
CREATE CREDENTIAL [https://xxxxxxxxx.blob.core.windows.net/yyyyyyyy]
WITH IDENTITY = 'Shared Access Signature',
SECRET = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
In SQL Server, while trying to enable the Backup for server using this command
USE msdb;
GO
EXEC msdb.managed_backup.sp_backup_config_basic
#enable_backup =1,
#database_name = 'TempDB',
#container_url = 'https://xxxxxxxxx.blob.core.windows.net/yyyyyyyy',
#retention_days = 30
GO
I get this error:
Msg 45207, Level 17, State 17, Procedure managed_backup.sp_add_task_command, Line 102 [Batch Start Line 19]
The operation failed because of an internal error. The argument must not be empty string.
Parameter name: sasToken Please retry later.
at Microsoft.WindowsAzure.Storage.Core.Util.CommonUtility.AssertNotNullOrEmpty(String paramName, String value)
at Microsoft.WindowsAzure.Storage.Auth.StorageCredentials..ctor(String sasToken)
at Microsoft.SqlServer.SmartAdmin.SmartBackupAgent.FileService.VerifyContainerURL(String containerURL, SqlConnection conn)
at Microsoft.SqlServer.SmartAdmin.SmartBackupAgent.SmartBackup.ConfigureDbOrInstance(SmartBackupConfigParameters config, LogBaseService jobLogger, SqlConnection conn)
If we change the #enable_backup to "0", the query executes correctly.
I have tried re-creating the SAS key, it doesn't work.
PS: I'm currently using SQL Server 2017.
Try with these steps
1) Create a SQL Server credential using a shared access signature.
To create a SQL Server credential, follow these steps:
Connect to SQL Server Management Studio.
Open a new query window and connect to the SQL Server instance of the
database engine in your on-premises environment.
In the new query window, execute the following script .
USE master CREATE CREDENTIAL
"https://.blob.core.windows.net/"
//this name must match the container path, start with https and must
not contain a forward slash at the end WITH IDENTITY='SHARED ACCESS
SIGNATURE' //this is a mandatory string and should not be changed
, SECRET = 'sharedaccesssignature' //this is the shared access
signature key GO
Example:
USE master
CREATE CREDENTIAL [https://msfttutorial.blob.core.windows.net/containername]
WITH IDENTITY='SHARED ACCESS SIGNATURE'
, SECRET = 'sharedaccesssignature'
GO
To see all available credentials, you can run the following statement
in a query window connected to your instance:
SELECT * from sys.credentials
2) Create backup .Modify the URL appropriately for your storage account name and the container and then execute this script.
//To permit log backups, before the full database backup, modify the database to use the full recovery model.
USE master;
ALTER DATABASE AdventureWorks2016
SET RECOVERY FULL;
BACKUP DATABASE AdventureWorks2016
TO URL = 'https://<mystorageaccountname>.blob.core.windows.net/<mystorageaccountcontainername>/AdventureWorks2016_onprem.bak
3) Open Object Explorer and connect to Azure storage using your storage account and account key. Expand Container verify that the backup appears in this container.
For more details refer these links link1 and link2
If anyone has experienced the similar issue with SQL Server, an update may solve your problem.
Symptoms
Assume that you disable "Allow Blob Public Access" on a storage account. In this situation, when you enable a managed or automated backup in Microsoft SQL Server 2016 or 2017, you receive the following error message:
"SQL Server Managed Backup to Microsoft Azure cannot configure the database 'DatabaseName' because a container URL was either not provided or invalid. It is also possible that your SAS credential is invalid."
Resolution
This problem is fixed in the following cumulative update for SQL
Server:
Cumulative Update 23 for SQL Server 2017
Cumulative Update 16 for SQL Server 2016 SP2
https://support.microsoft.com/en-us/topic/kb4589360-fix-error-when-you-enable-managed-or-automated-backup-in-sql-server-2016-and-2017-if-allow-blob-public-access-is-disabled-on-a-storage-account-d2315f8d-6a38-5d6c-6f02-3ab14c4b34cf

Cannot connect to AWS RDS database using SQL Workbench

I am trying to connect to a free AWS RDS PostgreSQL database I created using SQL Workbench/J, I am following the instructions provided from AWS.
When I get to the end of Step 4, connecting to the PostgreSQL database, I keep receiving this error:
The connection attempt failed. [SQL State=08001]
I am using a Mac.
I fixed this by adding an Inbound connection rule for the database. From the AWS RDS portal goto: databases -> <your_database>. Then scroll down and ensure the 'Connectivity & security' tab is chosen. Scroll down to 'Security group rules' then follow the link for the 'EC2 Security Group - Inbound' rule. On this page, select the 'Inbound rules' tab and select the 'Edit inbound rules' button. Select 'Add Rule', the type for me was PostgreSQL, protocol TCP, I used the port the database instance is supposed to operate on (found on the AWS RDS - Connectivity & security tab for the particular database) -- i.e. 5432. Next, for Source open the drop down menu and choose 'My IP', then save changes. That was it for me.
To solve this error, go to your RDS database on AWS and click on "Modify". Now go to Connectivity and click on "Choose Security Group". Click on any of the launch-wizard options there for example "launch-wizard-1". Now save the changes. Then go to sqlworkbench and connect again. Your error will get solved.

An error happened while reading data from the provider. The remote certificate is invalid according to the validation procedure

I'm trying to connect Postgres Database on AWS EC2 instance to Microsoft PowerBI. I tried various method available on internet but its showing the above error. Although I've done this connection on AWS RDS. I installed required dependencies (GAC) and all the certificates required for PowerBI.
Following worked for me:
File / Options and settings / Data source settings
then select data source
and Edit Permissions and uncheck encrypt connections
I've came across the same issue, unfortunately I didn't find solution to resolve it. But I found an alternative.
You can connect PostgreSQL using ODBC Connection.
Setup ODBC for PostgreSQL: https://www.postgresql.org/ftp/odbc/versions/msi/
After Installation, Select ODBC Connection under "Get Data"
Select "None" under Data Source Name and
add following statement under connection string:
Driver={PostgreSQL ANSI(x64)};Server=<host>;Port=5432;Database=<dbname>
Click "Next"
Enter Username and Password, Click Connect.
If credentials are correct, you will see list of tables available in database.
Follow this reference for detailed description:
http://niftit.com/connecting-power-bi-to-postgresql/
Two hours wasted, so writing in full.
Download and install postgresql ODBC driver
Goto below URL
URL: https://www.postgresql.org/ftp/odbc/versions/msi/
Scroll down
Click on a zip file to download (i took psqlodbc_12_00_0000-x64.zip)
Unzip file
Run the .MSI file
Take all defaults given and install it
Create ODBC data source
Find the ODBC data source using below (I took "ODBC Data Sources (64-bit)"):
Windows > Start button > search for "ODBC Data Sources"
User DSN > PostgreSQL ANSI(x64) > Finish
Give details
Data source name : PostgreSQL30 ###
DB name *** , server, port, username, pwd
SSL mode = disabled (default)
click on Test button
"Connection successful" message will come, else re-check details above.
We now have a new User DS, with PostgreSQL30 created
Download Power BI
Windows > Start button > Microsoft Store
Search for "Power BI Desktop" > Get/Install
Source: https://learn.microsoft.com/en-us/power-bi/desktop-get-the-desktop#download-power-bi-desktop
Running the Power BI
Get Data (On the left)
Search for "odbc" > Select "ODBC" on right pane > Connect
DSN > PostgreSQL30 ( --- this is same as above ### --- )
OK
"Navigator" dialog is shown, with "Display Options"
ODBC ... PostgreSQL30
> DB name ( --- this is same as above *** --- )
Open the > button on left of DB name
select the tables
click "Load" button
Done.
You have successfully connected Power BI (PBI) to your postgres or other database.
Hope this helps.
For AWS look at this case https://community.powerbi.com/t5/Desktop/The-remote-certificate-is-invalid-according-to-the-validation/td-p/531475
For non-AWS issue you should configure SSL according to Npgsql documentation https://www.npgsql.org/doc/security.html or you can disable SSL option in postgresql.conf on postgresql server.
adding onto #chirag sanghvi answer
You may get an error
ERROR: character 0xefbfbd of encoding "UTF8" has no equivalent in "WIN1252"
because your database is encoded in UTF-8
Install this driver
https://github.com/npgsql/npgsql/releases/tag/v4.1.3
then in your connection string use the Unicode driver
Driver={PostgreSQL Unicode(x64)};Server=;Port=5432;Database=

Secure Oozie Web Console not working from my Windows machine

I have setup a secure(Kerberos) Oozie environment in CentOS 6.3 using CDH 4.1.2. I am able to view the Oozie web console from CentOS machine which is hosted in server. But is there a way to view the webconsole from my local Windows machine.
I have tried creating a HTTP principal with my windows machine as hostname. I am able to get a valid ticket for HTTP principal. But when I open the Oozie Web Console, I get the following error
org.apache.hadoop.security.authentication.client.AuthenticationException: GSSException: Defective token detected (Mechanism level: GSSHeader did not find the right tag)
Am I missing something. Help me guys.
Thanks,
Vishnu Ganth
This error occurs because your browser sends request for NTLM authentication instead of kerberos.
In internet explorer follow below steps,
go to Internet Options
In security tab, select Local intranet.
Click Custom Level in the below, Make sure Automatic logon only in intranet zone under the User Authentication section.
In the Internet Options, select Advanced tab and make sure enable Integrated Windows Authentication selected under security section.
Once the above steps done, it will work on both internet explorer and google chrome.
If you are accesing it from the Cross realm, your widows-based clients should know the KDC location to create proper SPNEGO token. You need either create a separate policy in your AD for that type of users or you can manually from command line add mappings in client machine's registeries so that they would know about your Hadoop realm KDC:
ksetup /addkdc HADOOP.DOMAIN.COM hadoop.nodewithkdc.com
ksetup /addhosttorealmmap hadoop.nodewithkdc.com HADOOP.DOMAIN.COM

error logging in to windows azure sql database

Typed the correct username and password created in sql database, did the firewall settings and Silverlight ver is 5. Still unable to access. Need some help! There was an error connecting to the server. Failed to retrieve connection information. Try to login again.
You can reset the DS Server password from the portal. Navigate via Azure Management Console, then go to SQL Databases, then go to SERVERS tab. Then go to DASHBOARD. The find Reset Administrator Password, click that to reset the password.
Then try again.

Resources