Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 1.94 KB

File metadata and controls

28 lines (23 loc) · 1.94 KB

Post an Azure Managed App Billing Event from a VM

A sample that will allow you to posting events to metered billing API in a Managed Application from a VM. The VM is deployed into the managed resource group.

Installation from Partner Center Preview

  1. Use the contents of the /vm/arm folder to create a ZIP file for your plan in Partner Center, or just use the app.zip file already in the repo.
  2. Upload the ZIP file to the Technical Configuration page of the Azure Managed Application plan in Partner Center.
  3. Publish the plan. It will take some time for the plan to reach Preview stage.
  4. From Preview, purchase the plan.
    • Do not purchase the plan from the same Azure Tenant as the one used to publish the plan. If you do so, the script referenced later will error.
    • Use the East US region using this example to ensure support for the VM SKU specified in the ARM template.

Usage from the Managed Application VM

  1. After deployment is complete, remote into the newly deployed VM.
  2. Open Internet Explorer (IE).
    1. After opening IE, set the custom security settings to allow downloads.
  3. Download this repository's code as a ZIP file from this URL.
  4. In PowerShell, navigate to the /vm/ps folder on the VM.
    1. Run the command notepad ./ps/RunIt.ps1.
    2. Open the RunIt file and see the arguments you need to pass to the Invoke-Meter function.
    3. Provide the correct values for the arguments.
    4. Run the command Set-ExecutionPolicy Bypass.
    5. Run the command ./ps/RunIt.ps1.
  5. The results of the call will be show at the bottom of the terminal window after the script runs.
    1. When the meter has been posted successfully it will show the output of the reply JSON at the bottom of the screen.
    2. If there is an error the meter did not get called or the meter is a duplicate of one sent earlier. The error message will indicate which.