-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stream Analytics CI/CD Yaml file for the Tech Sample (#549)
* adding the yaml and yaml generator * update override params * updating yaml with a sep access key slot * *adding * add job config and project config * updating readme * lint errors * Update single_tech_samples/streamanalytics/sampleyaml.yml Co-authored-by: JM <jason.mostella@microsoft.com> * cleaning up * fixing tests * updating branch and file name * updating readme * lint * lint * remove bloboutput Co-authored-by: Sara Norris <sanorris@microsoft.com> Co-authored-by: JM <jason.mostella@microsoft.com>
- Loading branch information
1 parent
409fc12
commit d3505bf
Showing
7 changed files
with
120 additions
and
18 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,25 @@ | ||
{ | ||
"ScriptType": "JobConfig", | ||
"DataLocale": "en-US", | ||
"OutputErrorPolicy": "Retry", | ||
"EventsLateArrivalMaxDelayInSeconds": 5, | ||
"EventsOutOfOrderMaxDelayInSeconds": 0, | ||
"EventsOutOfOrderPolicy": "Adjust", | ||
"StreamingUnits": 3, | ||
"CompatibilityLevel": "1.2", | ||
"UseSystemAssignedIdentity": false, | ||
"GlobalStorage": { | ||
"AccountName": null, | ||
"AccountKey": null, | ||
"AuthenticationMode": "ConnectionString" | ||
}, | ||
"ContentStoragePolicy": "SystemAccount", | ||
"CustomCodeStorage": { | ||
"AccountName": null, | ||
"AccountKey": null, | ||
"ContainerName": null, | ||
"Path": "UserCustomCode.zip" | ||
}, | ||
"DataSourceCredentialDomain": null, | ||
"Tags": {} | ||
} |
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
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
{ | ||
"name": "streamanalytics", | ||
"startFile": "streamanalytics-tech-sample.asaql", | ||
"configurations": [] | ||
"configurations": [ | ||
{ | ||
"filePath": "JobConfig.json", | ||
"subType": "JobConfig" | ||
} | ||
] | ||
} |
77 changes: 77 additions & 0 deletions
77
single_tech_samples/streamanalytics/samplecicdpipeline.yml
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,77 @@ | ||
trigger: | ||
- main | ||
pool: | ||
vmImage: ubuntu-latest | ||
steps: | ||
|
||
- task: Npm@1 | ||
displayName: 'Install Azure stream analytics ci cd' | ||
inputs: | ||
command: custom | ||
verbose: false | ||
customCommand: 'install -g azure-streamanalytics-cicd' | ||
- task: Bash@3 | ||
inputs: | ||
targetType: 'inline' | ||
script: azure-streamanalytics-cicd test -project ./asaproj.json -outputPath ./output/ | ||
displayName: 'Run Unit Tests' | ||
|
||
- task: AzureCLI@2 | ||
inputs: | ||
azureSubscription: '$(subscription)' | ||
scriptType: 'bash' | ||
scriptLocation: 'inlineScript' | ||
inlineScript: 'az group create -n rg-$(app)-$(env) -l $(location)' | ||
displayName: 'Create Resource Group' | ||
|
||
- task: AzureCLI@2 | ||
inputs: | ||
azureSubscription: '$(subscription)' | ||
scriptType: 'bash' | ||
scriptLocation: 'inlineScript' | ||
inlineScript: 'az deployment group create -f ./main.bicep -g rg-$(app)-$(env) --parameters query=''@./streamanalytics-tech-sample.asaql'' name=$(app) env=$(env)' | ||
displayName: 'Deploy Infrastructure' | ||
|
||
- task: AzureCLI@2 | ||
inputs: | ||
azureSubscription: '$(subscription)' | ||
scriptType: 'bash' | ||
scriptLocation: 'inlineScript' | ||
inlineScript: | | ||
az config set extension.use_dynamic_install=yes_without_prompt | ||
az iot hub device-identity create --hub-name iot-$(app)-$(env) --device-id iot-$(app)-$(env) --edge-enabled | ||
displayName: 'Create device' | ||
|
||
- task: AzureCLI@2 | ||
inputs: | ||
azureSubscription: '$(subscription)' | ||
scriptType: 'bash' | ||
scriptLocation: 'inlineScript' | ||
inlineScript: | | ||
az config set extension.use_dynamic_install=yes_without_prompt | ||
export DEVICE_CONNECTION_STRING=$(az iot hub device-identity connection-string show --hub-name iot-$(app)-$(env) --device-id iot-$(app)-$(env) --output tsv) | ||
export AZURE_STORAGE_CONNECTION_STRING=$(az storage account show-connection-string -n st$(app)$(env) --query connectionString -o tsv) | ||
cd e2e | ||
npm install | ||
npm test | ||
displayName: 'Run E2E tests' | ||
|
||
- task: AzureCLI@2 | ||
condition: always() | ||
inputs: | ||
azureSubscription: '$(subscription)' | ||
scriptType: 'bash' | ||
scriptLocation: 'inlineScript' | ||
inlineScript: | | ||
az config set extension.use_dynamic_install=yes_without_prompt | ||
az iot hub device-identity delete --hub-name iot-$(app)-$(env) --device-id iot-$(app)-$(env) | ||
displayName: 'Delete device' | ||
|
||
- task: AzureCLI@2 | ||
condition: always() | ||
inputs: | ||
azureSubscription: '$(subscription)' | ||
scriptType: 'bash' | ||
scriptLocation: 'inlineScript' | ||
inlineScript: 'az group delete -n rg-$(app)-$(env) -y' | ||
displayName: 'Delete resource group' |
1 change: 0 additions & 1 deletion
1
single_tech_samples/streamanalytics/test/temperature_greater_than_27_degrees_expected.json
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
single_tech_samples/streamanalytics/test/temperature_less_than_27_degrees.json
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"messageId":3,"deviceId":"modern-data-warehouse-dataops/single_tech_samples/streamanalytics/test","temperature":26.999999999999999,"humidity":64.86134165355034} | ||
{"messageId":3,"deviceId":"modern-data-warehouse-dataops/single_tech_samples/streamanalytics/test","temperature":26.999999999999999,"humidity":64.86134165355034} |
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