Free Trial Book a Demo
Logic App naming convention

Logic App Best practices, Tips, and Tricks: #11 Connectors naming convention

Categories: Azure Serverless Tags:

Welcome again to another Logic App Best practices, Tips, and Tricks. In my previous blog posts, I talked about some of the most essential best practices you should have while working with the Azure Logic App:

And some tips and tricks:

Today I will talk about naming convention because I think this is so critical to implement from day one, and people tend to forget. We earlier addressed the importance of providing a good naming convention to your Logic App name and actions inside your business process. Today we will speak about the Connectors (or API Connections) naming convention.

#11 Connectors naming convention

So, why is it essential to implement a good naming convention in our connectors (or API Connections)? 

Connectors naming convention

Almost for the same reasons we describe in the previous Best practices, Tips, and Tricks naming conventions:

  • It improves readability.
    • By setting a proper name in your API Connections, you can quickly identify what connector is intended for and what it is doing without needing to enter inside its properties to figure it out. So, you provide readability and save future time (not spending time looking at the details and configurations inside your API Connections) and frustrations. You may think that this is not important. You have created the flow, you provide a proper display name to your API Connection, and you can easily identify them inside your Logic App. But the reality is that behind the scenes, the name of the API Connections is not the display name you provide in individual connectors inside the Logic App. In fact, they will be called:
      • sql, sql-1, sql-2, sql-3
      • servicebus, servicebus-1, servicebus-3
      • and so, on

which makes it difficult to identify them on the Azure Portal.

  • It also transfers knowledge between your team or organization.
    • Sometimes Logic Apps are shared by different teams, developers, o departments, or you are a consultant creating LA for your clients. They also need to be aware of them. They also need to understand them. You may leave the project or the company in the future, and they will need to continue the work or make future changes. A proper naming convention and a good descriptive name automatically document your processes.

But providing a good naming convention to your API Connections also provides an additional good reason:

  • Better governance.
    • The team monitoring your integration solutions and/ or azure infrastructure needs to be aware of what API connections the processes are using and be able to identify them if problems appear quickly. If an API Connections start to have a problem, or you need to change a particular configuration, having API connections names like:
      • sql, sql-1, sql-2, sql-3
      • or servicebus, servicebus-1, servicebus-3
    • It will not help them identify where they need to make the changes quickly. They probably need to go inside the Logic Apps to try to identify them or go inside each API Connection to be able to identify them. This can be a hugely time-consuming task. It will be way better to have something like:
      • CN-ServiceBus-<queue-name>
      • or CN-SQL-<database-name>

Unfortunately, suppose we are creating our Logic App through the Azure Portal. In that case, we cannot implement a good API Connection naming convention from scratch because the Logic App designer doesn’t allow us to define the name of the API Connections. 

  • Some API Connections like the Outlook connector ask us to provide an account, and it will use that account as the display name, but the name will be office365 by default
  • logic app naming convention

  • Others allow us to define the Display name like the Key Vault connector, but once again, the name will be a keyvault
  • Key Vault connector

But the reality is that we can apply a good naming connection to our API Connections, but that will give you additional manual work. To accomplish that, we need to:

  • From the Azure Portal, go to your API connection
  • Inside the API Connection page, from the left menu, select the option Export template in the Automation section and click Download.
  • API Connection page

  • This will download an ExportedTemplate-<name>.zip to your laptop. Unzip the file and open the template.json file in a text editor like notepad++ or Visual Code.
  • Once you open the file, you need to change the following parameters:
    • parameters > connections_servicebus_name > defaultValue to the desired name; for example: instead of servicebus2, you can define it as CN-SERVICEBUS-<QUEUENAME> or CN-SQL-<databasename> instead of sql-1
    • resources > properties > displayName to the desired name; for example, instead of servicebus2, you can define it as CN-SERVICEBUS-<QUEUENAME> or CN-SQL-<databasename> instead of sql-1
    • logic app naming convention

  • Save the changes.
  • Going back to the Azure Portal, we need to create a new resource called Template deployment
  • Template deployment

  • On the Custom deployment page, select the option Build your template in the editor
  • Custom deployment

  • On the Edit template, select Load file, select the file you just edited and then click Save.
  • Edit template

  • Select the Subscription, Resource group, and Region on the Custom deployment pageLeave the default Connections_servicebus_name and then click the Review + create button.
  • logic app naming convention

  • And if the Validation pass successfully, click on Create.

After this, if you go back to your Resource group, you will see that your API Connections will start to have a proper naming convention: 

Create

Unfortunately, for this to work, you then need to:

  • Go back to your API Connection we create and fix the API Connection properties; for example, provide the Connection String to your Service Bus connector
  • Edit API Connection

  • And go back to your Logic Apps and change the API Connection to the one we manually created; for example, use the CN-KeyVault-POC instead of keyvault
  • Select connection

We then can delete the keyvault API Connection from our resource group to avoid our resource being full of trash. Of course, if we are developing from Visual Studio, this will be a different and easier story, but we will be leaving that to another post. So, stay tuned for the following Logic App Best practices, Tips, and Tricks.

Sandro Pereira

Jun 24, 2022

WHITEPAPPER

Logic App CI/CD from zero to hero

Download