-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add media connector bicep files (#116)
## Purpose * Add media connector bicep files * Referenced from docs media connector how-to article
- Loading branch information
1 parent
768bc3e
commit 5f84f2f
Showing
5 changed files
with
189 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
37
samples/media-connector-bicep/asset-snapshot-to-mqtt.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}"}' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |