none
Breaking the designer in Visual Studio 2015 RRS feed

  • Question

  • Hi,

    I have been working with LogicApps inside Visual Studio 2015 for quite some time now. What bothers me is that the id of functions are absolute. 

    "id": "/subscriptions/aaaaa-aaaaaaaaa-aaaaaaa/resourcegroups/test1templatearm/

    providers/microsoft.web/sites/lafunctionapp/functions/transform"

    I do not like this since i want to be able to deploy this LogicApps to different subscriptions and/or has a different function app environment.

    So i made this id relative by using the following code:

    "id": "[concat('/subscriptions/',subscription().subscriptionId,'/resourcegroups/',resourceGroup().Name,

    '/providers/Microsoft.Web/sites/',parameters('LAfunctionApp'),'/functions/',parameters('functionName2'))]"

    However this breaks the designer of my LogicApps

    "The workflow run action 'LaConform' of type 'Function' has a malformed value '[concat('/subscriptions/',subscription().subscriptionId,'/resourcegroups/',resourceGroup().Name,'/providers/Microsoft.Web/sites/',parameters('LAfunctionApp'),'/functions/',parameters('functionName2'))]' for property 'function.id'. The expected format is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/functions/{functionName}'."

    But i am pretty sure my relative id is correct since it creates the logic app when deploying it to azure.

    Has anyone an explanation or workaround for this or knows a better way to make the IDs not absolute? 

    -F

    Thursday, December 22, 2016 8:32 AM

Answers

  • I asked this same question on one of the Microsoft Blogs (page seems to have been deleted now) a month back and was told that the visual studio designer did not support it, but that the functionality would be implemented shortly. That was a month ago, and nothing yet. They did a new release recently, but still nothing. 

    I would hope this is going to be done soon, it rather spoils the visual studio integration if you want to go between tenancies.

    • Marked as answer by FlorianDLW Friday, December 23, 2016 7:46 AM
    Thursday, December 22, 2016 5:15 PM
  • Hi all,

    The latest release of the Visual Studio tools for Logic Apps (v2.2.0) does fix the designer. It now properly loads my LogicApp again while having relative ids. 

    @Wagner for me it worked on the latest live version.

    • Marked as answer by FlorianDLW Monday, January 9, 2017 9:21 AM
    Monday, January 9, 2017 9:21 AM

