Skip to content

codeendevor/peek

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peek

Customers are continuing to expand their footprint in Azure and there is a significant need to understand resource usage, optimize it as far as possible and plan for future growth. Microsoft Peek is a one stop PaaS based solution which allows us to abstract the intricacies of collecting the usage data for different use cases (Cloud Solution Provider, Direct, and Enterprise Agreement Azure subscriptions) and provides detailed visuals for near real time data analytics.

peekimage

Prerequisites

The following are required prerequisites for this sample project

Prerequisite Purpose
Azure Subscription A subscription is required to host the Azure WebJob and provide the Azure Storage account.

Obtaining Direct Subscription Information

Usage information for direct Azure subscriptions is obtained using the Azure RateCard and Azure Usage APIs. To access both of these APIs an application must be registered within the Azure AD tenant that has access to the subscriptions. Perform the following in order to create and configure the required application

  1. Login into https://portal.azure.com using credentials that have Global Admin privileges

  2. Open the Azure Active Directory management experience

  3. Click on App registrations and then click Add to create a new application

    Azure AD App registrations

  4. Specify the appropriate information within the Create blade and then click Create

    Azure AD app creation

  5. Click Required permissions on the Settings blade and then click Add

    Azure AD required permissions

  6. Select the Windows Azure Service Management API and select the Access Azure Service Management as organization users (preview) permissions and then click Done

    Azure AD required permissions done

  7. Click on Keys on the Settings blade and then click Add

    Azure AD app keys

Obtaining the Cloud Solution Provider (CSP) Information

Microsoft provides the Partner Center API to enable a partner to interact with various aspects of the Cloud Solution Provider program. To access the Partner Center API an application must be registered and configured with the partner's Azure AD tenant. Perform the following tasks to create and configure the application.

  1. Login into https://partnercenter.microsoft.com using credentials that have both AdminAgent and Global Admin privileges

  2. Click Dashboard -> Account Settings -> App Management

  3. Click on Register existing app if you want to use an existing Azure AD application, or click Add new web app to create a new one

    Partner Center - App Management

  4. Document the App ID and Account ID values. Also, if necessary create a key and document that value.

    Partner Center - App Management

It is important to understand that the creation and configuration of this Azure AD application can be done from the Azure Management portal. However, since this application utilizes app only authentication to access the Partner Center API the application must be registred in Partner Center using this process. Otherwise, you will receive a HTTP 401 error with every attempt to access the Partner Center API.

Configuring the Application for Pre-consent

Perform the following steps to configure the application that will be used to access the Partner Center API for pre-consent

  1. Install Azure AD PowerShell Module (instruction available here).
  2. Update the AppId and DisplayName variables in the PowerShell script below
  3. Execute the modified PowerShell script. When prompted for authentication specify credentials that belong to the tenant where the application was created and that have global admin privileges
Connect-AzureAD

$AppId = 'INSERT-APPLICATION-ID-HERE'
$DisplayName = 'INSERT-APPLICATION-DISPLAY-NAME-HERE'

$g = Get-AzureADGroup | ? {$_.DisplayName -eq 'AdminAgents'}
$s = Get-AzureADServicePrincipal | ? {$_.AppId -eq $AppId}

if ($s -eq $null) { $s = New-AzureADServicePrincipal -AppId $AppId -DisplayName $DisplayName }
Add-AzureADGroupMember -ObjectId $g.ObjectId -RefObjectId $s.ObjectId

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.

About

Azure Usage/Billing Analytics Solution for EAs, CSPs and Direct Subscriptions.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 93.0%
  • PowerShell 7.0%