none
how do use Azure API to determine monthly billing for each resource (ie IaaS). Also want to be able to gather inventory information such which owner has incorrect tags? RRS feed

All replies

  • Cost Management is a right place to look for detailed pricing for each resource. Using Azure Consumption API's you can programmatically get the cost and usage data for your Azure resources.

    Also, you can export Azure Subscription Usage to CSV with NEW Billing API and PowerShell. See the reference link - https://blogs.technet.microsoft.com/keithmayer/2015/06/30/export-azure-subscription-usage-to-csv-with-new-billing-api-and-powershell/ for details.

    Wednesday, August 7, 2019 11:59 AM
    Moderator
  • 1) Export Azure Usage via PowerShell using Get-UsageAggregates does not require Azure AD?
    2) Export Azure Usage via PowerShell and Billing REST API does require Azure AD?

    See the next two replies because the powershell output had too many characters for a response.

    (When using powershell from within ARM, I receive the following output with errors)

    1) getting error below and unsure where this csv is created on my laptop.  note I am running powershell from ARM.   The powershell appears not to require azure AD?

    PS Azure:\>
    Azure:/
    PS Azure:\> Switch-AzureMode -Name AzureResourceManager
    Switch-AzureMode : The term 'Switch-AzureMode' is not recognized as the name of a cmdlet, function, script file, or operable program.
    Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + ~~~~~~~~~~~~~~~~
    + FullyQualifiedErrorId : CommandNotFoundException

    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> # Select an Azure Subscription for which to report usage data
    Azure:/
    PS Azure:\>
    Azure:/
    >>     (Get-AzureSubscription |
    >>         -Title "Select an Azure Subscription ..." `
    Get-AzureSubscription : The term 'Get-AzureSubscription' is not recognized as the name of a cmdlet, function, script file, or operable program.
    At line:2 char:6
    +      ~~~~~~~~~~~~~~~~~~~~~
    + FullyQualifiedErrorId : CommandNotFoundException
    Azure:/
    Azure:/
    Select-AzureSubscription : The term 'Select-AzureSubscription' is not recognized as the name of a cmdlet, function, script file, or operable program.
    At line:1 char:1
    + ~~~~~~~~~~~~~~~~~~~~~~~~
    + FullyQualifiedErrorId : CommandNotFoundException
    Azure:/
    Azure:/
    Azure:/
    Azure:/
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> # Set usage parameters
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> $granularity = "Daily" # Can be Hourly or Daily
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> $showDetails = $true
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> # Export Usage to CSV
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> $appendFile = $false
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> $continuationToken = ""
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> Do {
    >>
    >>     $usageData = Get-UsageAggregates `
    >>         -ReportedStartTime $reportedStartTime `
    >>         -ReportedEndTime $reportedEndTime `
    >>         -AggregationGranularity $granularity `
    >>         -ShowDetails:$showDetails `
    >>         -ContinuationToken $continuationToken
    >>
    >>     $usageData.UsageAggregations.Properties |
    >>         Select-Object `
    >>             UsageStartTime, `
    >>             UsageEndTime, `
    >>             @{n='SubscriptionId';e={$subscriptionId}}, `
    >>             MeterCategory, `
    >>             MeterId, `
    >>             MeterName, `
    >>             MeterSubCategory, `
    >>             MeterRegion, `
    >>             Unit, `
    >>             Quantity, `
    >>             @{n='Project';e={$_.InfoFields.Project}}, `
    >>             InstanceData |
    >>         Export-Csv `
    >>             -Append:$appendFile `
    >>             -NoTypeInformation:$true `
    >>             -Path $filename
    >>
    >>     if ($usageData.NextLink) {
    >>
    >>         $continuationToken = `
    >>             [System.Web.HttpUtility]::`
    >>             UrlDecode($usageData.NextLink.Split("=")[-1])
    >>
    >>     } else {
    >>
    >>         $continuationToken = ""
    >>
    >>     }
    >>
    >>     $appendFile = $true
    >>
    >> } until (!$continua
    Oops, something went wrong.  Please report this bug with the details below.
    Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    Last 200 Keys:
    ```
     Space Space Space Space Space [ S y s t e m . W e b . H t t p U t i l i t y ] : : ` Enter
     Space Space Space Space Space Space Space Space Space Space Space Space U r l D e c o d e ( $ u s a g e D a t a . N e x t L i n k . S p l i t ( " = " ) [ - 1 ] ) Enter
     Enter
     Space Space Space Space } Space e l s e Space { Enter
     Enter
     Space Space Space Space Space Space Space Space $ c o n t i n u a t i o n T o k e n Space = Space " " Enter
     Enter
     Space Space Space Space } Enter
     Enter
     Space Space Space Space $ a p p e n d F i l e Space = Space $ t r u e Enter
     Enter
     } Space u n t i l Space ( ! $ c o n t i n u a t i o n T o k e n )
    ```

    Exception:
    ```
    System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
    Parameter name: top
    Actual value was -16.
       at System.Console.SetCursorPosition(Int32 left, Int32 top)
       at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
       at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
       at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
       at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
    ```
    -----------------------------------------------------------------------
    Azure:/
    PS Azure:\> Do {
    >>
    >>     $usageData = Get-UsageAggregates `
    >>         -ReportedStartTime $reportedStartTime `
    >>         -ReportedEndTime $reportedEndTime `
    >>         -AggregationGranularity $granularity `
    >>         -ShowDetails:$showDetails `
    >>         -ContinuationToken $continuationToken
    >>
    >>     $usageData.UsageAggregations.Properties |
    >>         Select-Object `
    >>             UsageStartTime, `
    >>             UsageEndTime, `
    >>             @{n='SubscriptionId';e={$subscriptionId}}, `
    >>             MeterCategory, `
    >>             MeterId, `
    >>             MeterName, `
    >>             MeterSubCategory, `
    >>             MeterRegion, `
    >>             Unit, `
    >>             Quantity, `
    >>             @{n='Project';e={$_.InfoFields.Project}}, `
    >>             InstanceData |
    >>         Export-Csv `
    >>             -Append:$appendFile `
    >>             -NoTypeInformation:$true `
    >>             -Path $filename
    >>
    >>     if ($usageData.NextLink) {
    >>
    >>         $continuationToken = `
    >>             [System.Web.HttpUtility]::`
    >>             UrlDecode($usageData.NextLink.Split("=")[-1])
    >>
    >>     } else {
    >>
    >>         $continuationToken = ""
    >>
    >>     }
    >>
    >>     $appendFile = $true
    >>
    >> } until (!$continuat
    Oops, something went wrong.  Please report this bug with the details below.
    Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    Last 200 Keys:
    ```
     Space Space Space Space Space [ S y s t e m . W e b . H t t p U t i l i t y ] : : ` Enter
     Space Space Space Space Space Space Space Space Space Space Space Space U r l D e c o d e ( $ u s a g e D a t a . N e x t L i n k . S p l i t ( " = " ) [ - 1 ] ) Enter
     Enter
     Space Space Space Space } Space e l s e Space { Enter
     Enter
     Space Space Space Space Space Space Space Space $ c o n t i n u a t i o n T o k e n Space = Space " " Enter
     Enter
     Space Space Space Space } Enter
     Enter
     Space Space Space Space $ a p p e n d F i l e Space = Space $ t r u e Enter
     Enter
     } Space u n t i l Space ( ! $ c o n t i n u a t i o n T o k e n )
    ```

    Exception:
    ```
    System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
    Parameter name: top
    Actual value was -16.
       at System.Console.SetCursorPosition(Int32 left, Int32 top)
       at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
       at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
       at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
       at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
    ```
    -----------------------------------------------------------------------
    Azure:/
    PS Azure:\> Do {
    >>
    >>     $usageData = Get-UsageAggregates `
    >>         -ReportedStartTime $reportedStartTime `
    >>         -ReportedEndTime $reportedEndTime `
    >>         -AggregationGranularity $granularity `
    >>         -ShowDetails:$showDetails `
    >>         -ContinuationToken $continuationToken
    >>
    >>     $usageData.UsageAggregations.Properties |
    >>         Select-Object `
    >>             UsageStartTime, `
    >>             UsageEndTime, `
    >>             @{n='SubscriptionId';e={$subscriptionId}}, `
    >>             MeterCategory, `
    >>             MeterId, `
    >>             MeterName, `
    >>             MeterSubCategory, `
    >>             MeterRegion, `
    >>             Unit, `
    >>             Quantity, `
    >>             @{n='Project';e={$_.InfoFields.Project}}, `
    >>             InstanceData |
    >>         Export-Csv `
    >>             -Append:$appendFile `
    >>             -NoTypeInformation:$true `
    >>             -Path $filename
    >>
    >>     if ($usageData.NextLink) {
    >>
    >>         $continuationToken = `
    >>             [System.Web.HttpUtility]::`
    >>             UrlDecode($usageData.NextLink.Split("=")[-1])
    >>
    >>     } else {
    >>
    >>         $continuationToken = ""
    >>
    >>     }
    >>
    >>     $appendFile = $true
    >>
    >> } until (!$continuati
    Oops, something went wrong.  Please report this bug with the details below.
    Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    Last 200 Keys:
    ```
     Space Space Space Space Space [ S y s t e m . W e b . H t t p U t i l i t y ] : : ` Enter
     Space Space Space Space Space Space Space Space Space Space Space Space U r l D e c o d e ( $ u s a g e D a t a . N e x t L i n k . S p l i t ( " = " ) [ - 1 ] ) Enter
     Enter
     Space Space Space Space } Space e l s e Space { Enter
     Enter
     Space Space Space Space Space Space Space Space $ c o n t i n u a t i o n T o k e n Space = Space " " Enter
     Enter
     Space Space Space Space } Enter
     Enter
     Space Space Space Space $ a p p e n d F i l e Space = Space $ t r u e Enter
     Enter
     } Space u n t i l Space ( ! $ c o n t i n u a t i o n T o k e n )
    ```

    Exception:
    ```
    System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
    Parameter name: top
    Actual value was -16.
       at System.Console.SetCursorPosition(Int32 left, Int32 top)
       at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
       at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
       at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
       at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
    ```
    -----------------------------------------------------------------------
    Azure:/
    PS Azure:\> Do {
    >>
    >>     $usageData = Get-UsageAggregates `
    >>         -ReportedStartTime $reportedStartTime `
    >>         -ReportedEndTime $reportedEndTime `
    >>         -AggregationGranularity $granularity `
    >>         -ShowDetails:$showDetails `
    >>         -ContinuationToken $continuationToken
    >>
    >>     $usageData.UsageAggregations.Properties |
    >>         Select-Object `
    >>             UsageStartTime, `
    >>             UsageEndTime, `
    >>             @{n='SubscriptionId';e={$subscriptionId}}, `
    >>             MeterCategory, `
    >>             MeterId, `
    >>             MeterName, `
    >>             MeterSubCategory, `
    >>             MeterRegion, `
    >>             Unit, `
    >>             Quantity, `
    >>             @{n='Project';e={$_.InfoFields.Project}}, `
    >>             InstanceData |
    >>         Export-Csv `
    >>             -Append:$appendFile `
    >>             -NoTypeInformation:$true `
    >>             -Path $filename
    >>
    >>     if ($usageData.NextLink) {
    >>
    >>         $continuationToken = `
    >>             [System.Web.HttpUtility]::`
    >>             UrlDecode($usageData.NextLink.Split("=")[-1])
    >>
    >>     } else {
    >>
    >>         $continuationToken = ""
    >>
    >>     }
    >>
    >>     $appendFile = $true
    >>
    >> } until (!$continuatio
    Oops, something went wrong.  Please report this bug with the details below.
    Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    Last 200 Keys:
    ```
     Space Space Space Space Space [ S y s t e m . W e b . H t t p U t i l i t y ] : : ` Enter
     Space Space Space Space Space Space Space Space Space Space Space Space U r l D e c o d e ( $ u s a g e D a t a . N e x t L i n k . S p l i t ( " = " ) [ - 1 ] ) Enter
     Enter
     Space Space Space Space } Space e l s e Space { Enter
     Enter
     Space Space Space Space Space Space Space Space $ c o n t i n u a t i o n T o k e n Space = Space " " Enter
     Enter
     Space Space Space Space } Enter
     Enter
     Space Space Space Space $ a p p e n d F i l e Space = Space $ t r u e Enter
     Enter
     } Space u n t i l Space ( ! $ c o n t i n u a t i o n T o k e n )
    ```

    Exception:
    ```
    System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
    Parameter name: top
    Actual value was -16.
       at System.Console.SetCursorPosition(Int32 left, Int32 top)
       at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
       at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
       at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
       at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
    ```
    -----------------------------------------------------------------------
    Azure:/
    PS Azure:\> Do {
    >>
    >>     $usageData = Get-UsageAggregates `
    >>         -ReportedStartTime $reportedStartTime `
    >>         -ReportedEndTime $reportedEndTime `
    >>         -AggregationGranularity $granularity `
    >>         -ShowDetails:$showDetails `
    >>         -ContinuationToken $continuationToken
    >>
    >>     $usageData.UsageAggregations.Properties |
    >>         Select-Object `
    >>             UsageStartTime, `
    >>             UsageEndTime, `
    >>             @{n='SubscriptionId';e={$subscriptionId}}, `
    >>             MeterCategory, `
    >>             MeterId, `
    >>             MeterName, `
    >>             MeterSubCategory, `
    >>             MeterRegion, `
    >>             Unit, `
    >>             Quantity, `
    >>             @{n='Project';e={$_.InfoFields.Project}}, `
    >>             InstanceData |
    >>         Export-Csv `
    >>             -Append:$appendFile `
    >>             -NoTypeInformation:$true `
    >>             -Path $filename
    >>
    >>     if ($usageData.NextLink) {
    >>
    >>         $continuationToken = `
    >>             [System.Web.HttpUtility]::`
    >>             UrlDecode($usageData.NextLink.Split("=")[-1])
    >>
    >>     } else {
    >>
    >>         $continuationToken = ""
    >>
    >>     }
    >>
    >>     $appendFile = $true
    >>
    >> } until (!$continuation
    Oops, something went wrong.  Please report this bug with the details below.
    Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    Last 200 Keys:
    ```
     Space Space Space Space Space [ S y s t e m . W e b . H t t p U t i l i t y ] : : ` Enter
     Space Space Space Space Space Space Space Space Space Space Space Space U r l D e c o d e ( $ u s a g e D a t a . N e x t L i n k . S p l i t ( " = " ) [ - 1 ] ) Enter
     Enter
     Space Space Space Space } Space e l s e Space { Enter
     Enter
     Space Space Space Space Space Space Space Space $ c o n t i n u a t i o n T o k e n Space = Space " " Enter
     Enter
     Space Space Space Space } Enter
     Enter
     Space Space Space Space $ a p p e n d F i l e Space = Space $ t r u e Enter
     Enter
     } Space u n t i l Space ( ! $ c o n t i n u a t i o n T o k e n )
    ```

    Exception:
    ```
    System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
    Parameter name: top
    Actual value was -16.
       at System.Console.SetCursorPosition(Int32 left, Int32 top)
       at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
       at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
       at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
       at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
    ```
    -----------------------------------------------------------------------
    Azure:/
    PS Azure:\> Do {
    >>
    >>     $usageData = Get-UsageAggregates `
    >>         -ReportedStartTime $reportedStartTime `
    >>         -ReportedEndTime $reportedEndTime `
    >>         -AggregationGranularity $granularity `
    >>         -ShowDetails:$showDetails `
    >>         -ContinuationToken $continuationToken
    >>
    >>     $usageData.UsageAggregations.Properties |
    >>         Select-Object `
    >>             UsageStartTime, `
    >>             UsageEndTime, `
    >>             @{n='SubscriptionId';e={$subscriptionId}}, `
    >>             MeterCategory, `
    >>             MeterId, `
    >>             MeterName, `
    >>             MeterSubCategory, `
    >>             MeterRegion, `
    >>             Unit, `
    >>             Quantity, `
    >>             @{n='Project';e={$_.InfoFields.Project}}, `
    >>             InstanceData |
    >>         Export-Csv `
    >>             -Append:$appendFile `
    >>             -NoTypeInformation:$true `
    >>             -Path $filename
    >>
    >>     if ($usageData.NextLink) {
    >>
    >>         $continuationToken = `
    >>             [System.Web.HttpUtility]::`
    >>             UrlDecode($usageData.NextLink.Split("=")[-1])
    >>
    >>     } else {
    >>
    >>         $continuationToken = ""
    >>
    >>     }
    >>
    >>     $appendFile = $true
    >>
    >> } until (!$continuationT
    Oops, something went wrong.  Please report this bug with the details below.
    Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    Last 200 Keys:
    ```
     Space Space Space Space Space [ S y s t e m . W e b . H t t p U t i l i t y ] : : ` Enter
     Space Space Space Space Space Space Space Space Space Space Space Space U r l D e c o d e ( $ u s a g e D a t a . N e x t L i n k . S p l i t ( " = " ) [ - 1 ] ) Enter
     Enter
     Space Space Space Space } Space e l s e Space { Enter
     Enter
     Space Space Space Space Space Space Space Space $ c o n t i n u a t i o n T o k e n Space = Space " " Enter
     Enter
     Space Space Space Space } Enter
     Enter
     Space Space Space Space $ a p p e n d F i l e Space = Space $ t r u e Enter
     Enter
     } Space u n t i l Space ( ! $ c o n t i n u a t i o n T o k e n )
    ```

    Exception:
    ```
    System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
    Parameter name: top
    Actual value was -16.
       at System.Console.SetCursorPosition(Int32 left, Int32 top)
       at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
       at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
       at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
       at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
    ```
    -----------------------------------------------------------------------
    Azure:/
    PS Azure:\> Do {
    >>
    >>     $usageData = Get-UsageAggregates `
    >>         -ReportedStartTime $reportedStartTime `
    >>         -ReportedEndTime $reportedEndTime `
    >>         -AggregationGranularity $granularity `
    >>         -ShowDetails:$showDetails `
    >>         -ContinuationToken $continuationToken
    >>
    >>     $usageData.UsageAggregations.Properties |
    >>         Select-Object `
    >>             UsageStartTime, `
    >>             UsageEndTime, `
    >>             @{n='SubscriptionId';e={$subscriptionId}}, `
    >>             MeterCategory, `
    >>             MeterId, `
    >>             MeterName, `
    >>             MeterSubCategory, `
    >>             MeterRegion, `
    >>             Unit, `
    >>             Quantity, `
    >>             @{n='Project';e={$_.InfoFields.Project}}, `
    >>             InstanceData |
    >>         Export-Csv `
    >>             -Append:$appendFile `
    >>             -NoTypeInformation:$true `
    >>             -Path $filename
    >>
    >>     if ($usageData.NextLink) {
    >>
    >>         $continuationToken = `
    >>             [System.Web.HttpUtility]::`
    >>             UrlDecode($usageData.NextLink.Split("=")[-1])
    >>
    >>     } else {
    >>
    >>         $continuationToken = ""
    >>
    >>     }
    >>
    >>     $appendFile = $true
    >>
    >> } until (!$continuationTo
    Oops, something went wrong.  Please report this bug with the details below.
    Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    Last 200 Keys:
    ```
     Space Space Space Space Space [ S y s t e m . W e b . H t t p U t i l i t y ] : : ` Enter
     Space Space Space Space Space Space Space Space Space Space Space Space U r l D e c o d e ( $ u s a g e D a t a . N e x t L i n k . S p l i t ( " = " ) [ - 1 ] ) Enter
     Enter
     Space Space Space Space } Space e l s e Space { Enter
     Enter
     Space Space Space Space Space Space Space Space $ c o n t i n u a t i o n T o k e n Space = Space " " Enter
     Enter
     Space Space Space Space } Enter
     Enter
     Space Space Space Space $ a p p e n d F i l e Space = Space $ t r u e Enter
     Enter
     } Space u n t i l Space ( ! $ c o n t i n u a t i o n T o k e n )
    ```

    Exception:
    ```
    System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
    Parameter name: top
    Actual value was -16.
       at System.Console.SetCursorPosition(Int32 left, Int32 top)
       at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
       at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
       at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
       at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
    ```
    -----------------------------------------------------------------------
    Azure:/
    PS Azure:\> Do {
    >>
    >>     $usageData = Get-UsageAggregates `
    >>         -ReportedStartTime $reportedStartTime `
    >>         -ReportedEndTime $reportedEndTime `
    >>         -AggregationGranularity $granularity `
    >>         -ShowDetails:$showDetails `
    >>         -ContinuationToken $continuationToken
    >>
    >>     $usageData.UsageAggregations.Properties |
    >>         Select-Object `
    >>             UsageStartTime, `
    >>             UsageEndTime, `
    >>             @{n='SubscriptionId';e={$subscriptionId}}, `
    >>             MeterCategory, `
    >>             MeterId, `
    >>             MeterName, `
    >>             MeterSubCategory, `
    >>             MeterRegion, `
    >>             Unit, `
    >>             Quantity, `
    >>             @{n='Project';e={$_.InfoFields.Project}}, `
    >>             InstanceData |
    >>         Export-Csv `
    >>             -Append:$appendFile `
    >>             -NoTypeInformation:$true `
    >>             -Path $filename
    >>
    >>     if ($usageData.NextLink) {
    >>
    >>         $continuationToken = `
    >>             [System.Web.HttpUtility]::`
    >>             UrlDecode($usageData.NextLink.Split("=")[-1])
    >>
    >>     } else {
    >>
    >>         $continuationToken = ""
    >>
    >>     }
    >>
    >>     $appendFile = $true
    >>
    >> } until (!$continuationTok
    Oops, something went wrong.  Please report this bug with the details below.
    Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    Last 200 Keys:
    ```
     Space Space Space Space Space [ S y s t e m . W e b . H t t p U t i l i t y ] : : ` Enter
     Space Space Space Space Space Space Space Space Space Space Space Space U r l D e c o d e ( $ u s a g e D a t a . N e x t L i n k . S p l i t ( " = " ) [ - 1 ] ) Enter
     Enter
     Space Space Space Space } Space e l s e Space { Enter
     Enter
     Space Space Space Space Space Space Space Space $ c o n t i n u a t i o n T o k e n Space = Space " " Enter
     Enter
     Space Space Space Space } Enter
     Enter
     Space Space Space Space $ a p p e n d F i l e Space = Space $ t r u e Enter
     Enter
     } Space u n t i l Space ( ! $ c o n t i n u a t i o n T o k e n )
    ```

    Exception:
    ```
    System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
    Parameter name: top
    Actual value was -16.
       at System.Console.SetCursorPosition(Int32 left, Int32 top)
       at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
       at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
       at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
       at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
    ```
    -----------------------------------------------------------------------
    Azure:/
    PS Azure:\> Do {
    >>
    >>     $usageData = Get-UsageAggregates `
    >>         -ReportedStartTime $reportedStartTime `
    >>         -ReportedEndTime $reportedEndTime `
    >>         -AggregationGranularity $granularity `
    >>         -ShowDetails:$showDetails `
    >>         -ContinuationToken $continuationToken
    >>
    >>     $usageData.UsageAggregations.Properties |
    >>         Select-Object `
    >>             UsageStartTime, `
    >>             UsageEndTime, `
    >>             @{n='SubscriptionId';e={$subscriptionId}}, `
    >>             MeterCategory, `
    >>             MeterId, `
    >>             MeterName, `
    >>             MeterSubCategory, `
    >>             MeterRegion, `
    >>             Unit, `
    >>             Quantity, `
    >>             @{n='Project';e={$_.InfoFields.Project}}, `
    >>             InstanceData |
    >>         Export-Csv `
    >>             -Append:$appendFile `
    >>             -NoTypeInformation:$true `
    >>             -Path $filename
    >>
    >>     if ($usageData.NextLink) {
    >>
    >>         $continuationToken = `
    >>             [System.Web.HttpUtility]::`
    >>             UrlDecode($usageData.NextLink.Split("=")[-1])
    >>
    >>     } else {
    >>
    >>         $continuationToken = ""
    >>
    >>     }
    >>
    >>     $appendFile = $true
    >>
    >> } until (!$continuationToke
    Oops, something went wrong.  Please report this bug with the details below.
    Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    Last 200 Keys:
    ```
     Space Space Space Space Space [ S y s t e m . W e b . H t t p U t i l i t y ] : : ` Enter
     Space Space Space Space Space Space Space Space Space Space Space Space U r l D e c o d e ( $ u s a g e D a t a . N e x t L i n k . S p l i t ( " = " ) [ - 1 ] ) Enter
     Enter
     Space Space Space Space } Space e l s e Space { Enter
     Enter
     Space Space Space Space Space Space Space Space $ c o n t i n u a t i o n T o k e n Space = Space " " Enter
     Enter
     Space Space Space Space } Enter
     Enter
     Space Space Space Space $ a p p e n d F i l e Space = Space $ t r u e Enter
     Enter
     } Space u n t i l Space ( ! $ c o n t i n u a t i o n T o k e n )
    ```

    Exception:
    ```
    System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
    Parameter name: top
    Actual value was -16.
       at System.Console.SetCursorPosition(Int32 left, Int32 top)
       at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
       at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
       at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
       at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
    ```
    -----------------------------------------------------------------------
    Azure:/
    PS Azure:\> Do {
    >>
    >>     $usageData = Get-UsageAggregates `
    >>         -ReportedStartTime $reportedStartTime `
    >>         -ReportedEndTime $reportedEndTime `
    >>         -AggregationGranularity $granularity `
    >>         -ShowDetails:$showDetails `
    >>         -ContinuationToken $continuationToken
    >>
    >>     $usageData.UsageAggregations.Properties |
    >>         Select-Object `
    >>             UsageStartTime, `
    >>             UsageEndTime, `
    >>             @{n='SubscriptionId';e={$subscriptionId}}, `
    >>             MeterCategory, `
    >>             MeterId, `
    >>             MeterName, `
    >>             MeterSubCategory, `
    >>             MeterRegion, `
    >>             Unit, `
    >>             Quantity, `
    >>             @{n='Project';e={$_.InfoFields.Project}}, `
    >>             InstanceData |
    >>         Export-Csv `
    >>             -Append:$appendFile `
    >>             -NoTypeInformation:$true `
    >>             -Path $filename
    >>
    >>     if ($usageData.NextLink) {
    >>
    >>         $continuationToken = `
    >>             [System.Web.HttpUtility]::`
    >>             UrlDecode($usageData.NextLink.Split("=")[-1])
    >>
    >>     } else {
    >>
    >>         $continuationToken = ""
    >>
    >>     }
    >>
    >>     $appendFile = $true
    >>
    >> } until (!$continuationToken
    Oops, something went wrong.  Please report this bug with the details below.
    Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    Last 200 Keys:
    ```
     Space Space Space Space Space [ S y s t e m . W e b . H t t p U t i l i t y ] : : ` Enter
     Space Space Space Space Space Space Space Space Space Space Space Space U r l D e c o d e ( $ u s a g e D a t a . N e x t L i n k . S p l i t ( " = " ) [ - 1 ] ) Enter
     Enter
     Space Space Space Space } Space e l s e Space { Enter
     Enter
     Space Space Space Space Space Space Space Space $ c o n t i n u a t i o n T o k e n Space = Space " " Enter
     Enter
     Space Space Space Space } Enter
     Enter
     Space Space Space Space $ a p p e n d F i l e Space = Space $ t r u e Enter
     Enter
     } Space u n t i l Space ( ! $ c o n t i n u a t i o n T o k e n )
    ```

    Exception:
    ```
    System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
    Parameter name: top
    Actual value was -16.
       at System.Console.SetCursorPosition(Int32 left, Int32 top)
       at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
       at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
       at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
       at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
    ```
    -----------------------------------------------------------------------
    Azure:/
    PS Azure:\> Do {
    >>
    >>     $usageData = Get-UsageAggregates `
    >>         -ReportedStartTime $reportedStartTime `
    >>         -ReportedEndTime $reportedEndTime `
    >>         -AggregationGranularity $granularity `
    >>         -ShowDetails:$showDetails `
    >>         -ContinuationToken $continuationToken
    >>
    >>     $usageData.UsageAggregations.Properties |
    >>         Select-Object `
    >>             UsageStartTime, `
    >>             UsageEndTime, `
    >>             @{n='SubscriptionId';e={$subscriptionId}}, `
    >>             MeterCategory, `
    >>             MeterId, `
    >>             MeterSubCategory, `
    >>             MeterRegion, `
    >>             Unit, `
    >>             Quantity, `
    >>             @{n='Project';e={$_.InfoFields.Project}}, `
    >>             InstanceData |
    >>         Export-Csv `
    >>             -Append:$appendFile `
    >>             -NoTypeInformation:$true `
    >>             -Path $filename
    >>
    >>     if ($usageData.NextLink) {
    >>
    >>         $continuationToken = `
    >>             [System.Web.HttpUtility]::`
    >>             UrlDecode($usageData.NextLink.Split("=")[-1])
    >>
    >>     } else {
    >>
    >>         $continuationToken = ""
    >>
    >>     }
    >>
    >>     $appendFile = $true
    >>
    >> } until (!$continuationToken)
    Get-UsageAggregates : InvalidInput: Parameter continuationtoken was missing or had an unacceptable value.
    At line:3 char:18
    +     $usageData = Get-UsageAggregates `
    +                  ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-UsageAggregates], CloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.UsageAggregates.GetUsageAggregatesCommand

    Export-Csv : Cannot open file because the current provider (SHiPS\SHiPS) cannot open a file.
    At line:24 char:9
    +         Export-Csv `
    +         ~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Export-Csv], PSInvalidOperationException
    + FullyQualifiedErrorId : ReadWriteFileNotFileSystemProvider,Microsoft.PowerShell.Commands.ExportCsvCommand
    Azure:/


    dsk


    • Edited by kimdav111 Wednesday, August 14, 2019 1:09 AM
    Wednesday, August 14, 2019 1:01 AM
  • Continuation from the 2nd powershell from your link 

    https://blogs.technet.microsoft.com/keithmayer/2015/06/30/export-azure-subscription-usage-to-csv-with-new-billing-api-and-powershell/

    Export Azure Usage via PowerShell and Billing REST API

    2) - not sure what to do with errors below? Guessing this requires Azure AD?
    S Azure:\>
    Azure:/
    PS Azure:\> $reportedEndTime = "2019-07-30"
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> # Authenticate to Azure
    Azure:/
    Azure:/
    Add-AzureAccount : The term 'Add-AzureAccount' is not recognized as the name of a cmdlet, function, script file, or operable program.
    At line:1 char:1
    + Add-AzureAccount
    + ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Add-AzureAccount:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> # Select an Azure Subscription for which to report usage data
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> $subscriptionId =
    >>     (Get-AzureSubscription |
    >>         -Title "Select an Azure Subscription ..." `
    Get-AzureSubscription : The term 'Get-AzureSubscription' is not recognized as the name of a cmdlet, function, script file, or operable program.
    At line:2 char:6
    +      ~~~~~~~~~~~~~~~~~~~~~
    + FullyQualifiedErrorId : CommandNotFoundException
    Azure:/
    Azure:/
    PS Azure:\> # Set path to exported CSV file
    Azure:/
    Azure:/
    PS Azure:\> $filename = ".\usageData-${subscriptionId}-${reportedStartTime}-${reportedEndTime}.csv"
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> # Set Azure AD Tenant for selected Azure Subscription
    Azure:/
    PS Azure:\>
    Azure:/
    >>     (Get-AzureSubscription `
    Get-AzureSubscription : The term 'Get-AzureSubscription' is not recognized as the name of a cmdlet, function, script file, or operable program.
    At line:2 char:6
    +      ~~~~~~~~~~~~~~~~~~~~~
    + FullyQualifiedErrorId : CommandNotFoundException
    Azure:/
    Azure:/
    Azure:/
    Azure:/
    Azure:/
    Azure:/
    Azure:/
    Azure:/
    PS Azure:\> $resourceAppIdURI = "https://management.core.windows.net/" # Resource URI for REST API
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> $authority = "https://login.windows.net/$adTenant" # Azure AD Tenant Authority
    Azure:/
    Azure:/
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> $adal = "${env:ProgramFiles(x86)}\
    >> Microsoft SDKs\
    >> Azure\PowerShell\
    >> ServiceManagement\
    >> Microsoft.IdentityModel.
    Azure:/
    Azure:/
    PS Azure:\> $adalforms = "${env:ProgramFiles(x86)}\
    >> Microsoft SDKs\
    >> Azure\PowerShell\
    >> ServiceManagement\
    >> Azure\Services\
    >> Microsoft.IdentityModel.
    >> Clients.ActiveDirectory.WindowsForms.dll"
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> Add-Type -Path $adal
    Add-Type : Cannot bind parameter 'Path' to the target. Exception setting "Path": "Cannot find path '/
    Microsoft SDKs/
    ServiceManagement/
    Microsoft.IdentityModel.
    Clients.ActiveDirectory.dll' because it does not exist."
    At line:1 char:16
    + Add-Type -Path $adal
    +                ~~~~~
    + CategoryInfo          : WriteError: (:) [Add-Type], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.AddTypeCommand

    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> Add-Type -Path $adalforms
    Add-Type : Cannot bind parameter 'Path' to the target. Exception setting "Path": "Cannot find path '/
    Microsoft SDKs/
    ServiceManagement/
    Microsoft.IdentityModel.
    At line:1 char:16
    +                ~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Add-Type], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.AddTypeCommand

    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> # Create Authentication Context tied to Azure AD Tenant
    Azure:/
    PS Azure:\>
    Azure:/
    PS Azure:\> $authContext = New-Object

    cmdlet New-Object at command pipeline position 1
    Supply values for the following parameters:
    TypeName:

    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    PS Azure:\> Get-Module Az* -ListAvailable


        Directory: /usr/local/share/powershell/Modules

    ModuleType Version    Name                                PSEdition ExportedCommands
    ---------- -------    ----                                --------- ----------------
    Script     2.5.0      Az                                  Core,Desk
    Script     1.6.1      Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAut…
    Script     1.0.0      Az.Advisor                          Core,Desk {Get-AzAdvisorRecommendation, Enable-AzAdvisorRecommendation, Disable-AzAdvisorRecommendation, Get…
    Script     1.0.1      Az.Aks                              Core,Desk {Get-AzAks, New-AzAks, Remove-AzAks, Import-AzAksCredential…}
    Script     1.1.0      Az.AnalysisServices                 Core,Desk {Resume-AzAnalysisServicesServer, Suspend-AzAnalysisServicesServer, Get-AzAnalysisServicesServer, …
    Script     1.2.0      Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToProduct, Add-AzApiManagementProductToGroup, Add-AzApiManagementRegion, Ad…
    Script     1.0.1      Az.ApplicationInsights              Core,Desk {Get-AzApplicationInsights, New-AzApplicationInsights, Remove-AzApplicationInsights, Set-AzApplica…
    Script     1.3.1      Az.Automation                       Core,Desk {Get-AzAutomationHybridWorkerGroup, Remove-AzAutomationHybridWorkerGroup, Get-AzAutomationJobOutpu…
    Script     1.1.0      Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAccount, Get-AzBatchAccountKey, New-AzBatchAccount…}
    Script     1.0.0      Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPeriod, Get-AzEnrollmentAccount, Get-AzConsumptionBudget…}
    Script     1.3.0      Az.Cdn                              Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoUrl, New-AzCdnProfile, Remove-AzCdnProfile…}
    Script     1.2.0      Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-AzCognitiveServicesAccountKey, Get-AzCognitiveServicesAccount…
    Script     2.4.1      Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-AzAvailabilitySet, Update-AzAvailabilitySet…}
    Script     1.0.1      Az.ContainerInstance                Core,Desk {New-AzContainerGroup, Get-AzContainerGroup, Remove-AzContainerGroup, Get-AzContainerInstanceLog}
    Script     1.1.0      Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContainerRegistry, Update-AzContainerRegistry, Remove-AzContainerR…
    Script     1.1.3      Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFactoryV2, Get-AzDataFactoryV2, Remove-AzDataFactoryV2…}
    Script     1.0.0      Az.DataLakeAnalytics                Core,Desk {Get-AzDataLakeAnalyticsDataSource, New-AzDataLakeAnalyticsCatalogCredential, Remove-AzDataLakeAna…
    Script     1.2.1      Az.DataLakeStore                    Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeS…
    Script     1.0.0      Az.DeploymentManager                Core,Desk {Get-AzDeploymentManagerArtifactSource, New-AzDeploymentManagerArtifactSource, Set-AzDeploymentMan…
    Script     1.0.0      Az.DevTestLabs                      Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-AzDtlAutoShutdownPolicy, Get-AzDtlAutoStartPolicy, Get-AzDtlVM…
    Script     1.1.1      Az.Dns                              Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordConfig, Remove-AzDnsRecordSet, Set-AzDnsRecordSet…}
    Script     1.2.1      Az.EventGrid                        Core,Desk {New-AzEventGridTopic, Get-AzEventGridTopic, Set-AzEventGridTopic, New-AzEventGridTopicKey…}
    Script     1.3.0      Az.EventHub                         Core,Desk {New-AzEventHubNamespace, Get-AzEventHubNamespace, Set-AzEventHubNamespace, Remove-AzEventHubNames…
    Script     1.1.0      Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-AzFrontDoor, Remove-AzFrontDoor…}
    Script     0.10.6     Az.GuestConfiguration               Core,Desk {Get-AzVMGuestPolicyStatus, Get-AzVMGuestPolicyStatusHistory}
    Script     2.0.0      Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqoopJobDefinition, Wait-AzHDInsightJob, New-AzHDInsightStream…
    Script     1.2.0      Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubConsumerGroup, Get-AzIotHubConnectionString, Get-AzIotHubJob…
    Script     1.3.0      Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKeyVaultCertificate, Stop-AzKeyVaultCertificateOperation, Get…
    Script     1.3.0      Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get-AzIntegrationAccountAssembly, Get-AzIntegrationAccountBatc…
    Script     1.1.0      Az.MachineLearning                  Core,Desk {Move-AzMlCommitmentAssociation, Get-AzMlCommitmentAssociation, Get-AzMlCommitmentPlanUsageHistory…
    Script     1.0.0      Az.ManagedServices                  Core,Desk {Get-AzManagedServicesAssignment, New-AzManagedServicesAssignment, Remove-AzManagedServicesAssignm…
    Script     1.0.0      Az.MarketplaceOrdering              Core,Desk {Get-AzMarketplaceTerms, Set-AzMarketplaceTerms}
    Script     1.1.0      Az.Media                            Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzMediaServiceKey, Get-AzMediaServiceKey, Get-AzMediaServiceNa…
    Script     1.2.1      Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, Remove-AzLogProfile, Get-AzLogProfile…}
    Script     1.12.0     Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthenticationCertificate, Get-AzApplicationGatewayAuthenticationCertific…
    Script     1.1.0      Az.NotificationHubs                 Core,Desk {Get-AzNotificationHub, Get-AzNotificationHubAuthorizationRule, Get-AzNotificationHubListKey, Get-…
    Script     1.3.2      Az.OperationalInsights              Core,Desk {New-AzOperationalInsightsAzureActivityLogDataSource, New-AzOperationalInsightsCustomLogDataSource…
    Script     1.1.2      Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicyStateSummary, Get-AzPolicyRemediation…}
    Script     1.1.0      Az.PowerBIEmbedded                  Core,Desk {Remove-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceColl…
    Script     1.4.3      Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, Get-AzRecoveryServicesVault, Get-AzRecoveryServicesVaultSet…
    Script     1.1.0      Az.RedisCache                       Core,Desk {Remove-AzRedisCachePatchSchedule, New-AzRedisCacheScheduleEntry, Get-AzRedisCachePatchSchedule, N…
    Script     1.0.1      Az.Relay                            Core,Desk {New-AzRelayNamespace, Get-AzRelayNamespace, Set-AzRelayNamespace, Remove-AzRelayNamespace…}
    Script     1.6.1      Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRoleAssignment, Get-AzRoleAssignment, New-AzRoleAssignment…}
    Script     1.3.0      Az.ServiceBus                       Core,Desk {New-AzServiceBusNamespace, Get-AzServiceBusNamespace, Set-AzServiceBusNamespace, Remove-AzService…
    Script     1.1.1      Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricApplicationCertificate, Add-AzServiceFabricClientCertificate, Add-AzServiceFab…
    Script     1.0.2      Az.SignalR                          Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSignalRKey, New-AzSignalRKey…}
    Script     1.13.1     Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryption, Get-AzSqlDatabaseTransparentDataEncryptionActivity, S…
    Script     1.5.1      Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAccountKey, New-AzStorageAccount, New-AzStorageAccountKey…}
    Script     1.2.0      Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck, New-AzStorageSyncService, Get-AzStorageSyncService, Remov…
    Script     1.0.0      Az.StreamAnalytics                  Core,Desk {Get-AzStreamAnalyticsFunction, Get-AzStreamAnalyticsDefaultFunctionDefinition, New-AzStreamAnalyt…
    Script     1.0.1      Az.TrafficManager                   Core,Desk {Add-AzTrafficManagerCustomHeaderToEndpoint, Remove-AzTrafficManagerCustomHeaderFromEndpoint, Add-…
    Script     1.4.0      Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzAppServicePlan, Remove-AzAppServicePlan…}
    Script     0.0.0.10   AzureAD.Standard.Preview            Desk      {Add-AzureADDeviceRegisteredUser, Get-AzureADDeviceRegisteredOwner, Remove-AzureADTrustedCertifica…
    Script     0.9.3      AzurePSDrive                        Desk


    dsk

    Wednesday, August 14, 2019 1:05 AM
  • Azure PowerShell team has removed the command Switch-AzureMode and it is deprecated long back. Please upgrade to the latest version of Azure PowerShell
    Monday, August 26, 2019 1:31 PM
    Moderator