Azure / Commercial-Marketplace-SaaS-Accelerator

A reference example with sample code for developers interested publishing transactable, Software as a-Service offers in the Microsoft commercial marketplace.
MIT License
191 stars 289 forks source link

Encountering difficulties while attempting to upgrade the SaaS Accelerator #736

Open wns-rohanraj opened 2 months ago

wns-rohanraj commented 2 months ago

The issue we are facing is regarding the SaaS Accelerator Upgradation, we have deployed SaaS Accelerator provided by Microsoft itself for the functionalities of Landing Page, Admin Site as well as SaaS Webhook for our SaaS Offer. Now, our offer is published, and we were trying to update the Landing Page of the SaaS Accelerator and redeploying it with the modifications we required, following the tutorial provided by Microsoft for the Accelerator Upgradation. I am providing you the link for that video tutorial also which demonstrate the procedure of how we can modify the Accelerator as well as redeploy it over Azure: https://youtu.be/H8p9n1bVTjY?si=A-yflxoYYWv-FO0Z

The issue arrives when we are looking for redeployment post modifications, this is the upgradations script that we need to follow to redeploy the accelerator as provided by Microsoft itself for Accelerator Updation:

git clone https://github.com/Azure/Commercial-Marketplace-SaaS-Accelerator.git -b --depth 1; cd ./Commercial-Marketplace-SaaS-Accelerator/deployment; .\Upgrade.ps1 -WebAppNamePrefix "marketplace-SOME-UNIQUE-STRING" -ResourceGroupForDeployment "marketplace-SOME-UNIQUE-STRING"

Now, the issue occurs when we run this script over Azure PowerShell for redeploying the Accelerator, the error that we are encountering is:

Deploying new database

ERROR: <urllib3.connection.HTTPSConnection object at 0x7f8b0bc9f9d0>: Failed to establish a new connection: [Errno -2] Name or service not known Upgrade.ps1: Cannot bind argument to parameter 'Source' because it is an empty string.

We reviewed the Upgrade.ps1 script and identified that it expects WebAppNamePrefix and ResourceGroupForDeployment parameters but encounters issues with Source value handling. Our Azure PowerShell environment is configured correctly, and we have necessary permissions for deployment.

### We went through the code of Upgrade.ps1 file, they are expecting WebAppNamePrefix, ResourceGroupForDeployment some source value with start and end index here’s the code: Param(
[string][Parameter(Mandatory)]$WebAppNamePrefix, # Prefix used for creating web applications [string][Parameter(Mandatory)]$ResourceGroupForDeployment # Name of the resource group to deploy the resources )

Function String-Between { [CmdletBinding()] Param( [Parameter(Mandatory=$true)][String]$Source, [Parameter(Mandatory=$true)][String]$Start, [Parameter(Mandatory=$true)][String]$End ) $sIndex = $Source.indexOf($Start) + $Start.length $eIndex = $Source.indexOf($End, $sIndex) return $Source.Substring($sIndex, $eIndex-$sIndex) }

Can we get some information regarding this source parameter, like what value is expected here and from where we can fetch it for resolving this issue.

neelavarshad commented 2 months ago

@wns-rohanraj The above is a function that gets called at various times during the script run to split a string to get specific values. You don't need to provide the source parameter in this case. Concerning your upgrade script breaking, we do not at the moment have an upgrade script for certain versions of the accelerator, specifically if your current deployment uses vnet. If so, please redeploy with version 7.6.2 (not with the upgrade script, but as a standalone deployment) and you can simply republish your offer with the latest technical configurations.