Skip to content

Commit 1728b39

Browse files
committed
Add media connector Bicep files
1 parent afdacfd commit 1728b39

File tree

6 files changed

+223
-135
lines changed

6 files changed

+223
-135
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
/* Existing AIO cluster */
17+
/*****************************************************************************/
18+
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
19+
name: customLocationName
20+
}
21+
22+
/*****************************************************************************/
23+
/* Asset endpoint profile */
24+
/*****************************************************************************/
25+
resource assetEndpoint 'Microsoft.DeviceRegistry/assetEndpointProfiles@2024-11-01' = {
26+
name: aepName
27+
location: resourceGroup().location
28+
extendedLocation: {
29+
type: 'CustomLocation'
30+
name: customLocation.id
31+
}
32+
properties: {
33+
targetAddress: targetAddress
34+
endpointProfileType: 'Microsoft.Media'
35+
additionalConfiguration: '{"@schema":"https://aiobrokers.blob.core.windows.net/aio-media-connector/1.0.0.json"}'
36+
authentication: {
37+
method: 'UsernamePassword'
38+
usernamePasswordCredentials: {
39+
passwordSecretName: '${secretName}/password'
40+
usernameSecretName: '${secretName}/username'
41+
}
42+
}
43+
}
44+
}

samples/media-connector-bicep/aep.bicep

Lines changed: 0 additions & 135 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
/* Existing AIO cluster */
14+
/*****************************************************************************/
15+
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
16+
name: customLocationName
17+
}
18+
19+
/*****************************************************************************/
20+
/* Asset */
21+
/*****************************************************************************/
22+
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
23+
name: assetName
24+
location: resourceGroup().location
25+
extendedLocation: {
26+
type: 'CustomLocation'
27+
name: customLocation.id
28+
}
29+
properties: {
30+
assetEndpointProfileRef: aepName
31+
datasets: [
32+
{
33+
name: 'dataset1'
34+
dataPoints: [
35+
{
36+
name: 'clip-to-fs'
37+
dataSource: 'clip-to-fs'
38+
dataPointConfiguration: '{"taskType":"clip-to-fs","autostart":true,"realtime":true,"loop":true,"format":"avi","duration":3}'
39+
}
40+
]
41+
}
42+
]
43+
}
44+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
/* Existing AIO cluster */
14+
/*****************************************************************************/
15+
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
16+
name: customLocationName
17+
}
18+
19+
/*****************************************************************************/
20+
/* Asset */
21+
/*****************************************************************************/
22+
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
23+
name: assetName
24+
location: resourceGroup().location
25+
extendedLocation: {
26+
type: 'CustomLocation'
27+
name: customLocation.id
28+
}
29+
properties: {
30+
assetEndpointProfileRef: aepName
31+
datasets: [
32+
{
33+
name: 'dataset1'
34+
dataPoints: [
35+
{
36+
name: 'snapshot-to-fs'
37+
dataSource: 'snapshot-to-fs'
38+
dataPointConfiguration: '{"taskType":"snapshot-to-fs","autostart":true,"realtime":true,"loop":true,"format":"jpeg","fps":1}'
39+
}
40+
]
41+
}
42+
]
43+
}
44+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
/* Existing AIO cluster */
14+
/*****************************************************************************/
15+
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
16+
name: customLocationName
17+
}
18+
19+
/*****************************************************************************/
20+
/* Asset */
21+
/*****************************************************************************/
22+
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
23+
name: assetName
24+
location: resourceGroup().location
25+
extendedLocation: {
26+
type: 'CustomLocation'
27+
name: customLocation.id
28+
}
29+
properties: {
30+
assetEndpointProfileRef: aepName
31+
datasets: [
32+
{
33+
name: 'dataset1'
34+
dataPoints: [
35+
{
36+
name: 'snapshot-to-mqtt'
37+
dataSource: 'snapshot-to-mqtt'
38+
dataPointConfiguration: '{"taskType":"snapshot-to-mqtt","autostart":true,"realtime":true,"loop":true,"format":"jpeg","fps":1}'
39+
}
40+
]
41+
}
42+
]
43+
}
44+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
/* Existing AIO cluster */
17+
/*****************************************************************************/
18+
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
19+
name: customLocationName
20+
}
21+
22+
/*****************************************************************************/
23+
/* Asset */
24+
/*****************************************************************************/
25+
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
26+
name: assetName
27+
location: resourceGroup().location
28+
extendedLocation: {
29+
type: 'CustomLocation'
30+
name: customLocation.id
31+
}
32+
properties: {
33+
assetEndpointProfileRef: aepName
34+
datasets: [
35+
{
36+
name: 'dataset1'
37+
dataPoints: [
38+
{
39+
name: 'stream-to-rtsp'
40+
dataSource: 'stream-to-rtsp'
41+
dataPointConfiguration: '{"taskType":"stream-to-rtsp","autostart":true,"realtime":true,"loop":true,"media_server_address":"${mediaServerAddress}"}'
42+
}
43+
]
44+
}
45+
]
46+
}
47+
}

0 commit comments

Comments
 (0)