Problems using the linuxservers portion of the azure/compute module

I am running into the following error when trying to use this module.

Here is my code

module "linuxservers" {
  source              = "Azure/compute/azurerm"
  resource_group_name = azurerm_resource_group.example.name
  admin_username      = ""
  admin_password      = ""
  vm_os_simple        = "UbuntuServer"
  public_ip_dns       = var.public_ip_dns // change to a unique name per datacenter region
  vnet_subnet_id      = module.network.vnet_subnets[0]
  nb_instances        = 2
  ssh_key             = "~/.ssh/azureuser.pem"
  depends_on = [azurerm_resource_group.example]

Here is the error I am seeing.

│ Error: Invalid function argument
│
│   on main.tf line 39, in module "linuxservers":
│   39:   ssh_key             = file("~/.ssh/azureuser.pem")
│
│ Invalid value for "path" parameter: no file exists at ~/.ssh/azureuser.pem;
│ this function works only with files that are distributed as part of the
│ configuration source code, so if this file will be created by a resource in
│ this configuration you must instead obtain this result from an attribute of
│ that resource.

This file however does exist. Any ideas?