Closed coreyperkins closed 6 years ago
Hi, yes the errors are quite bad. Need to fix that but if I look at your script the parameters Resource Group and SubscriptionId must be equal to the ones in the subscription. ResourceGroup is the name and Subscriptionid is the subscription guid. (you have "subid" in the example provided) Get-LogicAppTemplate -LogicApp $logicAppNamePrefix -ResourceGroup "rg" -SubscriptionId "subId" -Verbose | Out-File $logicAppTemplateOutFilePath
@MLogdberg I hacked subid in there, so as to not be passing my real one to the GitHub masses. :)
@coreyperkins ahh good you got that. Can you debug it?
@MLogdberg I can, though I am just getting familiar with the units tests. I have tweaked the AzureResourceIdGetSubscriptionTest test to use my sub and rg and it was successful. Which test should I hit for template gen?
Hi, that test is not ment for that purpose. I would still say that the problem is authentication (will add an pull request for adding better information) but are you having multiple tenants connected to the user? In the Azure Portal you can click on the top right part and see the tenants you have access to and the tenant name used with the script
Dead on, auth issue. Worked after we got our Azure AD setup correct. Thanks! And, I'll be glad to check out that PR if you need.
Hi,
I have created my own script to pull a list of logic apps from my subscription/rg and spit out the templates for each. I am running into the following error when I get to the Get-LogicAppTemplate call:
Get-LogicAppTemplate : Aggregation Exception thrown, One or more errors occurred., first Exception message is: Object reference not set to an instance of an object., for more information read the output file. At C:\Users\corey\source\repos\LogicAppUtils\ImportLogicAppsFromRG-UsingLogicAppTemplateCreator-cdp.ps1:18 char:2
Here is my script. Also, I have made sure that I am logged in and the subscription is available.
Import-Module C:\PathToCode\LogicAppTemplateCreator\LogicAppTemplate\bin\Debug\LogicAppTemplate.dll!
$logicAppNamePrefixes = @("logic-app-name") foreach ($logicAppNamePrefix in $logicAppNamePrefixes) { $logicAppTemplateOutFilePath = "C:\PathToTemplateFile\" + $logicAppNamePrefix + ".json" $logicAppParamsOutFilePath = "C:\PathToTemplateFile\" + $logicAppNamePrefix + ".parameters.json"
}
Thanks for any help!
Corey