Could not retrieve the list of available versions for provider 1.42

Based on PR: https://github.com/terraform-providers/terraform-provider-azurerm/pull/5325

azurerm provider version 1.42.0 is required so as to by default install the cosmosdb account with server version 3.6. To achieve this i have added the below in my template which unfortunately fails with the below error.

provider "azurerm" { version = "~> 1.42.0" }

My terraform version: 0.12.9. Also tried with 0.13.0

ERROR
hashicorp/azurerm: no available releases match the given constraints 1.35.0, ~> 1.35.0, ~> 1.42.0, ~> 1.35.0 Could not retrieve the list of available versions for provider

Could someone please point out what is wrong here