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
{ | |
"visual": { | |
"name": "liquidFillGauge", | |
"displayName": "liquidFillGauge", | |
"guid": "liquidFillGaugeCA6D0134FC6446EF90CC6934C9812269", | |
"visualClassName": "Visual", | |
"version": "1.0.0", | |
"description": "", | |
"supportUrl": "", | |
"gitHubUrl": "" |
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
var iotHubName = pm.environment.get("iotHubName"); | |
var iotHubKey = pm.environment.get("iotHubKey"); | |
var iotHubTokenExpiration = pm.environment.get("iotHubTokenExpiration"); | |
var iotHubPolicyName = pm.environment.get("iotHubPolicyName"); | |
pm.globals.clear("iotHubSasToken"); // clear out token on first run. | |
// See this doc for details: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-security | |
var resourceUri = encodeURIComponent(iotHubName + '.azure-devices.net'); // The resource uri | |
var expiry = Math.ceil((Date.now() / 1000) + iotHubTokenExpiration * 60); // Expire the token 60 minutes from now |
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
pm.sendRequest({ | |
url: 'https://login.microsoftonline.com/' + pm.environment.get("tenantId") + '/oauth2/token', | |
method: 'POST', | |
header: 'Content-Type: application/x-www-form-urlencoded', | |
body: { | |
mode: 'urlencoded', | |
urlencoded: [ | |
{key: "grant_type", value: "client_credentials", disabled: false}, | |
{key: "client_id", value: pm.environment.get("clientId"), disabled: false}, | |
{key: "client_secret", value: pm.environment.get("clientSecret"), disabled: false}, |
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
docker run --privileged -it -v /var/run/docker.sock:/var/run/docker.sock jongallant/ubuntu-docker-client | |
docker run --net=host --ipc=host --uts=host --pid=host -it --security-opt=seccomp=unconfined --privileged --rm -v /:/host alpine /bin/sh | |
chroot /host |
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
subscriptionId: | |
clientId: | |
clientSecret: | |
tenantId: | |
deviceStorageAccountName: | |
deviceStorageAccountKey: | |
resourceGroupName: | |
resourceName: | |
resourceKey: | |
iotHubCreateDeleteName: |
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
module powerbi.extensibility.visual { | |
export class Visual implements IVisual { | |
private target: HTMLElement; | |
private selectionManager: ISelectionManager; | |
private selectionIds: any = {}; | |
private host: IVisualHost; | |
private isEventUpdate: boolean = false; | |
constructor(options: VisualConstructorOptions) { | |
this.target = options.element; |
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
{ | |
"dataRoles": [ | |
{ | |
"displayName": "Values", | |
"name": "values", | |
"kind": "Grouping" | |
} | |
], | |
"dataViewMappings": [ | |
{ |
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
{ | |
"visual": { | |
"name": "liquidFillGauge", | |
"displayName": "liquidFillGauge", | |
"guid": "liquidFillGauge93CE6A47554D42C181409FA800464B76", | |
"visualClassName": "Visual", | |
"version": "1.0.0", | |
"description": "", | |
"supportUrl": "", | |
"gitHubUrl": "" |
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
{ | |
"deviceId": "{{deviceId}}", | |
"properties": { | |
"desired": { | |
"deviceName": "{{deviceName}}" | |
} | |
} | |
} |
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
// See this doc for details: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-security | |
var resourceUri = encodeURIComponent(postman.getGlobalVariable("hubName") + '.azure-devices.net'); // The resource uri | |
var expiry = Math.ceil((Date.now() / 1000) + postman.getGlobalVariable("expiresInMins") * 60); // Expire the token 60 minutes from now | |
var uriExpiry = resourceUri + '\n' + expiry; // this is the string format to gen signature from | |
var decodedKey = CryptoJS.enc.Base64.parse(postman.getGlobalVariable("signingKey")); // The SHA256 key is the Base64 decoded version of the IoT Hub key | |
var signature = CryptoJS.HmacSHA256(uriExpiry, decodedKey); // The signature generated from the decodedKey | |
var encodedUri = encodeURIComponent(CryptoJS.enc.Base64.stringify(signature)); // The url encoded version of the Base64 signature | |
// Construct authorization string (shared access signature) | |
var token = "SharedAccessSignature sr=" + resourceUri + "&sig=" + encodedUri + "&se=" + expiry; |