Skip to content

Commit

Permalink
Add quickstart resources (#78)
Browse files Browse the repository at this point in the history
## Purpose
<!-- Describe the intention of the changes being proposed. What problem
does it solve or functionality does it add? -->
Add config files used by the latest version of the quickstarts

## Does this introduce a breaking change?
<!-- Mark one with an "x". -->
```
[ ] Yes
[x] No
```

## Pull Request Type
What kind of change does this Pull Request introduce?

<!-- Please check the one that applies to this PR using "x". -->
```
[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[x] Documentation content changes
[ ] Other... Please describe:
```
  • Loading branch information
dominicbetts authored Jul 30, 2024
1 parent d4ebe7f commit 38c88fe
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
66 changes: 66 additions & 0 deletions samples/quickstarts/dataflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apiVersion: connectivity.iotoperations.azure.com/v1beta1
kind: DataflowEndpoint
metadata:
name: mq-source
namespace: azure-iot-operations
spec:
endpointType: mqttSettings
mqttSettings:
host: "aio-mq-dmqtt-frontend:8883"
tls:
mode: Enabled
# NOTE this is where we put the server cert configmap value
trustedCaCertificateConfigMapRef: aio-ca-trust-bundle-test-only
authentication:
method: ServiceAccountToken
serviceAccountTokenSettings:
audience: aio-mq
---
apiVersion: connectivity.iotoperations.azure.com/v1beta1
kind: DataflowEndpoint
metadata:
name: kafka-target
namespace: azure-iot-operations
spec:
endpointType: kafkaSettings
kafkaSettings:
host: "<NAMESPACE>.servicebus.windows.net:9093"
batching:
latencyMs: 0
maxMessages: 100
tls:
mode: Enabled
authentication:
method: SystemAssignedManagedIdentity
systemAssignedManagedIdentitySettings:
# Don't forget the https://
audience: https://<NAMESPACE>.servicebus.windows.net
---
apiVersion: connectivity.iotoperations.azure.com/v1beta1
kind: Dataflow
metadata:
name: mq-to-kafka
namespace: azure-iot-operations
spec:
profileRef: example-dataflow
operations:
- operationType: source
sourceSettings:
endpointRef: mq-source
dataSources:
- $share/group/azure-iot-operations/data/thermostat
- operationType: destination
destinationSettings:
endpointRef: kafka-target
dataDestination: destinationeh
---
apiVersion: connectivity.iotoperations.azure.com/v1beta1
kind: DataflowProfile
metadata:
name: example-dataflow
namespace: azure-iot-operations
spec:
instanceCount: 1
diagnostics:
logs:
level: "debug"
41 changes: 41 additions & 0 deletions samples/quickstarts/event-hubs-config.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@description('Location for cloud resources')
param aioExtensionName string = 'azure-iot-operations'
param clusterName string = 'clusterName'
param eventHubNamespaceName string = 'default'

resource connectedCluster 'Microsoft.Kubernetes/connectedClusters@2021-10-01' existing = {
name: clusterName
}

resource aioExtension 'Microsoft.KubernetesConfiguration/extensions@2022-11-01' existing = {
name: aioExtensionName
scope: connectedCluster
}

resource ehNamespace 'Microsoft.EventHub/namespaces@2021-11-01' existing = {
name: eventHubNamespaceName
}

// Role assignment for Event Hubs Data Receiver role
resource roleAssignmentDataReceiver 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(ehNamespace.id, aioExtension.id, '7f951dda-4ed3-4680-a7ca-43fe172d538d')
scope: ehNamespace
properties: {
// ID for Event Hubs Data Receiver role is a638d3c7-ab3a-418d-83e6-5f17a39d4fde
roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', 'a638d3c7-ab3a-418d-83e6-5f17a39d4fde')
principalId: aioExtension.identity.principalId
principalType: 'ServicePrincipal'
}
}

// Role assignment for Event Hubs Data Sender role
resource roleAssignmentDataSender 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(ehNamespace.id, aioExtension.id, '69b88ce2-a752-421f-bd8b-e230189e1d63')
scope: ehNamespace
properties: {
// ID for Event Hubs Data Sender role is 2b629674-e913-4c01-ae53-ef4638d8f975
roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', '2b629674-e913-4c01-ae53-ef4638d8f975')
principalId: aioExtension.identity.principalId
principalType: 'ServicePrincipal'
}
}

0 comments on commit 38c88fe

Please sign in to comment.