As a final preparation step (following my previous post) in using the ASDK, we need to first register it. For that, an Azure subscription is required!
So… let’s do it.
First, we need to make sure we have the required Azure Stack PowerShell modules. It’s also convenient to make the PSGallery trusted repository for installation of the modules, if we need to install them. Then we can download all the tools we’ll need, and finally register our (connected) ASDK environment, using the following commands:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# make PSGallery a trusted repository Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted # check if modules are installed Get-Module -ListAvailable | Where-Object {$_.Name -like "Azure*"} # install the required Azure Stack modules Install-Module -Name AzureRm.Bootstrapper User-AzureRmProfile '2017-03-09-profile' -Force Install-Module -Name AzureStack -RequiredVersion 1.2.11 # check if modules are installed Get-Module -ListAvailable | Where-Object {$_.Name -like "Azure*"} # download the fresh copy of Azure Stack tools as well (if this fails, you can always download the file through your browser :)) cd \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Invoke-WebRequest https://github.com/Azure/AzureStack-Tools/archive/master.zip -Outfile master.zip Expand-Archive -Path .\master.zip -DestinationPath . # now we are ready for registering our ASDK cd AzureStack-Tools-master Import-Module .\Connect\AzureStack.Connect.psm1 Add-AzureRmAccount -Environment "AzureCloud" # enter your Azure credentials Get-AzureRmSubscription -SubscriptionId "your_azure_subscription_id" | Select-AzureRmSubscription Register-AzureRmResourceProvider -ProviderNamespace Microsoft.AzureStack Import-Module .\Registration\RegisterWithAzure.psm1 $CloudAdminCred = Get-Credential -UserName "AZURESTACK\CloudAdmin" -Message "Enter CloudAdmin passwor, please." # enter the Azure Stack's CloudAdmin password Set-AzsRegistration -PrivilegedEndpointCredential $CloudAdminCred -PrivilegedEndpoint "AzS-ERCS01.azurestack.local" -BillingMode Development |
You can find the whole procedure explained in more detail inside the official documentation, of course.
And… once registered – we can finally start using our ASDK!
As before – I’ve also prepared a short video about registering the ASDK:
Happy exploring!