Manually submitting values to the Azure Metering API
In this script, we're using
curl
and jq
. curl
certainly is on your system, for jq
, you might need to fetch it:#!/bin/bash
curl --silent \
--url https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 \
--location \
--output jq && \
chmod +x jq && \
sudo mv jq /usr/local/bin && \
sudo chown root.root /usr/local/bin/jq
I assume you have 2 service principal credentials in the publisher/ISV AAD tenant:
- 1.We need a management credential which is authorized to manage customer deployments, using with the ARM API.
- I created an AAD group, called
managed-app-admins
, and made the service principal a member of that group. - In
Partner Center -> Offer -> Plan -> Technical Configuration -> Authorizations
, I granted the AAD groupOwner
of managed apps. - As a result, the
isv_management_cliend_id
below can interact with managed apps. -
- So
8cdea44d-38fe-4e3c-bf2a-6b96809d1d27
above is the object ID of the group, and the service principal with app id8eff18b7-aeeb-4a88-b19c-bf60813a587c
is member of that group.
- 2.We need a metering credential, which is authorized to submit usage to the metering API.
- We do not use an identity in the managed app, i.e. we do not SSH/RDP into a VM in the managed resource group to do our work there. Having a VM just for that is too complicated (and expensive).
- This
isv_metering_client_id
(app id) service principal is configured underPartner Center -> Offer -> Technical Configuration
: -