How to use Terraform to create Media Service Content Key Policy

Chris Pateman 26 Reputation points
2020-10-19T14:18:56.63+00:00

When using Terraform there is a module to create the Media Service, but not to create the Content Key Policy.
https://www.terraform.io/docs/providers/azurerm/r/media_services_account.html

I can see Azure Content Key Polcies support the .Net SDK, REST api and ARM Templates, so my work around would be to use the Terraform ARM Deployment, but I would rather use more native connection.

Azure Media Services
Azure Media Services
A group of Azure services that includes encoding, format conversion, on-demand streaming, content protection, and live streaming services.
308 questions
{count} votes

Accepted answer
  1. Grmacjon-MSFT 16,956 Reputation points
    2020-10-29T19:56:07.633+00:00

    Hello Chris,

    Based on the response from the engineering team creating content key policy via Terrafrom is currently not supported at this time on Azure Media Service. If you would like to see this as a possible feature please leave your feedback on our Uservoice platform.

    Thanks,

    Grace


1 additional answer

Sort by: Most helpful
  1. Chris Pateman 26 Reputation points
    2020-10-30T08:40:36.25+00:00

    Hello Grace,

    Thank you for the response and I will send the feedback on there.

    For others reading this post a good work around to keep using Terraform for the infrastructure for this feature is to use the ARM deployment module.
    You can then deploy your Media Service via the media service module, get the required details on the output then make up the ARM Template to create the Content Key.

    Media Service: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/media_services_account
    ARM Deployment: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group_template_deployment
    Content Key ARM Scheme: https://learn.microsoft.com/en-us/azure/templates/microsoft.media/mediaservices/contentkeypolicies

    0 comments No comments