In this article, I am going to register my Azure Stack installation with my Azure Subscription. This will allow me to download marketplace items from Azure to my Azure Stack.
Prerequisites
Before we are able to register our Azure Stack with our Azure subscription we need to gather a few bits of information. They are:
Azure Subscription ID
Username and Password of the Azure subscription owner
The Azure Active Directory Name of the Azure subscription
PowerShell For Azure Stack on Azure Stack host https://pixelrobots.co.uk/2017/07/install-the-azure-stack-powershell-module/
You can find all this information from inside the Azure Portal.
Register Azure Stack with Azure
Register Azure stack Resource
Open PowerShell with elevated permissions
Login-AzureRmAccount -EnvironmentName "AzureCloud" |
Enter your Azure subscription owners credentials in the Azure login box.
You have now logged on to Azure via PowerShell.
Now to register the Azure Stack Resource
Register-AzureRmResourceProvider -ProviderNamespace Microsoft.AzureStack |
Register Azure Stack with Azure
Connect to your Azure Stack Host and open PowerShell with Elevated permissions.
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Azure/AzureStack-Tools/master/Registration/RegisterWithAzure.ps1" -OutFile "C:\tools\RegisterWithAzure.ps1" |
Now we need to run the script we just downloaded using the following script. Making sure you use your subscription ID, your Directory (name of Azure Active Directory) and your Account Name (Subscription Owner)
c:\tools\RegisterWithAzure.ps1 -azureSubscriptionId YourID -azureDirectoryTenantName YourDirectory -azureAccountId YourAccountName |
You should have an Azure login box pop up. Logon with the Azure Subscription owners credentials.
During the registration, you will see a lot of yellow text. At one point it will ask you about data collection. You can either press y for yes or n for no.
You should see a message like in the below picture when registration has finished.
Login to the Azure Stack Admin Portal https://adminportal.local.azurestack.external and click Marketplace Management
Click Add from Azure
You should now see a list of items from Azure. If you do not see a list then your registration was not successful.
That’s it you have now registered Azure Stack with your Azure subscription.
Issues
When I was trying this for the first time I did come across an error.
The error suggested an issue with UsageBridgeHost To get around this I rebooted the host two times and it worked.
You can check the status of UsageBridgeHost by going to http://azs-xrp01:19017/Explorer/index.html#/apptype/UsageBridgeApplicationType/app/UsageBridgeHost on the Azure Stack host. Login with \AzureStackAdmin and the password you have set when installing.
If you are seeing this application in Error try rebooting the host first and then check again, remembering to give your Azure stack enough time to boot up fully. You could also just try rebooting the azs-xrp01 virtual machine.
If that does not fix it you will probably have to open a post on the Azure Stack Forum https://social.msdn.microsoft.com/Forums/azure/en-US/home?forum=AzureStack
I hope you found this article helpful, if you have any questions please leave a comment.
0 Comments