I can still create a media service manually, but not through the API because its "Deprecated" even though it isn't until June...

How can I get around this issue for my Terraform to succeed?

enter image description here

Ran terraform deployment, failed due to 400

media.MediaservicesClient#CreateOrUpdate:
Failure responding to request: StatusCode=400 --
Original Error:
autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="Creation of new Media Service accounts are not allowed as the resource has been deprecated." Details=[{"code":"MediaServiceAccountCreationDisabled","message":"Creation of new Media Service accounts are not allowed as the resource has been deprecated."}]

1

There are 1 best solutions below

0
Jahnavi On

After a workaround on this issue, I found that the resource Media services has been deprecated and complete deprecation is from June 2024. Refer Azure Media Services retirement MS Doc for the relevant information.

Due to this, creating ams accounts through an API is also disabled. I tried creating it using Portal, CLI as well as below terraforms resource but none of these are worked as shown below.

Note: Once this deprecation is done, it will migrate to AMS v3 for managing components and functionality.

Portal:

enter image description here

Terraform registry: azurerm_media_services_account

Terraform code:

provider "azurerm"{
features{}
}

data "azurerm_resource_group" "example" {
  name     = "xxx"
}

resource "azurerm_storage_account" "example" {
  name                     = "examplestoracck"
  resource_group_name      = data.azurerm_resource_group.example.name
  location                 = data.azurerm_resource_group.example.location
  account_tier             = "Standard"
  account_replication_type = "GRS"
}

resource "azurerm_media_services_account" "example" {
  name                = "samplemediaacck"
  location            = data.azurerm_resource_group.example.location
  resource_group_name = data.azurerm_resource_group.example.name

  storage_account {
    id         = azurerm_storage_account.example.id
    is_primary = true
  }
}

Same error message when tried to deploy with above terraform configuration as well:

enter image description here

CLI:

az ams account create --name mymediack --resource-group xxx --storage-account newblobjah

enter image description here

If your requirement things permits, you may delay the creation of new AMS accounts(V3) until the deprecation date is done.