Content Developer II at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
125261 stories
·
29 followers

Announcing v7.0 Support on vCore-based Azure Cosmos DB for MongoDB

1 Share

Image Announcing v7 0 Support

 

 

We are thrilled to announce that vCore-based Azure Cosmos DB for MongoDB now officially supports version 7.0. This addition expands our range of supported versions to include 5.0, 6.0, and now 7.0, providing you with more options when setting up a new cluster. Simply select the version of your choice from the dropdown while provisioning a new server.

Furthermore, we are offering all our existing customers a smooth upgrade path to the latest version at the click of a button, ensuring uninterrupted business operations. To learn more please refer the step-by-step upgrade guide.

Upgrade today and step into the future of databases!

About Azure Cosmos DB

Azure Cosmos DB is a fully managed and serverless distributed database for modern app development, with SLA-backed speed and availability, automatic and instant scalability, and support for open-source PostgreSQL, MongoDB, and Apache Cassandra. Try Azure Cosmos DB for free here. To stay in the loop on Azure Cosmos DB updates, follow us on XYouTube, and LinkedIn.

The post Announcing v7.0 Support on vCore-based Azure Cosmos DB for MongoDB appeared first on Azure Cosmos DB Blog.

Read the whole story
alvinashcraft
8 minutes ago
reply
West Grove, PA
Share this story
Delete

Calling a REST Endpoint from Azure SQL DB

1 Share

External REST endpoint invocation in Azure SQL DB went GA in August 2023. Whereas before, we might have needed an intermediate technology to make a REST call to an Azure service, we can now use an Azure SQL Database to call a REST endpoint directly.

One use case for this would be to retrieve a file from blob storage. I explain how to set this up below.

Azure Preparations

Before we can do the SQL parts, we need to do a bit of setup. First, we need to enable the system-assigned managed identity for the Azure SQL server. This is currently located under Security -> Identity in the Azure portal. Once this is on, go to your storage account in which you want to read and/or write data and add read permissions. This could be done by adding the managed identity to the Storage Blob Data Reader role on the container.

You’ll also need to make sure that your storage account firewall will allow traffic from the Azure SQL server to the storage account. The way to accomplish this will differ depending on your network configuration. Azure SQL servers don’t have a dedicated static IP address by default. You may only be allowed to use private endpoints instead of public. While the fastest way to do this would be to allow public network access from all networks, or to allow Azure services on the trusted services list to access the storage account, that presents some security risks and is not recommended for actual solutions containing organizational data. Whatever your setup, your database needs to talk to your storage account.

SQL Preparations

