This Microsoft Azure post will show how to deploy Azure resources with Logic Apps.
Table of contents
Azure Logic App is a cloud service that allows us to create workflows and automation tasks similar to Power Automate in Microsoft Azure.
The main difference between Logic Apps and Power Automate is that Power Automate is more for citizen developers, whereas Logic Apps is more for developers and engineers.
Logic Apps offer integrations with services outside of Microsoft 365 but also allow us to provision and deploy Azure Resources using the Azure Resource Manager REST API protocol.
Deploy Azure Resources With Logic Apps
In our case, we will create a workflow on Logic Apps that will create an Azure Key Vault every time a new record is added to a Metaverse table. The workflow will use a dynamic value from the table as the vault’s name.
Azure Rest API
Azure Logic Apps USS the Azure Resource Manager connector to access Azure REST API and manage resources using REST API. In our case, we are using the Azure Key Vault REST API.
Create a Logic App
In our example, we have the following workflow. The trigger is the creation of a row in a MetaVerse.
The important action is the Create or update a resource. To create a resource we need to add the following values.
- Subscription
- Resource group
- API Version (find it in Azure REST API)
- Location (resource)
- Properties – This is the most important part and contains the body of the API request (see JSON code below).
To create an Azure Key Vault, I’m using the following code in the Properties parameter.
{
"tenantId": "TENANTID",
"sku": {
"family": "A",
"name": "standard"
},
"accessPolicies": [
{
"tenantId": "TENANTID",
"objectId": "ObjectID of user",
"permissions": {
"keys": [
"encrypt",
"decrypt",
"wrapKey",
"unwrapKey",
"sign",
"verify",
"get",
"list",
"create",
"update",
"import",
"delete",
"backup",
"restore",
"recover",
"purge"
],
"secrets": [
"get",
"list",
"set",
"delete",
"backup",
"restore",
"recover",
"purge"
],
"certificates": [
"get",
"list",
"delete",
"create",
"import",
"update",
"managecontacts",
"getissuers",
"listissuers",
"setissuers",
"deleteissuers",
"manageissuers",
"recover",
"purge"
]
}
}
],
"enabledForDeployment": true,
"enabledForDiskEncryption": true,
"enabledForTemplateDeployment": true,
"publicNetworkAccess": "Enabled"
}
Once the Logic App is triggered, the workflow will create a new Azure Key Vault.
If your organisation needs help with Azure Logic Apps and automation workflow, please get in touch with us using the form below.
Trackbacks/Pingbacks