NordicSemiconductor/asset-tracker-cloud-firmware-azure

End-to-end testing on real hardware

Closed this issue · 1 comments

Create service principal for firmware CI runs

az ad sp create-for-rbac --name 'https://nrfassettracker.invalid/ci' \                         
   --role contributor \
   --scopes \
      "/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RESOURCE_GROUP:-nrfassettracker}" \
   --sdk-auth \
   > ci-credentials.json

Assign access permissions for IoT hub

az role assignment create --assignee $(az ad sp list --display-name "https://nrfassettracker.invalid/firmware-ci" | jq -r '.[0].objectId') \
--role $(az role definition list --output json | jq -r '.[] | select(.roleName=="IoT Hub Data Contributor") | .id') \
--scope "/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.Devices/IotHubs/${APP_NAME}IotHub"