Add-​Azure​RM​Usage​Connection

The Add-AzureRMUsageConnection cmdlet adds an usage connection details for a resource provider. The cmdlet gets the storage account information where the resource provider is storing the usage records. This information is given to the usage service through this cmdlet. Usage Service will retrieve the usage records periodically from the storage account information provided

Syntax

Add-AzureRMUsageConnection
   -ArmLocation <String>
   -ErrorReportingQueue <String>
   -ErrorReportingTable <String>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   -Name <String>
   [-PipelineVariable <String>]
   -ProviderLocation <String>
   -ProviderNamespace <String>
   -ResourceGroup <String>
   -UsageReportingQueue <String>
   -UsageReportingTable <String>
   -UsageStorageConnectionString <String>
   [<CommonParameters>]

Examples

Example 1:

Add-AzureRmUsageConnection @usageConnectionParams

Description

-----------

The following example registers a usage connection information of a resource provider to usage service

$usageConnectionId = "sqlrpusageconnection" $location = "local"

# Create Resource Group

The following name could be anything

        $usageConnectionRG="UsageConnectionRG"
        New-AzureRMResourceGroup -Name $usageConnectionRG  -Location $location -Force<br /><br />            # Make sure the tables and queues exist
        # if not create them with New-AzureStorageTale/New-AzureStorageQueue
        $usageReportingQueue = "sqlrpusagequeue"
        $usageReportingTable = "sqlrpusagetable"
        $errorReportingQueue = "sqlrpusageerrorqueue"
        $errorReportingTable = "sqlrpusageerrortable"<br /><br />            # Create Storage Account If Other than DevStorage
        $storageConnectionString = "UseDevelopmentStorage=true"<br /><br />
        $usageConnectionParams = @{
        Name = $usageConnectionId
        ResourceGroup = $usageConnectionRG
        ProviderNamespace = "Microsoft.Sql"
        ArmLocation = $location
        ProviderLocation = $location
        UsageStorageConnectionString = $storageConnectionString
        UsageReportingQueue = $usageReportingQueue
        UsageReportingTable = $usageReportingTable
        ErrorReportingQueue = $errorReportingQueue
        ErrorReportingTable = $errorReportingTable
        ApiVersion = "2015-06-01-preview"
        }<br /><br />            Add-AzureRmUsageConnection @usageConnectionParams

Required Parameters

-ArmLocation

This is the Location of the resource manager instance in the Azure Stack installation

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ErrorReportingQueue

Queue name for reporting the errors. Usage service would insert records in this queue for any errors during its collection process

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ErrorReportingTable

Table name for reporting the errors. Usage service would insert records in this queue for any errors during its collection process

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name of the usage connection

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ProviderLocation

Location of the resource provider for which the usage connection is being added

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ProviderNamespace

Namespace of the resource provider for which the usage connection is being added

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroup

Resource group name for the usage connection resource

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-UsageReportingQueue

Queue name where the added usage meta data is queued . Using this metadata, Usage service will read the data from reporting table for usage aggregation

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-UsageReportingTable

Table name where usage records are inserted

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-UsageStorageConnectionString

This specifies the storage connection string in which the resource provider usage records are inserted

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-InformationAction

Not SpecifiedThe following values are permitted for this object type.

Type:ActionPreference
Aliases:infa
Parameter Sets:SilentlyContinue, Stop, Continue, Inquire
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Not Specified

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PipelineVariable

Not Specified

Type:String
Aliases:pv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.AzureStack.Management.Models.UsageConnectionModel