The remaining steps can be done in T-SQL. But before we can query the data, we need to create a master key (if one is not already created) and database-scoped credential.

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'xxxxxxxxxxxxxxxxxxxxxxxxxx'; --change this value to a real value
GO 
CREATE DATABASE SCOPED CREDENTIAL [https://myaccountname.blob.core.windows.net] 
with identity = 'Managed Identity',  
secret = '{"resourceid": "https://storage.azure.com" }'; 

SQL Call to REST Endpoint

The actual SQL call to the rest endpoint uses the sp_invoke_external_rest_endpoint stored procedure. Let’s say I have a single JSON file I want to read into the database. Here’s the SQL I might use.

declare @response nvarchar(max); 
declare @url nvarchar(4000) = 'https://myaccountname.blob.core.windows.net/container1/MyFile.json'; 
Exec sp_invoke_external_rest_endpoint 
@url = @url, 
@headers = '{"Accept":"application/json","x-ms-version" : "2022-11-02"}', 
@method = 'GET', 
@credential = [https://myaccountname.blob.core.windows.net], 
@response = @response output 
Select @response;

Explanation

We are using SQL to directly call the Get Blob REST operation. The Azure SQL server managed identity is the actual user calling the REST endpoint in my code above. Alternatively, you could use a Shared Access Signature instead of the managed identity. Your arguments in sp_invoke_external_rest_endpoint will look a little different in that case.

You must create a database scoped credential to be used in this invocation if the API requires authentication credentials to be passed. There is no default value for @credential.

For for this API call specifically, I included the Accept header. I specified “application/json”, which is the default value, just so it is more explicit what I will receive in my response (JSON). This could also be “application/xml” or “text/*”. The x-ms-version header is required. There are several other optional headers that you could include as needed.

We are doing a GET operation to read a file in the example code. But we could just as easily do a PUT or another operation.

Don’t forget to grant access to the appropriate user(s) to use the database scoped credential. Otherwise, those users cannot sucessfully execute the stored procedure.

Limitations

There will be times when sp_invoke_external_rest_endpoint is not appropriate. These include:

  • When your request or response is larger 100 MB (UTF-8) format
  • The request URL length is larger than 8 KB or the query string is larger than 4 KB
  • The request or response headers size is larger than 8 KB.
  • Your endpoint uses TLS 1.1 or earlier.

More Possibilities

In addition to calling Azure blob storage APIs, there are several other Azure services we can call using sp_invoke_external_rest_endpoint. We could write to Azure Files, call an Azure Function or a Logic App, send data to Event Hubs or Stream Analytics, or execute DAX queries in the Power BI service.

Are you using sp_invoke_external_rest_endpoint? If so, let me know what you are doing with it in the comments.

The post Calling a REST Endpoint from Azure SQL DB appeared first on SQLServerCentral.

Read the whole story
alvinashcraft
8 minutes ago
reply
West Grove, PA
Share this story
Delete

Daily Reading List – July 22, 2024 (#360)

1 Share

I was called for jury duty today, which meant I waited in a room with a couple hundred folks to see if I was needed for a trial. Alas, I wasn’t chosen. But I was able to do some reading while I waited!

[blog] How to build user authentication into your gen AI app-accessing database. Your AI app augments it’s LLM input with info from a database? Cool. How do you control access and avoid giving sensitive data to the wrong person? This post offers up an access pattern.

[blog] HTMX or React: What Should You Choose? If you’re getting lukewarm on frontend frameworks, you might like the the built-in dynamism of HTMX.

[article] Hands On. I often wonder when I stop going on “hands on” with tech, and I think the answer is “never.” I find it rewarding to roll up my sleeves and use whatever I talk about.

[blog] Developing domain expertise: get your hands dirty. Somewhat related to the above piece. It’s about going deep by studying, talking to others, and getting personally involved in the work.

[blog] Modern SecOps Masterclass: Now Available on Coursera. Legit-looking course that spans six weeks and is platform-agnostic.

[article] Survey Surfaces Troubling Signs of Software Supply Chain Insecurity. As often seems to be the case, execs are out of sync with what practitioners say is really happening within the org.

[blog] Control LLM costs with context caching. Here’s a nice little example of the power of context caching for LLMs like Gemini that take in a long context.

[article] State of Developer Experience 2024, This offers a deeper dive into some of the data I shared last week. See what developers care about.

Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:



Read the whole story
alvinashcraft
9 minutes ago
reply
West Grove, PA
Share this story
Delete

Visual Studio Uses RUBICON to Improve AI Conversations

1 Share
AI assistants have improved coding productivity, but how do you know if they're getting better?
Read the whole story
alvinashcraft
3 hours ago
reply
West Grove, PA
Share this story
Delete

Windows 3.1 keeps Southwest flying high (News)

1 Share

Brendan Gregg details how eBPF can help us have no more blue Fridays, Misty De Meo thinks GitHub is starting to feel like legacy software, Gavin D. Howard does not want Rust to be used for everything, The Notion team published a deep dive into how they used the WASM version of SQLite to improve browser performance & Gregor Ojstersek writes up how to build good relationships inside and outside your engineering teams.

Leave us a comment

Changelog++ members support our work, get closer to the metal, and make the ads disappear. Join today!

Sponsors:

Featuring:

Show Notes:

All links mentioned in this episode of Changelog News (and more) are in its companion newsletter.

Something missing or broken? PRs welcome!





Download audio: https://op3.dev/e/https://cdn.changelog.com/uploads/news/104/changelog-news-104.mp3
Read the whole story
alvinashcraft
3 hours ago
reply
West Grove, PA
Share this story
Delete

#471: Learning and teaching Pandas

1 Share
If you want to get better at something, often times the path is pretty clear. If you get better at swimming, you go to the pool and practice your strokes and put in time doing the laps. If you want to get better at mountain biking, hit the trails and work on drills focusing on different aspects of riding. You can do the same for programming. Reuven Lerner is back on the podcast to talk about his book Pandas Workout. We dive into strategies for learning Pandas and Python as well as some of his workout exercises.

Episode sponsors

Sentry Error Monitoring, Code TALKPYTHON
Scalable Path
Talk Python Courses

Links from the show

Reuven Lerner on Twitter: @reuvenmlerner
Pandas Workout Book: manning.com
Bamboo Weekly: Solar eclipse: bambooweekly.com
Bamboo Weekly: Avocado hand: bambooweekly.com
Scaling data science across Python and R: talkpython.fm
Watch this episode on YouTube: youtube.com
Episode transcripts: talkpython.fm

--- Stay in touch with us ---
Subscribe to us on YouTube: youtube.com
Follow Talk Python on Mastodon: talkpython
Follow Michael on Mastodon: mkennedy




Download audio: https://talkpython.fm/episodes/download/471/learning-and-teaching-pandas.mp3
Read the whole story
alvinashcraft
3 hours ago
reply
West Grove, PA
Share this story
Delete
Next Page of Stories