I have an Azure DevOps pipeline to rotate Cosmos DB account keys. To do this, I'm using PowerShell and the New-AzCosmosDBAccountKey cmdlet.
For some unknown reason, the Az.CosmosDB module is not installed with Az, so it needs to be installed manually each time the pipeline is run.
Install-Module -Name Az.CosmosDb -AllowClobber -Force
When I run this locally everything works as expected, but within Azure DevOps I see an error
The 'Get-AzCosmosDBAccountKey' command was found in the module 'Az.CosmosDB', but the module could not be loaded.
What might be happening in Azure DevOps that differs from what is happening locally?