|
| 1 | +# Terraform Template: <br/> Media Services (retired) → Azure AI Video Indexer (ARM-based via AzAPI) |
| 2 | + |
| 3 | +Costa Rica |
| 4 | + |
| 5 | +[](https://github.com/) |
| 6 | +[brown9804](https://github.com/brown9804) |
| 7 | + |
| 8 | +Last updated: 2026-02-10 |
| 9 | + |
| 10 | +------------------------------------------ |
| 11 | + |
| 12 | +> This template deploys an **Azure AI Video Indexer** account (ARM-based) plus its required **Storage Account**, and grants the Video Indexer managed identity the **Storage Blob Data Contributor** role on the storage account. |
| 13 | +
|
| 14 | +> [!IMPORTANT] |
| 15 | +> **Azure Media Services (AMS) is retired** and Microsoft **blocks creation of new AMS accounts in all Azure regions**. This template uses Azure AI Video Indexer as the supported replacement for video/audio analysis workflows, and uses the `azapi` provider to deploy `Microsoft.VideoIndexer/accounts@2024-01-01`. |
| 16 | +
|
| 17 | +## File Descriptions |
| 18 | + |
| 19 | +- **main.tf**: Creates the Resource Group, Storage Account, Azure AI Video Indexer account (via `azapi_resource`), and role assignment. |
| 20 | +- **variables.tf**: Defines the input variables. |
| 21 | +- **provider.tf**: Configures the Azure providers (uses Azure CLI auth context). |
| 22 | +- **terraform.tfvars**: Example values. |
| 23 | +- **outputs.tf**: Exposes resource IDs and the Video Indexer principal ID. |
| 24 | + |
| 25 | +## Variables |
| 26 | + |
| 27 | +| Variable Name | Description | Type | Example Value | |
| 28 | +| --- | --- | --- | --- | |
| 29 | +| `resource_group_name` | The name of the resource group to create. | string | `"rg-media-services-dev"` | |
| 30 | +| `location` | Azure region for deployment. | string | `"East US"` | |
| 31 | +| `video_indexer_account_name` | Azure AI Video Indexer account name. | string | `"vi-media-dev-001"` | |
| 32 | +| `storage_account_name` | Storage account name (globally unique). | string | `"stmediadev001abc"` | |
| 33 | +| `tags` | Tags applied to supported resources. | map(string) | `{ env = "dev" }` | |
| 34 | + |
| 35 | +## Usage |
| 36 | + |
| 37 | +1. Authenticate: |
| 38 | + |
| 39 | + ```sh |
| 40 | + az login |
| 41 | + ``` |
| 42 | + |
| 43 | +2. (Optional) Select subscription: |
| 44 | + |
| 45 | + ```sh |
| 46 | + az account set --subscription "<subscription-id-or-name>" |
| 47 | + ``` |
| 48 | + |
| 49 | +3. Initialize: |
| 50 | + |
| 51 | + ```sh |
| 52 | + terraform init -upgrade |
| 53 | + ``` |
| 54 | + |
| 55 | +4. Validate and plan: |
| 56 | + |
| 57 | + ```sh |
| 58 | + terraform validate |
| 59 | + terraform plan |
| 60 | + ``` |
| 61 | + |
| 62 | +5. Apply: |
| 63 | + |
| 64 | + ```sh |
| 65 | + terraform apply -auto-approve |
| 66 | + ``` |
| 67 | + |
| 68 | +## Outputs |
| 69 | + |
| 70 | +| Output Name | Description | |
| 71 | +| --- | --- | |
| 72 | +| `video_indexer_account_id` | The resource ID of the Azure AI Video Indexer account. | |
| 73 | +| `video_indexer_principal_id` | The managed identity principal ID used for RBAC. | |
| 74 | + |
| 75 | +<!-- START BADGE --> |
| 76 | +<div align="center"> |
| 77 | + <img src="https://img.shields.io/badge/Total%20views-0-limegreen" alt="Total views"> |
| 78 | + <p>Refresh Date: 2026-02-10</p> |
| 79 | +</div> |
| 80 | +<!-- END BADGE --> |
0 commit comments