XpiritBV / Xpirit-Vsts-Release-Settings

5 stars 8 forks source link

Task failing with PS syntax error #6

Closed hambroz closed 7 years ago

hambroz commented 7 years ago

Hi Pascal,

I was trying to set up your extension today and was not successful in the end. When the task runs (either on our build agent or on the Hosted one), it always fails with this message:

[command]Import-Module -Name C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.Profile\AzureRM.Profile.psd1 -Global

[command]Add-AzureRMAccount -ServicePrincipal -Tenant **** -Credential System.Management.Automation.PSCredential

[command]Select-AzureRMSubscription -SubscriptionId **** -TenantId ****

##[error]Exception calling "AddRange" with "1" argument(s): "Value cannot be null. Parameter name: collection"

[section]Finishing: Apply variables to website: ****

Please could you check whether it could be caused by a VSTS/PS/Azure SDK change?

Thanks for letting me know,

Jan

parcae commented 7 years ago

I have the exact same issue. The task works on 1 other (older) release definition in our Azure environment. But we now have a new Release definition for another project and duplicated the first release definition, all variables etc. are there, but I get the exact same error as @hambroz has...

pascalnaber commented 7 years ago

I will investigate the issue and keep you posted

parcae commented 7 years ago

@hambroz @pascalnaber when enabling the checkbox "Overwrite existing configuration" the task seems to complete without errors. However, I can not check the result due to issues with our Kudu interface....

hambroz commented 7 years ago

Sadly, for me that is also not an option, as we deploy Azure Functions and overwriting all the configuration would most probably crash the application (to be honest, I don't want to even try this).

pascalnaber commented 7 years ago

I've tested it and it indeed has to do with the "Overwrite existing configuration". What I've found till now is that only when the webapp in Azure has never contained any appsetting or connectionstring and the checkbox is unchecked, it fails. I will fix it tonight. To continue for now is or adding a temporary appsetting and connectionstring and delete again. Or enable "Overwrite existing configuration".

pascalnaber commented 7 years ago

I've just uploaded a update of the task. Version 1.1.1 should fix this. Please let me know if this solves the problem for you. Thank you for your patience.

hambroz commented 7 years ago

Thank you, @pascalnaber ! Will look into it ASAP and let you know!

hambroz commented 7 years ago

I can confirm that the issue is fixed for me! Thank you again, @pascalnaber !