diff --git a/samples/media-connector-bicep/aep-media-connector.bicep b/samples/media-connector-bicep/aep-media-connector.bicep new file mode 100644 index 00000000..3cf131e8 --- /dev/null +++ b/samples/media-connector-bicep/aep-media-connector.bicep @@ -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' + } + } + } +} diff --git a/samples/media-connector-bicep/asset-clip-to-fs.bicep b/samples/media-connector-bicep/asset-clip-to-fs.bicep new file mode 100644 index 00000000..0065e1e1 --- /dev/null +++ b/samples/media-connector-bicep/asset-clip-to-fs.bicep @@ -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}' + } + ] + } + ] + } +} diff --git a/samples/media-connector-bicep/asset-snapshot-to-fs.bicep b/samples/media-connector-bicep/asset-snapshot-to-fs.bicep new file mode 100644 index 00000000..34e314d8 --- /dev/null +++ b/samples/media-connector-bicep/asset-snapshot-to-fs.bicep @@ -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}' + } + ] + } + ] + } +} diff --git a/samples/media-connector-bicep/asset-snapshot-to-mqtt.bicep b/samples/media-connector-bicep/asset-snapshot-to-mqtt.bicep new file mode 100644 index 00000000..f399b3ce --- /dev/null +++ b/samples/media-connector-bicep/asset-snapshot-to-mqtt.bicep @@ -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}' + } + ] + } + ] + } +} diff --git a/samples/media-connector-bicep/asset-stream-to-rtsp.bicep b/samples/media-connector-bicep/asset-stream-to-rtsp.bicep new file mode 100644 index 00000000..48c9c42c --- /dev/null +++ b/samples/media-connector-bicep/asset-stream-to-rtsp.bicep @@ -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}"}' + } + ] + } + ] + } +}