Reputation: 106
An external data provider has provided an API that returns data in a json format.
In excel powerquery, I can connect to the dataset and get results in a table (not that it matters, but 20 columns and 1k rows).
I'd like to access this data as a table from a stored procedure in my azure SQL database.
If the web address is 'https://something.something.com/api/1' and my working login info: username: u password: p
What's the simplest way to write the results from the API call into a new table?
I'm challenged at even the first step: calling the data from SQLQuery. 'OPENROWSET' rowset provider is apparently not supported in this version of SQL Server (per an error message I received the SSMS query editor).
'OPENJSON' doesn't seem to have syntax related to passing a username and password to an API call.
Upvotes: 0
Views: 120
Reputation: 689
I'd like to access this data as a table from a stored procedure in my azure SQL database.
Sorry, PaaS does not support calling API from Azure stored procedures (Azure SQL DB).
You can store JSON data through Stored Procedure in Azure SQL Database.
What's the simplest way to write the results from the API call into a new table?
To call the API to collect and load the data in Azure SQL Server, execute the Copy Data activity with a REST dataset.
For more information you can refer this Document by @Rohit Vangala
Reference: Copy and transform data from and to a REST endpoint by using Azure Data Factory
Upvotes: 1