jeffhollan / LogicAppTemplateCreator

Script to convert Logic Apps into templates for deployment
MIT License
143 stars 74 forks source link

Error when calling Get-LogicAppTemplate #31

Closed am071092 closed 6 years ago

am071092 commented 6 years ago

Get the following error:

Get-LogicAppTemplate : Aggregation Exception thrown, One or more errors occurred., first Exception message is: Cannot access child value on Newtonsoft.Json.Linq.JValue., for more information read the out At line:1 char:1

MLogdberg commented 6 years ago

Hi, could you provide abit more information? Like what connectors are you using? Seems like an error du e to a null value.

If you can add the -DebugOutPutFolder path to get the exported files, you can either debugg it or email the files so I can check it.

bkarthika commented 6 years ago

Hi, I am getting object reference error. I am trying to generate template of a logic app thats using custom connector. Get-LogicAppTemplate -LogicApp -...........................

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 line:1 char:1

bkarthika commented 6 years ago

"If you can add the -DebugOutPutFolder path to get the exported files, you can either debugg it or email the files so I can check it."

How to do this?

MLogdberg commented 6 years ago

Here is a sample from my PS script: Get-LogicAppTemplate -LogicApp $logicapname -ResourceGroup $resourcegroupname -SubscriptionId $subscriptionid -TenantName $tenant -DebugOutPutFolder "C:\temp\Logicapps" | Out-File $filenname

MLogdberg commented 6 years ago

if you have problem with execution policy execute this in a administrator runned powershell window.

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

Import-Module "C:\Users\Administrator\Desktop\PS Logic Apps\TemplateCreator\LogicAppTemplateCreator\LogicAppTemplate\bin\Debug\LogicAppTemplate.dll"

Set the name of the Logic App

$logicapname = 'INT001-MyLogicapp'

Set the resource group of the Logic App

$resourcegroupname = 'Integration'

Set the subscription id of where the Logic App is

$subscriptionid = 'd4ba21e9-15f5-4c85-bb3e-1e108dc79b00'

Set the tenant to use with the Logic App, make sure it has the right tennant

$tenant = 'ibiz-solutions.se'

setting the output filename

$filenname = $logicapname + '.json' $filennameparam = $logicapname + '.parameters.json'

Get-LogicAppTemplate -LogicApp $logicapname -ResourceGroup $resourcegroupname -SubscriptionId $subscriptionid -TenantName $tenant -DebugOutPutFolder "C:\temp\Logicapps" | Out-File $filenname

MLogdberg commented 6 years ago

Also the problem might be as many others that you have not specifying the tenant and your account is connected to multiple tenants and the standard sign in is not the tenant where your Logic App is hosted.

bkarthika commented 6 years ago

Even after setting Tenant as in above script I am getting the same error. I am getting this error only when custom connector is used.

Get-LogicAppTemplate -LogicApp $logicapname -ResourceGroup $resourcegroupname -SubscriptionId $subscriptionid -TenantName $tenant -DebugOutPutFolder "C:\Templates\Newfolder" | Out-File $filenname 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 line:19 char:1

MLogdberg commented 6 years ago

Okey, so wthen it might be something with the custom Connector, I'll check that out.

am071092 commented 6 years ago

Yup I was using a custom connector - Http with AAD. I'l generate the debug file and post it here.

KarthikaSamidurai commented 6 years ago

Any updates?

MLogdberg commented 6 years ago

Sorry haven´t had the time yet, but I'll try checking it out later this week.

MLogdberg commented 6 years ago

Hi I think I've found the issue, could you try again?

KarthikaSamidurai commented 6 years ago

Ok. I will try and let you know.

From: Mattias Lögdberg notifications@github.com Sent: 13 June 2018 09:02 PM To: jeffhollan/LogicAppTemplateCreator LogicAppTemplateCreator@noreply.github.com Cc: Karthika Samidurai karthika.samidurai@impigertech.com; Comment comment@noreply.github.com Subject: Re: [jeffhollan/LogicAppTemplateCreator] Error when calling Get-LogicAppTemplate (#31)

Hi I think I've found the issue, could you try again?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jeffhollan/LogicAppTemplateCreator/issues/31#issuecomment-396981008, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgpRgMyTA9B3XFnYl9KU9_kONMljA7Liks5t8TBhgaJpZM4T-2Od.

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you receive this in error, please contact the sender and delete the material from any computer.

KarthikaSamidurai commented 6 years ago

Its working.. Thank you very much.

gethari commented 5 years ago

@MLogdberg @KarthikaSamidurai I am facing this today. Is this fixed or am i doing something wrong ? I am having my own custom connectors used in the LogicApp

mo20096258 commented 4 years ago

hi, is this issue is resolved??? I am also getting the same issue every time

KarthikaSamidurai commented 4 years ago

" Hi, I am getting object reference error. I am trying to generate template of a logic app thats using custom connector.

" -- yes this issue is fixed.

dgroh commented 3 years ago

when I pass $tenantName I get:

'authority' should be in Uri format

simonstender commented 2 years ago

@MLogdberg Hi! I seem to get similar errors when trying to extract logic apps multiple logic apps from a resource group. `Get-LogicAppTemplate : Aggregation Exception thrown, Ett eller flera fel har uppstått., first Exception message is: Objektreferensen har inte angetts till en instans av ett objekt., for more information read the output file. At P:\Program\LogicAppTemplateExtractor\LogicAppTemplate\Cmdlets\Get-RGLogicAppsTemplate.ps1:60 char:2

Get-ParameterTemplate : Error reading JObject from JsonReader. Path '', line 0, position 0. At P:\Program\LogicAppTemplateExtractor\LogicAppTemplate\Cmdlets\Get-RGLogicAppsTemplate.ps1:63 char:2

Only the logic apps using custom connectors are the ones causing an error, the logic apps that are not using CC are extracted without any problem.

You know what might cause this?

MLogdberg commented 2 years ago

Hi @simonstender sounds strange, I know that Custom Connectors are used i several places. But a nullpointer exception, something is expected here, let me take a short look.