Trying to test a mocked data source which works on my machine but not on a ADO linux build agent

I have a Terraform test which works locally but fails when I run it on a Azure DevOps Linux build server. The Terraform I am testing is adding a Azurerm Monitor Diagnostic Setting on a Key Vault like the one in the link. This is a module I am updating to add the diagnostic settings, which had worked with a basic terraform test.

The terraform test is

The log analytics workspace has already been created.

mock_provider "azurerm" {
  mock_data "azurerm_log_analytics_workspace" {
    defaults = {
      name                = "log-lz-storage-log-all-eus-001"
      resource_group_name = "rg-lz-storage-log-all-eus"
    }
  }
  override_data {
    target = data.azurerm_log_analytics_workspace.log_workspace
    values = {
      id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-lz-storage-log-all-eus/providers/Microsoft.OperationalInsights/workspaces/log-storage-all-eus-001"
    }
  }
}

variables {
  name          = "test"
  location      = "cus"
  environment   = "tst"

  resource_group_name           = "rg-f5-test-01"
  public_network_access_enabled = true
  tenant_id                     = "12345678-1234-1234-1234-123456789abc"
}

## Test valid variables

run "key_vault_basic_asserts" {
  command = plan

  assert {
    condition     = try(azurerm_key_vault.kv.name == "kv-test-tst-cus-1", false)
    error_message = "Key Vault name does not match expected format kv-test-tst-cus-1"
  }

}

Even without the asserts it still fails as shown below.

Initializing the backend...
Initializing modules...
- test.tests.key-vault.setup_tests in tests/setup

Initializing provider plugins...
- Finding hashicorp/azurerm versions matching ">= 3.101.0"...
- Finding latest version of hashicorp/http...
- Finding hashicorp/random versions matching ">= 3.5.1"...
- Installing hashicorp/azurerm v4.46.0...
- Installed hashicorp/azurerm v4.46.0 (signed by HashiCorp)
- Installing hashicorp/http v3.5.0...
- Installed hashicorp/http v3.5.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!
tests/key-vault.tftest.hcl... in progress
  run "key_vault_basic_asserts"... fail
╷

##[error]PowerShell exited with code '1'.

Just spitballing -– could be totally off base… but if you try it locally but with any credentials you have setup to authenticate against the cloud provider, does it still work then? Is it possible there’s still something that’s not mocked?

I did try with any credentials locally and it didn’t work.
Is there an example somewhere I can use to get my mock to work.

I also tried adding an alias to the mock provider to match the one used in the data source.