Skip to content

Commit 5f84f2f

Browse files
authored
Add media connector bicep files (#116)
## Purpose * Add media connector bicep files * Referenced from docs media connector how-to article
1 parent 768bc3e commit 5f84f2f

File tree

5 files changed

+189
-0
lines changed

5 files changed

+189
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
metadata description = 'Asset endpoint profile for media connector'
2+
3+
@description('The RTSP endpoint for the media stream.')
4+
param targetAddress string
5+
6+
@description('The name of the custom location you are using.')
7+
param customLocationName string
8+
9+
@description('Specifies the name of the asset endpoint resource to create.')
10+
param aepName string
11+
12+
@description('The name of the Kubernetes secret you are using.')
13+
param secretName string
14+
15+
/*****************************************************************************/
16+
/* Asset endpoint profile */
17+
/*****************************************************************************/
18+
resource assetEndpoint 'Microsoft.DeviceRegistry/assetEndpointProfiles@2024-11-01' = {
19+
name: aepName
20+
location: resourceGroup().location
21+
extendedLocation: {
22+
type: 'CustomLocation'
23+
name: customLocationName
24+
}
25+
properties: {
26+
targetAddress: targetAddress
27+
endpointProfileType: 'Microsoft.Media'
28+
#disable-next-line no-hardcoded-env-urls //Schema required during public preview
29+
additionalConfiguration: '{"@schema":"https://aiobrokers.blob.core.windows.net/aio-media-connector/1.0.0.json"}'
30+
authentication: {
31+
method: 'UsernamePassword'
32+
usernamePasswordCredentials: {
33+
passwordSecretName: '${secretName}/password'
34+
usernameSecretName: '${secretName}/username'
35+
}
36+
}
37+
}
38+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
metadata description = 'Media asset that saves clips to the file system.'
2+
3+
@description('The name of the custom location you are using.')
4+
param customLocationName string
5+
6+
@description('Specifies the name of the asset endpoint resource to use.')
7+
param aepName string
8+
9+
@description('The name of the asset you are creating.')
10+
param assetName string = 'asset-clip-to-fs'
11+
12+
/*****************************************************************************/
13+
/* Asset */
14+
/*****************************************************************************/
15+
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
16+
name: assetName
17+
location: resourceGroup().location
18+
extendedLocation: {
19+
type: 'CustomLocation'
20+
name: customLocationName
21+
}
22+
properties: {
23+
assetEndpointProfileRef: aepName
24+
datasets: [
25+
{
26+
name: 'dataset1'
27+
dataPoints: [
28+
{
29+
name: 'clip-to-fs'
30+
dataSource: 'clip-to-fs'
31+
dataPointConfiguration: '{"taskType":"clip-to-fs","autostart":true,"realtime":true,"loop":true,"format":"avi","duration":3}'
32+
}
33+
]
34+
}
35+
]
36+
}
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
metadata description = 'Media asset that saves snapshots to the file system.'
2+
3+
@description('The name of the custom location you are using.')
4+
param customLocationName string
5+
6+
@description('Specifies the name of the asset endpoint resource to use.')
7+
param aepName string
8+
9+
@description('The name of the asset you are creating.')
10+
param assetName string = 'asset-snapshot-to-fs'
11+
12+
/*****************************************************************************/
13+
/* Asset */
14+
/*****************************************************************************/
15+
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
16+
name: assetName
17+
location: resourceGroup().location
18+
extendedLocation: {
19+
type: 'CustomLocation'
20+
name: customLocationName
21+
}
22+
properties: {
23+
assetEndpointProfileRef: aepName
24+
datasets: [
25+
{
26+
name: 'dataset1'
27+
dataPoints: [
28+
{
29+
name: 'snapshot-to-fs'
30+
dataSource: 'snapshot-to-fs'
31+
dataPointConfiguration: '{"taskType":"snapshot-to-fs","autostart":true,"realtime":true,"loop":true,"format":"jpeg","fps":1}'
32+
}
33+
]
34+
}
35+
]
36+
}
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
metadata description = 'Media asset that publishes snapshots to MQTT.'
2+
3+
@description('The name of the custom location you are using.')
4+
param customLocationName string
5+
6+
@description('Specifies the name of the asset endpoint resource to use.')
7+
param aepName string
8+
9+
@description('The name of the asset you are creating.')
10+
param assetName string = 'asset-snapshot-to-mqtt'
11+
12+
/*****************************************************************************/
13+
/* Asset */
14+
/*****************************************************************************/
15+
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
16+
name: assetName
17+
location: resourceGroup().location
18+
extendedLocation: {
19+
type: 'CustomLocation'
20+
name: customLocationName
21+
}
22+
properties: {
23+
assetEndpointProfileRef: aepName
24+
datasets: [
25+
{
26+
name: 'dataset1'
27+
dataPoints: [
28+
{
29+
name: 'snapshot-to-mqtt'
30+
dataSource: 'snapshot-to-mqtt'
31+
dataPointConfiguration: '{"taskType":"snapshot-to-mqtt","autostart":true,"realtime":true,"loop":true,"format":"jpeg","fps":1}'
32+
}
33+
]
34+
}
35+
]
36+
}
37+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
metadata description = 'Media asset that streams RTSP to a media server.'
2+
3+
@description('The name of the custom location you are using.')
4+
param customLocationName string
5+
6+
@description('Specifies the name of the asset endpoint resource to use.')
7+
param aepName string
8+
9+
@description('The name of the asset you are creating.')
10+
param assetName string = 'asset-stream-to-rtsp'
11+
12+
@description('The IP address of your media server.')
13+
param mediaServerAddress string
14+
15+
/*****************************************************************************/
16+
/* Asset */
17+
/*****************************************************************************/
18+
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
19+
name: assetName
20+
location: resourceGroup().location
21+
extendedLocation: {
22+
type: 'CustomLocation'
23+
name: customLocationName
24+
}
25+
properties: {
26+
assetEndpointProfileRef: aepName
27+
datasets: [
28+
{
29+
name: 'dataset1'
30+
dataPoints: [
31+
{
32+
name: 'stream-to-rtsp'
33+
dataSource: 'stream-to-rtsp'
34+
dataPointConfiguration: '{"taskType":"stream-to-rtsp","autostart":true,"realtime":true,"loop":true,"media_server_address":"${mediaServerAddress}"}'
35+
}
36+
]
37+
}
38+
]
39+
}
40+
}

0 commit comments

Comments
 (0)