Contents

Az.Sql Module won't load

Contents

Today, the Az.Sql module would not load on my machine when attempting to manually fail over a SQL Managed Instance with this error:

/blog/az-sql-module/2021-03-16_18-19-15.png
module could not be loaded

I followed the advice of the error message and tried to import the module to get further information.

/blog/az-sql-module/2021-03-16_18-19-54.png
module is already loaded

Hmmm 🤔

I decided to uninstall the Azure PowerShell from my machine using the Windows 10 Settings App. Looks like an old version.

/blog/az-sql-module/2021-03-16_18-22-25.png
Uninstall Azure PowerShell

I then tried to reinstall the Az module using PowerShell but it still found an old version in my personal OneDrive\Documents folder.

/blog/az-sql-module/2021-03-16_18-24-00.png
Warning version already installed

I went into Windows Explorer and deleted that, and then all was fine for the installation and the PowerShell cmdlets for Az.Sql worked fine again.

/blog/az-sql-module/2021-03-16_18-27-27.png
Installing module for all users
/blog/az-sql-module/2021-03-16_18-28-51.png
Working fine now