# Multi-Stamp Azure Stack Hub

## How to add connection details for multiple Azure Stack Hub connections for Usage & Billing?

* Have the certificate installed and connections details for the target Azs Hub Platform. Details that would be needed (can be obtained from billing registration.txt):&#x20;
  * SubscriptionId&#x20;
  * ApplicationId&#x20;
  * AdminArmEndpointUrl
  * AuthorityEndpointUrl
  * TokenRequestResourceUrl
  * CertificateThumbprint
  * IsAdfs
  * TenantId&#x20;
* Execute the below command with appropriate details for each stamp,

```bash
Billing.exe CreateAzureStackConnection <adminSubscriptionId> <tenantId> <applicaionId> <certificateThumbprint> <adminArmEndpoint>
        <tokenRequestResourceUrl> <authorityEndpointUrl> [/applicationSecret:<String>] [/isAdfs]
        [/ApiEndpoint:<String>] [/Username:<String>] [/Password:<String>] [/IsSkipPrompts:<True|False>]
        [/ExportToCsv:<True|False>] [/ExportToFileName:<String>]
```

* Enable '"AzsHubUsageProcessorIsEnabled' in Cost Management agent config. Check the below link for more details,

{% content-ref url="broken-reference" %}
[Broken link](https://docs.cloudassert.com/azure-stack-billing/2012.5/others/broken-reference)
{% endcontent-ref %}

* Enable the AzsHubUsageRecordProcessor from Billing Agent service.
* Configure the \[dbo].\[SubscriptionMapper] with the UsageSource Id and external subscription Id (azs subscription id) column value.

**Validation:**

* Verify the Connection is added successfully in Config.Connections in Cost  Management database.
* Verify the AzsHubUsageRecordProcessingStatusData for the processing status, the data will be populated in the Raw usage records table.
