Here's the script I used to retrieve secrets from an Azure Key Vault.
Clear-Host
Hi, my name is Regie. This is my DBA diary. I have been a DBA for almost 20+ years. The current database I'm working with is SQL Server. I will post articles and solutions that I encounter on my day-to-day adventures as a DBA. Please join my journey, let's have fun.
Here's the script I used to retrieve secrets from an Azure Key Vault.
Clear-Host
Today, I needed to force an Invoke-WebRequest command to use TLS 1.2 to test access to Azure Key Vault. I ran the command below to force it:
[Net.ServicePointManager]::SecurityProtocol =[Net.SecurityProtocolType]::Tls12
And, here's the Invoke-WebRequest command I was using for testing:
$(Invoke-WebRequest -UseBasicParsing -Uri https://your-key-vault-name/healthstatus).Headers
Yesterday, I had to run a full backup of a 764 GB database to clear up the differential backup that grew up to 600 GB (almost the same size as the database) because of enabling TDE on the database after a full restore.
This database is being restored every first weekend of the month. And we enable TDE encryption after. A full backup is immediately run after.
At a high level, here are the SQL Agent Job steps that we had:
The issue here is that after the TDE job step, the job goes on and immediately runs the full backup step. This causes the next differential backup to be huge. As it will change all the pages in the database after the full database backup.
To Remedy the issue, I had to add a few steps to the restore job, and I had to disable the differential backups until the TDE encryption was done.
At a high level, the job now looks like this:
Here's the code I used to disable/enable the differential backup job:
Today, I was teaching a co-worker how to create a copy only backup of a SQL Managed Instance database. And I came up to use this script t...