Tutorial: deploy Azure Video Indexer by using Bicep
In this tutorial, you create an Azure Video Indexer account by using Bicep.
Note
This sample is not for connecting an existing Azure Video Indexer classic account to an ARM-based Azure Video Indexer account. For full documentation on Azure Video Indexer API, visit the developer portal page. For the latest API version for Microsoft.VideoIndexer, see the template reference.
Prerequisites
- An Azure Media Services (AMS) account. You can create one for free through the Create AMS Account.
Review the Bicep file
One Azure resource is defined in the bicep file:
param location string = resourceGroup().location
@description('The name of the AVAM resource')
param accountName string
@description('The managed identity Resource Id used to grant access to the Azure Media Service (AMS) account')
param managedIdentityResourceId string
@description('The media Service Account Id. The Account needs to be created prior to the creation of this template')
param mediaServiceAccountResourceId string
@description('The AVAM Template')
resource avamAccount 'Microsoft.VideoIndexer/accounts@2022-08-01' = {
name: accountName
location: location
identity:{
type: 'UserAssigned'
userAssignedIdentities : {
'${managedIdentityResourceId}' : {}
}
}
properties: {
mediaServices: {
resourceId: mediaServiceAccountResourceId
userAssignedIdentity: managedIdentityResourceId
}
}
}
Check Azure Quickstart Templates for more updated Bicep samples.
Deploy the sample
Save the Bicep file as main.bicep to your local computer.
Deploy the Bicep file using either Azure CLI or Azure PowerShell
az group create --name exampleRG --location eastus az deployment group create --resource-group exampleRG --template-file main.bicep --parameters accountName=<account-name> managedIdentityResourceId=<managed-identity> mediaServiceAccountResourceId=<media-service-account-resource-id>
The location must be the same location as the existing Azure media service. You need to provide values for the parameters:
- Replace <account-name> with the name of the new Azure video indexer account.
- Replace <managed-identity> with the managed identity used to grant access between Azure Media Services(AMS).
- Replace <media-service-account-resource-id> with the existing Azure media service.
Reference documentation
If you're new to Azure Video Indexer, see:
- The Azure Video Indexer documentation
- The Azure Video Indexer developer portal
- After completing this tutorial, head to other Azure Video Indexer samples, described on README.md
If you're new to Bicep deployment, see:
- Azure Resource Manager documentation
- Deploy Resources with Bicep and Azure PowerShell
- Deploy Resources with Bicep and Azure CLI
Next steps
Connect an existing classic paid Azure Video Indexer account to ARM-based account
Feedback
Submit and view feedback for