Skip to content

Commit 0aa9080

Browse files
author
Qian Wen
committed
changing script language to powershell
1 parent 8129f42 commit 0aa9080

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/marketplace/partner-center-portal/marketplace-metering-service-authentication.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ See [Azure Active Directory access tokens](https://docs.microsoft.com/azure/acti
8080

8181
Sample response token:
8282

83-
```json
83+
```JSON
8484
{
8585
"token_type": "Bearer",
8686
"expires_in": "3600",
@@ -115,7 +115,7 @@ For example, this is how to authenticate using a Windows VM,
115115

116116
1. Get an access token for Marketplace metering service application ID (`20e940b3-4c77-4b0b-9a53-9e16a1b010a7`) using the system identity, RDP to the VM, open PowerShell console and run the command below
117117

118-
```json
118+
```powershell
119119
# curl is an alias to Web-Invoke PowerShell command
120120
# Get system identity access tokenn
121121
$MetadataUrl = "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fmanagement.azure.com%2F"
@@ -126,7 +126,7 @@ For example, this is how to authenticate using a Windows VM,
126126
127127
1. Get the managed app id from the current resource groups 'ManagedBy' property
128128
129-
```json
129+
```powershell
130130
# Get subscription and resource group
131131
$metadata = curl -H @{'Metadata'='true'} http://169.254.169.254/metadata/instance?api-version=2019-06-01 | select -ExpandProperty Content | ConvertFrom-Json
132132
@@ -138,7 +138,7 @@ For example, this is how to authenticate using a Windows VM,
138138
139139
1. Marketplace metering service requires to report usage on a `resourceID`, in the case of a Managed App this is the `resourceUsageId`.
140140
141-
```json
141+
```powershell
142142
# Get resourceUsageId from the Managed App
143143
$managedAppUrl = "https://management.azure.com/subscriptions/" + $metadata.compute.subscriptionId + "/resourceGroups/" + $metadata.compute.resourceGroupName + "/providers/Microsoft.Solutions/applications/" + $managedappId + "\?api-version=2019-07-01"
144144
$ManagedApp = curl $managedAppUrl -H $Headers | Select-Object -Expand Content | ConvertFrom-Json

0 commit comments

Comments
 (0)