Skip to content

Commit

Permalink
Add media connector bicep files (#116)
Browse files Browse the repository at this point in the history
## Purpose

* Add media connector bicep files
* Referenced from docs media connector how-to article
  • Loading branch information
dominicbetts authored Feb 21, 2025
1 parent 768bc3e commit 5f84f2f
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 0 deletions.
38 changes: 38 additions & 0 deletions samples/media-connector-bicep/aep-media-connector.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
metadata description = 'Asset endpoint profile for media connector'

@description('The RTSP endpoint for the media stream.')
param targetAddress string

@description('The name of the custom location you are using.')
param customLocationName string

@description('Specifies the name of the asset endpoint resource to create.')
param aepName string

@description('The name of the Kubernetes secret you are using.')
param secretName string

/*****************************************************************************/
/* Asset endpoint profile */
/*****************************************************************************/
resource assetEndpoint 'Microsoft.DeviceRegistry/assetEndpointProfiles@2024-11-01' = {
name: aepName
location: resourceGroup().location
extendedLocation: {
type: 'CustomLocation'
name: customLocationName
}
properties: {
targetAddress: targetAddress
endpointProfileType: 'Microsoft.Media'
#disable-next-line no-hardcoded-env-urls //Schema required during public preview
additionalConfiguration: '{"@schema":"https://aiobrokers.blob.core.windows.net/aio-media-connector/1.0.0.json"}'
authentication: {
method: 'UsernamePassword'
usernamePasswordCredentials: {
passwordSecretName: '${secretName}/password'
usernameSecretName: '${secretName}/username'
}
}
}
}
37 changes: 37 additions & 0 deletions samples/media-connector-bicep/asset-clip-to-fs.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
metadata description = 'Media asset that saves clips to the file system.'

@description('The name of the custom location you are using.')
param customLocationName string

@description('Specifies the name of the asset endpoint resource to use.')
param aepName string

@description('The name of the asset you are creating.')
param assetName string = 'asset-clip-to-fs'

/*****************************************************************************/
/* Asset */
/*****************************************************************************/
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
name: assetName
location: resourceGroup().location
extendedLocation: {
type: 'CustomLocation'
name: customLocationName
}
properties: {
assetEndpointProfileRef: aepName
datasets: [
{
name: 'dataset1'
dataPoints: [
{
name: 'clip-to-fs'
dataSource: 'clip-to-fs'
dataPointConfiguration: '{"taskType":"clip-to-fs","autostart":true,"realtime":true,"loop":true,"format":"avi","duration":3}'
}
]
}
]
}
}
37 changes: 37 additions & 0 deletions samples/media-connector-bicep/asset-snapshot-to-fs.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
metadata description = 'Media asset that saves snapshots to the file system.'

@description('The name of the custom location you are using.')
param customLocationName string

@description('Specifies the name of the asset endpoint resource to use.')
param aepName string

@description('The name of the asset you are creating.')
param assetName string = 'asset-snapshot-to-fs'

/*****************************************************************************/
/* Asset */
/*****************************************************************************/
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
name: assetName
location: resourceGroup().location
extendedLocation: {
type: 'CustomLocation'
name: customLocationName
}
properties: {
assetEndpointProfileRef: aepName
datasets: [
{
name: 'dataset1'
dataPoints: [
{
name: 'snapshot-to-fs'
dataSource: 'snapshot-to-fs'
dataPointConfiguration: '{"taskType":"snapshot-to-fs","autostart":true,"realtime":true,"loop":true,"format":"jpeg","fps":1}'
}
]
}
]
}
}
37 changes: 37 additions & 0 deletions samples/media-connector-bicep/asset-snapshot-to-mqtt.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
metadata description = 'Media asset that publishes snapshots to MQTT.'

@description('The name of the custom location you are using.')
param customLocationName string

@description('Specifies the name of the asset endpoint resource to use.')
param aepName string

@description('The name of the asset you are creating.')
param assetName string = 'asset-snapshot-to-mqtt'

/*****************************************************************************/
/* Asset */
/*****************************************************************************/
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
name: assetName
location: resourceGroup().location
extendedLocation: {
type: 'CustomLocation'
name: customLocationName
}
properties: {
assetEndpointProfileRef: aepName
datasets: [
{
name: 'dataset1'
dataPoints: [
{
name: 'snapshot-to-mqtt'
dataSource: 'snapshot-to-mqtt'
dataPointConfiguration: '{"taskType":"snapshot-to-mqtt","autostart":true,"realtime":true,"loop":true,"format":"jpeg","fps":1}'
}
]
}
]
}
}
40 changes: 40 additions & 0 deletions samples/media-connector-bicep/asset-stream-to-rtsp.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
metadata description = 'Media asset that streams RTSP to a media server.'

@description('The name of the custom location you are using.')
param customLocationName string

@description('Specifies the name of the asset endpoint resource to use.')
param aepName string

@description('The name of the asset you are creating.')
param assetName string = 'asset-stream-to-rtsp'

@description('The IP address of your media server.')
param mediaServerAddress string

/*****************************************************************************/
/* Asset */
/*****************************************************************************/
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
name: assetName
location: resourceGroup().location
extendedLocation: {
type: 'CustomLocation'
name: customLocationName
}
properties: {
assetEndpointProfileRef: aepName
datasets: [
{
name: 'dataset1'
dataPoints: [
{
name: 'stream-to-rtsp'
dataSource: 'stream-to-rtsp'
dataPointConfiguration: '{"taskType":"stream-to-rtsp","autostart":true,"realtime":true,"loop":true,"media_server_address":"${mediaServerAddress}"}'
}
]
}
]
}
}

0 comments on commit 5f84f2f

Please sign in to comment.