All replies

  • Hi Florian,

    I think this is a design flaw of Visual Studio Logic App extension. From one side it is based on ARM, so what you are doing is correct, but on the other, it needs to support the visual designer, which is actually executing the code like it was sitting in Azure, so it needs  subscription and sometimes resource group to guarantee that you can access things like API Connections, Azure Function containers, etc.

    At this stage I've been using the online designer for actual development and debugging (I use one subscription for dev/test and another for production, to avoid any conflicts/clashes). I use the ARM project as the unit of deployment and to guarantee that changes are kept in source control.

    In my first project I was using a monolithical approach, but I'm moving to having nested ARM templates, which gives you more granularity when deploying and making changes.

    Doing that, and using the export functions of Resource groups, I could get a good compromise of getting the logic apps parameterized (the export do a good job of abstracting most of the items, and some of the others you find that you need to do it anyway).

    I know it is not the answer that you were expecting, but I hope this helps. :-)

    Cheers, Wagner.

    Thursday, December 22, 2016 9:34 AM
  • Hi Wagner,

    You made some good points and it is interesting to see your approach for developing LogicApps. 

    However i'm not really understanding the nested ARM templates part. If i understand you correctly you have an environment called Development.

    In this enviroment you develop a LogicApp in the Visual Studio Extension so you have source control and deployment to the dev environment. Where does these ARM templates come into play? 

    For moving a finished LogicApp from dev to production you use the move button inside the portal i assume.

    -F

    Thursday, December 22, 2016 10:13 AM
  • I asked this same question on one of the Microsoft Blogs (page seems to have been deleted now) a month back and was told that the visual studio designer did not support it, but that the functionality would be implemented shortly. That was a month ago, and nothing yet. They did a new release recently, but still nothing. 

    I would hope this is going to be done soon, it rather spoils the visual studio integration if you want to go between tenancies.

    • Marked as answer by FlorianDLW Friday, December 23, 2016 7:46 AM
    Thursday, December 22, 2016 5:15 PM
  • Hi Florian,

    So my workflow today (no pun intended), is this:

    On my development subscription:

    - Create and test logic apps and other artefacts (servicebus, functions, etc).

    - Once my logic apps are ready for deployment, I export them using the Export function on the resource group. The problem is this exports the whole lot instead of an individual logic app.

    In the past I was using this template to be the basis of my ARM project - what I found out is that if I do this and need to deploy a patch, I will still deploy the whole set, which I don't like. Exactly because you might need to do manual tweaks to make sure that you parameterize everything, from a risk perspective I don't want to deploy the whole set of logic apps, when I've just made changes in one.

    Because of that, I'm using nested templates. Basically a template for each logic app (similar to what the Visual Studio gives you). So I can compare, or overwrite changes in one specific logic app. The ARM Project (with multiple logic apps ARM templates, and potentially other templates for servicebus, functions etc) is source controlled, so I can always come back to a specific version of a given logic app or artefact.

    I agree with James, that this is not ideal at all - in some cases I spend more time in the packaging (the ARM template) than actually making the changes.

    I try to minimize this using logic apps parameters for almost everything I can. So when I need to apply ARM parameters or variables it is usually in a single area of the logic app.

    I hope this helps you on a "development strategy".

    Cheers, Wagner.

    Thursday, December 22, 2016 8:13 PM
  • With the latest release of the Visual Studio tools for Logic Apps (v2.2.0) we now support templatization inside a Logic App definition for child workflows, Azure Functions and API Management APIs.  This enables the usage of concat(), resourceid(), and parameters() constructs.  Note that for parameters() we look for 'default value' that's used at design time.

    Regards,
    Kevin

    Saturday, January 7, 2017 2:44 AM
    Owner
  • Kevin,

    That is awesome. Is this the latest live version?

    Cheers, Wagner.

    Saturday, January 7, 2017 11:11 AM
  • Great to hear! 
    Monday, January 9, 2017 7:52 AM
  • Hi all,

    The latest release of the Visual Studio tools for Logic Apps (v2.2.0) does fix the designer. It now properly loads my LogicApp again while having relative ids. 

    @Wagner for me it worked on the latest live version.

    • Marked as answer by FlorianDLW Monday, January 9, 2017 9:21 AM
    Monday, January 9, 2017 9:21 AM
  • I do have have latest release 2.2, and the problem is still there, just with the different error message. For my logic apps I have to parameter SharePoint urls, service bus topic names, function regions, SharePoint list ids - quite a few things, so this issue is really big inconvenience.

    Friday, January 13, 2017 8:27 PM
  • Hi fly2,

    What is the error you are getting? Maybe I had the same one. 

    -F

    Monday, January 16, 2017 7:59 AM
  • Hi FlorianDLW, here is what I am getting:


    • Edited by fly2 Wednesday, January 18, 2017 12:24 AM
    Wednesday, January 18, 2017 12:23 AM
  • I did the exact same thing you did (aka, I tried to respond to the error message in the syntax sugar they wanted.......with parameters.

    "id": "/subscriptions/subscription().id/resourceGroups/resourceGroup().Name/providers/Microsoft.Web/sites/parameters('MyAzureFunctionPublishNameArmParameter')/functions/HardCodedFunctionNameHere"

    I also had this deploying-working.......

    "id": "[resourceId('Microsoft.Web/sites/functions', parameters('MyAzureFunctionPublishNameArmParameter'), 'HardCodedFunctionNameHere')]"

    (which was alot shorter/clean IMHO), but I still get the designer error. :(

    If you found this post becuase you're trying to the same thing, please VOTE for this issue:

    https://feedback.azure.com/forums/287593-logic-apps/suggestions/18954139-please-make-the-la-tools-for-vs-support-parameteri

    FYI, Its October 2017 and I'm using latest VS 2017 Preview 2.

    Wednesday, October 25, 2017 8:21 PM
  • Hi

    The format you said worked for deployment is supported in VS tools.

    "id": "[resourceId('Microsoft.Web/sites/functions', parameters('MyAzureFunctionPublishNameArmParameter'), 'HardCodedFunctionNameHere')]"

    Is the default value provided fro MyAzureFunctionPublishNameArmParameter ?

    Wednesday, November 15, 2017 7:50 PM