Logo

dev-resources.site

for different kinds of informations.

Parameterising Logic App (Standard) connections.json with bicep - Part 3

Published at
5/3/2022
Categories
azure
bicep
logicapps
Author
leonards
Categories
3 categories in total
azure
open
bicep
open
logicapps
open
Author
8 person written this
leonards
open
Parameterising Logic App (Standard) connections.json with bicep - Part 3

In my previous 2 posts here and here, I briefly showed how we can create the bicep snippet to create API connection resources and subsequently use that to parameterise our Logic App's connections.json. However, I've come to realise that I've missed out one configuration: API access policy. ๐Ÿ˜จ

The API access policy dictates the object (in my case it's the Logic App) that can access the API connection. In this post, I'm covering this additional configuration as well as an observation on the behaviour of bicep.

Creating the API access policy is simple. We've to create Microsoft.Web/connections/accessPolicies, and add the bind our Logic App to this new access policy.

The snippet below creates the API access policy resource given that we've retrieved the particular Logic App resource that we want to allow access to.

resource apiAccessPolicy 'Microsoft.Web/connections/accessPolicies@2016-06-01' = {
  name: '${logicApp.name}-${guid(resourceGroup().name)}'
  location: location
  parent: serviceBusConnApiConnection
  properties: {
    principal: {
      type: 'ActiveDirectory'
      identity: {
        tenantId: subscription().tenantId
        objectId: reference(logicApp.id, logicApp.apiVersion, 'Full').identity.principalId
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

And that's it. The only peculiar behaviour that I've seen is the naming of this resource. For a service bus API access policy, we need to name it with the prefix of the service bus connection name as in the above snippet. However, that is not the case for azure blob.

For azure blob, using the naming structure above will give us an error ~~Expected resource name to not contain any "/" characters. Child resources with a parent resource reference (via the parent property or via nesting) must not contain a fully-qualified name.bicep(BCP170). ~~Turns out we can just name it without the prefix of the API connection's name ๐Ÿ™„, i.e. it's simply

name: '${logicApp.name}-${guid(resourceGroup().name)}'

I'm still trying to understand the reason for this, but well, it is what it is ๐Ÿ˜„

UPDATE: Turns out I missed out the parent keyword which indicates what's the connection resource for the access policy ๐Ÿ˜„. Once the parent is specified, we can name the access policy without the prefix.

logicapps Article's
30 articles in total
Favicon
TOP 5 Brain-Boosting Logic Games for Your Phone
Favicon
Security-First Architecture in Azure Logic Apps: Patterns, Practices, and Compliance
Favicon
Serverless Integration: Automate Your Workflow with Logic App
Favicon
Usando PAM no Linux
Favicon
Understanding the Differences between Overriding and Overloading in C#
Favicon
Add Parameters for Workflow Input in Azure Logic Apps
Favicon
AmP Credit Loan Cust0mer CareยฎHelpline Number-8102301568-@7061107023All problem Solhcf.
Favicon
Dynamically Parse JSON as Object or Array
Favicon
Updates to the Azure Onboarding App
Favicon
Automated Onboarding Azure Project
Favicon
Azure Logic Apps: Orchestrating Workflows with Zero Code Complexity" ๐ŸŒ๐Ÿ”ง[5/8]
Favicon
Azure Automated Onboarding Project
Favicon
Real-World Use Cases and Examples of Azure Logic Apps in Action
Favicon
Automate document processing with Form Recognizer and Logic Apps (Part 2)
Favicon
Automate document processing with Form Recognizer and Logic Apps (Part 1)
Favicon
Configuring Azure Logic App Failure Alerts To Stay Ahead
Favicon
Disabling Highly Privileged Azure AD Users with Azure Logic Apps and Microsoft Graph API
Favicon
Power Automate vs Azure Logic Apps
Favicon
How to edit a JSON object inside an Azure Logic App
Favicon
How to solve a DSA problem
Favicon
Using Logic Apps in Power Automate
Favicon
Quickly provision Logic App environment to start developing the flow
Favicon
Why you probably shouldn't use Logic Apps for enterprise integrations
Favicon
f-of-xstate: run some logic on your logic
Favicon
No-code Automation for Azure Boards Using Azure Logic Apps, Power Automate, and Power Virtual Agents
Favicon
Deploy Azure Logic Apps as code
Favicon
For loop with liquid template in Azure LogicApp
Favicon
Liquid template in Logic App
Favicon
Get Logic App Workflow using REST API (Postman)
Favicon
Parameterising Logic App (Standard) connections.json with bicep - Part 3

Featured ones: