Connect Logic App to Azure Sql Securely

The Problem Recently, I was working on a personal project where I needed to export data from my Azure SQL Database into a JSON file roughly every hour. This JSON file would then be used by a static website hosted on Azure Blob Storage. I wanted a secure way to do this without maintaining passwords, so I decided to use Managed Identity to connect my Logic App to the Azure SQL Database. ...

Mon, 16 September 2024 · 3 min · Mark

SQLMI Restore Blob Storage Access Denied

If you are using Azure SQL Managed Instance and encounter an error like this when restoring a database from an Azure Blob Storage container: Msg 3201, Level 16, State 2, Line 1 Cannot open backup device 'https://{storage-account}.blob.core.windows.net/my-container/mydb/FULL/mydb-backup.bak'. Operating system error 5(Access is denied.). You can try the following steps to fix it: 1. Check the SAS token and generate a new one if needed. The most common cause of this error is that the SAS token used to access the Azure Blob Storage container has expired or is invalid. A SAS token is a shared access signature that grants limited access to a resource in Azure. You can generate a SAS token for your Azure Blob Storage container using the Azure portal, PowerShell, CLI, or SDK. ...

Tue, 8 August 2023 · 2 min · Mark

Which ADF Integration Runtime for my workload?

Self Hosted or Managed Virtual Network for ADF? I was recently asked which runtime would be better to run ADF pipelines in Azure; use Private Managed Endpoints with the Managed Virtual Network, or provision a Self-Hosted Integration Runtime on a Virtual Machine? PaaS vs. IaaS My default position on which technology to use is PaaS where possible. Organisations should focus on providing value to their business, not micro-managing infrastructure. PaaS reduces the operational burden of managing infrastructure in most cases. ...

Wed, 29 March 2023 · 4 min · Mark

How to Move a VM to Another Vnet in Azure

Hello everyone, In this blog post, I want to share with you a problem that I faced this week with moving a VM from one vnet to another in Azure. It was not as easy as I expected and it required some downtime. The problem I had a VM that needed to move to another vnet as part of organisational change. I thought it would be a simple task of creating a new network interface card (NIC) in the target vnet and attaching it to the VM. However, it seems that it’s not possible to create a NIC in another Vnet and attach it to a VM attached to a different vnet. Also, as you may know a VM must have at least one NIC attached at all times which must be connected to a vnet. ...

Sun, 19 March 2023 · 3 min · Mark

The Importance of Testing Your Azure Backups

My recent experience Disaster recovery testing is a critical aspect of any organization’s infrastructure. It is crucial to regularly test the resilience of your systems and make sure that they are properly backed up and can be restored in case of an emergency. Recently, a VM that had been restored as part of disaster recovery testing would not start but entered an infinite blue-screen boot loop. Blue screen loop Testing Backups As part of disaster recovery resilience testing, I restored a virtual machine from Azure Recovery Services Vault. The first test was done using the latest snapshot backup, and it took around two minutes to complete. However, when I checked the overview page for the virtual machine in the Azure portal, I noticed that the virtual machine agent status was not ready. This meant that I couldn’t connect to the VM, not even from within the virtual network. ...

Tue, 28 February 2023 · 2 min · Mark

Troubleshooting Get-AzVirtualNetwork

Are you encountering the following error message when working with Azure in PowerShell and running the command Get-AzVirtualNetwork? 'Microsoft.Azure.Management.Network.Models.SecurityRule', on 'T MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type 'T'. This error can be caused by an incompatibility between PowerShell 7 and the Az Module and incompatibilty with .NET 7. To fix this issue, try the following steps: Upgrade to the latest versions of PowerShell 7 and the Az module. If the issue persists, remove all versions of the Az Module on your system by using the command Uninstall-Module Az -AllVersions. ...

Mon, 16 January 2023 · 1 min · Mark

Sql Virtual Machine Race Conclusion

A couple of months ago I wrote about a race condition in a SQL IaaS VM using the Azure sqlvm resource. I have been working with Microsoft and have come to a better resolution than placing tempdb on a separate remote drive as mentioned in that article. Suggestion Microsoft suggested to change the startup type of the SQL Server service to Automatic (Delayed Start). I have now put this into the bicep template for both SQL Server and SQL Server Agent service. ...

Thu, 30 June 2022 · 3 min · Mark

Sql Virtual Machine Race Condition

I’ve been having problems deploying a Sql Virtual Machine in Azure lately and decided to perform some tests to get to the bottom of the issue. I’d like to share some strange behaviour. Problem If I deploy a new SQL VM using bicep, it deploys fine. If however, I redeploy the same VM the deployment fails with this error: Ext_AutomatedBackupError * code: **Ext_AutomatedBackupError** * Error: **Execution Timeout Expired**. The timeout period elapsed prior to completion of the operation or the server is not responding.;System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out. In the SQL Server ERRORLOG on the VM: ...

Tue, 12 April 2022 · 5 min · Mark

Where to store Azure Pipelines Variables?

Question Where should variables be stored for deploying infrastructure-as-code in Azure DevOps pipelines to Azure? Resources need to be deployed to different regions and environments, and attributes for these need to be stored somewhere. Options Six options spring to mind. Parameter files. Seems like the obvious choice. Template file defaults in azuredeploy.json or main.bicep Azure DevOps Library variable groups. Seems good, a single place Azure Pipelines variables in individual pipelines Configuration file within the project source code Runtime parameters for setting values at run time Let’s go through each option and then discuss my preferred approach. ...

Fri, 4 March 2022 · 7 min · Mark

Automate Setting the SqlIaaS Backup Container

Even though Microsoft offer Azure Sql Database and Azure Sql Managed Instance, there are occasions when SQL Server in a VM is required. The SqlIaaS Azure Resource If you’ve read my posts before you will know that I deploy resources to the cloud using infrastructure-as-code, with my preferred language being bicep. As a lazy developer, I like to use built-in offerings and PaaS wherever possible. For SQL server on VMs in Azure, the resource Microsoft.SqlVirtualMachine/sqlVirtualMachines is great. ...

Fri, 25 February 2022 · 2 min · Mark