diff --git a/Syndication/AzureStack.MarketplaceSyndication.psm1 b/Syndication/AzureStack.MarketplaceSyndication.psm1 index 4ceed291..fc9efd74 100644 --- a/Syndication/AzureStack.MarketplaceSyndication.psm1 +++ b/Syndication/AzureStack.MarketplaceSyndication.psm1 @@ -505,7 +505,8 @@ function DownloadMarketplaceProduct { if ($PremiumDownload) { & 'C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe' /Source:$Source /Dest:$tmpDestination /Y /CheckMD5 } else { - (New-Object System.Net.WebClient).DownloadFile("$Source",$tmpDestination) + $wc = New-Object System.Net.WebClient + $wc.DownloadFile($Source, $tmpDestination) } $completed = $true @@ -691,15 +692,14 @@ function Import-ByDependency function Test-AzSOfflineMarketplaceItem { param ( [parameter(mandatory = $true)] - [String] $Destination - ) + [String] $Destination, - Import-Module C:\CloudDeployment\ECEngine\EnterpriseCloudEngine.psd1 -ErrorAction Stop - $engine = New-Object CloudEngine.Engine.DefaultECEngine - $roles = $engine.GetRolesPublicInfo() - $WASRoleDefinition = $roles["WAS"].PublicConfiguration - $armEndpoint = (($WASRoleDefinition.PublicInfo.Endpoints.Endpoint | Where Name -EQ "ResourceManager").Address).Trim('/') - $defaultProviderSubscription = Get-AzureRmSubscription -SubscriptionName 'Default Provider Subscription' | Select-AzureRmSubscription + [parameter(mandatory = $true)] + [String] $ArmEndpoint, + + [parameter(mandatory = $true)] + [String] $SubscriptionId + ) $ctx = Get-AzureRmContext $AccessToken = Resolve-AccessToken -Context $ctx -AccessToken $AccessToken @@ -709,8 +709,8 @@ function Test-AzSOfflineMarketplaceItem { foreach($product in $dirs) { $syndicateUri = [string]::Format("{0}/subscriptions/{1}/resourceGroups/azurestack-activation/providers/Microsoft.AzureBridge.Admin/activations/default/downloadedProducts/{2}?api-version=2016-01-01", - $armEndpoint, - $defaultProviderSubscription.subscription.id, + $ArmEndpoint, + $SubscriptionId, $product ) diff --git a/Syndication/readme.md b/Syndication/readme.md index 1eb5405e..603c2a25 100644 --- a/Syndication/readme.md +++ b/Syndication/readme.md @@ -38,7 +38,7 @@ Get-AzureRmSubscription -SubscriptionID '' | Selec Import the module and start the export process for an Azure Marketplace item ```powershell Import-Module .\AzureStack.MarketplaceSyndication.psm1 -Export-AzSOfflineMarketplaceItem -destination "Destination folder path" +Export-AzSOfflineMarketplaceItem -destination "[Destination folder path]" ``` You will be prompted to select an Azure Marketplace item to download locally. @@ -48,22 +48,23 @@ After download completion, the item will be available in the folder specified in ## Validating the downloaded Azure Marketplace item -The following command will run a set of test against a downloaded Azure Marketplace item. It is highly recommended to validate the download before proceeding to the next steps +Configure Azure Stack Operator’s PowerShell session. More information can be found here https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-powershell-configure-admin +The following command will run a set of test against a downloaded Azure Marketplace item. It is highly recommended to validate the download before proceeding to the next steps. ```powershell -Test-AzSOfflineMarketplaceItem -Destination "marketplace content folder" +Test-AzSOfflineMarketplaceItem -Destination "[marketplace content folder]" -Armendpoint "[Environment Arm Endpoint]" -SubscriptionId "[Default Provider Subscription Id]" ``` ## Importing the downloaded Azure Marketplace item to your Azure Stack Marketplace The previous downloaded files will need to be made available to your Azure Stack environment. The following structure showcase how the folder structure and files should look like ![](downloadedfiles.png) -Configure Azure Stack Operator’s PowerShell session. More information cannot be found here https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-powershell-configure-admin +Configure Azure Stack Operator’s PowerShell session. More information can be found here https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-powershell-configure-admin Import the module and start the import process for an Azure Marketplace item ```powershell Import-Module .\AzureStack.MarketplaceSyndication.psm1 $credential = Get-Credential -Message "Enter the azure stack operator credential" -Import-AzSOfflineMarketplaceItem -origin “marketplace content folder" -armendpoint "Environment Arm Endpoint" -AzsCredential $credential +Import-AzSOfflineMarketplaceItem -origin “[marketplace content folder]" -armendpoint "[Environment Arm Endpoint]" -AzsCredential $credential ``` Option -Origin needs to be the top level folder contains all the downloaded products. In the example above, Origin should be "D:\downloadfolder".