Azure Azure Stack Powershell

Adventures of a Cloud Operator: Registering Azure Stack as CSP

So, if you’ve found your way here you have got yourself an Azure Stack Integrated System and need to register it as a Cloud Solution Provider (CSP).

Before we registered we needed to identify the type of subscription we want to use. The choice is a CSP or APSS subscription.

This deployment is being registered directly to my company as the CSP reseller so a CSP subscription was the preferred choice.

We won’t go through the detail of creating the Azure CSP subscription here because if you’re at this point, you probably already know how to create a CSP subscription or have someone available to you who can…

 

More on CSP subscriptions can be found here:
https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-add-manage-billing-as-a-csp#create-a-csp-or-apss-subscription

 

We’ve identified our subscription ID to use and have all the necessary access.

 

Next is the registration process. This needs to be executed from a PS session on the Privileged Endpoint.

The steps to complete this are found on the docs link below:
https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-registration

This process is accurate for Azure Stack 1808.

For this MAS system we did this on the DVM before it was nuked, so some of the images are from the video recording to show you I’m not making this up 😉

Set your Privileged Endpoint IP – I got this from the deployment info

$PrivIP = "10.61.11.224"

Enter a remote PS session to the ERCS (any of the 3 is fine)

$cloudAdminCredential = Get-Credential -UserName "azurestack\CloudAdmin" `
    -Message "Enter the CloudAdmin credentials"
Enter-PSSession –ComputerName $PrivIP `
    -ConfigurationName PrivilegedEndpoint `
    -Credential $cloudAdminCredential

Get the Stamp info to identify the CloudID

get-azurestackstampinformation

image

The CloudID is at the end. Copy the CloudID value as you’ll need this a little later

Add-AzureRmAccount -EnvironmentName "AzureCloud"

First attempt I received an error: “Add-AzureRmAccount : Object reference not set to an instance of an object”

… After scratching my head in a clueless state for 30 seconds I decided to check the account has the correct access.

Whilst the account is a GA on the tenant, the account had no permissions to any subscriptions… Whilst that’d be slightly problematic, it’s easily fixed.

#UserError

Tried again and full steam ahead 🙂

image

 

Select the subscription.

Get-AzureRmSubscription –SubscriptionID <inserted our Subscription ID here> | Select-AzureRmSubscription

image

(excuse all the bleeps Smile )

Register-AzureRmResourceProvider -ProviderNamespace Microsoft.AzureStack

image

The below is a little confusing for me, I need to ask the PG why we need to run the Add-AzureRMAccount again, but for completeness I do anyway…

#The docs is missing the 'registration' subfolder
Import-Module .\Registration\RegisterWithAzure.psm1
Add-AzureRmAccount -Environment "AzureCloud"

Last step so check you’ve got the right subscription etc…

$CloudAdminCred = Get-Credential -UserName "azurestack\CloudAdmin" -Message "Enter the cloud domain credentials to access the privileged endpoint."
$RegistrationName = <paste the CloudID here>

# Kick off the registration process
Set-AzsRegistration `
    -PrivilegedEndpointCredential $cloudAdminCred `
    -PrivilegedEndpoint "10.61.11.224" `
    -BillingModel PayAsYouUse `
    -RegistrationName $RegistrationName

 

image

While that’s happening, take a look in app registrations in AAD and you should find something similar to the below.

 

 

After about 10 mins we hit success!

clip_image001

 

Congratulations – your Azure Stack is registered and all the real fun can begin!

Next I’m off to start getting the marketplace populated, enabling multi-tenancy and getting some plans and offers built.

Happy Stacking
Dan

Leave a Reply