# Connecting to an Azure AD Stamp

## HOST VM OF THE STAMP TO BE CONFIGURED

On **AzS Development Kits**, sign in to the physical host.&#x20;

On **multi-node integrated systems**, the host must be a system that can access admin end point.

1. Place the RegisterBillingWithIdentitySystem.ps1 file in a temp folder.  This file can be found in the install folder of Host VM where Billing resource provider was installed: c:\CloudAssert\BillingRP\BillingApp\\
2. Open a new elevated (administrative) PowerShell console and change to the above directory. Use a new window to avoid problems that might arise from incorrect PowerShell modules that are already loaded on the system
3. Run the RegisterBillingWithIdentitySystem.ps1 script with appropriate parameters

```
.\RegisterBillingWithIdentitySystem.ps1 -ServiceAdminUser '' -AzureStackAdminResourceManagerEndpoint '' -AzureDirectoryTenantId '' -AzureEnvironment 'AzureCloud' -IdentitySystemType 'AzureAD' -adminSubscriptionId ''

Eg:
.\RegisterBillingWithIdentitySystem.ps1 -ServiceAdminUser 'msmtest@cloudassertrp.contoso.com' -AzureStackAdminResourceManagerEndpoint 'https://adminmanagement.local.contoso.com/' -AzureDirectoryTenantId 'eef3d6b3-cf97-42c1-9cc5-f68905cdd1a6' -AzureEnvironment 'AzureCloud' -IdentitySystemType 'AzureAD' -adminSubscriptionId 'a7f2bc5b-2287-4a8b-b256-dcb14dd06878'
```

| Parameter Name                                              | Description                                                                                                                                                                                                                                                                                      | Required   |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- |
| ServiceAdminUser                                            | <p></p><p>Go to Admin Portal -> Login as Service Admin -> Subscriptions -> Default Provider Subscription -> Check if role is <strong>Owner</strong> Eg: <admin@contosotest.onmicrosoft.com>. Ensure this user is assigned with <strong>Application Administrator</strong> role in Azure AD. </p> | *Required* |
| <p>AzureStackAdmin</p><p>ResourceManager</p><p>Endpoint</p> | Azure Stack ARM endpoint. Eg: "<https://adminmanagement.redmond.masi67.corp.contosotest.com/>"                                                                                                                                                                                                   | *Required* |
| <p>AzureDirectory</p><p>TenantId</p>                        | Azure Directory tenant Id                                                                                                                                                                                                                                                                        | *Required* |
| AzureEnvironment                                            | Cloud environment Eg: AzureCloud                                                                                                                                                                                                                                                                 | *Required* |
| IdentitySystemType                                          | Either "AzureAD" or "ADFS" depending on authentication mechanism used in the Azure Stack being added                                                                                                                                                                                             | *Required* |
| adminSubscriptionId                                         | Default Provider Administrator Subscription ID                                                                                                                                                                                                                                                   | *Required* |

&#x20;The script outputs **BillingRegistrationOutput.txt** in the same folder having all the information needed to add a new azure stack connection in Billing using the billing tool command. (*Refer:* [Connection with App Secret](/azure-stack-billing/installation/configuration/billing-tool-command.md#connection-with-app-secret))


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudassert.com/azure-stack-billing/features/multi-stamp-azure-stack-hub/connecting-to-an-azure-ad-stamp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
