Azure Logic Apps - ARM template to deploy filesystem API connection - azure-logic-apps

I am trying to deploy file system API connection using ARM template.
I could not find the parametersValue schema for this connection and so tried with naming the parameters as they appear on Azure portal
Edit API Connection Screen shot on Azure Portal1
{
"apiVersion": "2016-06-01",
"name": "filesystem",
"type": "Microsoft.Web/connections",
"location": "[resourceGroup().location]",
"properties": {
"api": {
"id": "[concat(subscription().id,'/providers/Microsoft.Web/locations/westus/managedApis/filesystem')]"
},
"parameterValues": {
"displayName": "FileSyetem",
"rootFolder": "[parameters('rootFolder')]",
"authenticationType": "Windows",
"username": "[parameters('username')]",
"password": "[parameters('password')]"
}
}
However deployment is failing due to wrong parameterValue names displayName and authenticationType
Below is error in the deployment log - Bad Request
Input parameters are invalid. See details for more information.
Details:errorCode: ParameterNotDefined. Message: Parameter
'displayName' is not allowed on the connection since it was not
defined as a connection parameter when the API was registered...
Does anyone knows correct json schema for filesystem connection? I could not find it on https://resources.azure.com .

I was able to solve the issue by following instruction on blog
https://blogs.msdn.microsoft.com/logicapps/2016/02/23/deploying-in-the-logic-apps-preview-refresh/
Specially using armclient command line tool to retrieve the connection metadata
https://github.com/projectkudu/ARMClient
{
"apiVersion": "2016-06-01",
"name": "filesystem",
"type": "Microsoft.Web/connections",
"location": "[resourceGroup().location]",
"properties": {
"api": {
"id": "[concat(subscription().id,'/providers/Microsoft.Web/locations/centralus/managedApis/filesystem')]"
},
"displayName": "logicAppFile",
"parameterValues": {
"rootfolder": "c:\\",
"authType": "windows",
"username": "[parameters('username')]",
"password": "[parameters('password')]",
"gateway": {
"name": "OnPremGateway",
"id": "/subscriptions/-----/resourceGroups/-----/providers/Microsoft.Web/connectionGateways/OnPremGateway",
"type": "Microsoft.Web/connectionGateways"
}
}
},
}

i have seen you solved but it. So grats and thank you for posting your solution.
Perhaps it can make other with some problem easier, so I posted too.
I am a newbie and it helped me much.
I had the problem with other connectors (office365, office365user,..).
With Visual studio 2019 and installed logic App extension (Download Link) you can do following steps for getting an ARM-template with Api Connection informations.
(Screenshots will follow)
in Visual studio 2019 open the cloud explorer
select the needed subscription and the concerning logic app
then right-click on the logic App
and choose "Open with Logic App Editor" from the menu
Normally the logic app designer view will open in a client Window of VS2019
( it could be take some time, if you will not wait you could choose
in bottom window section CodeView - it doens't matter we only need
the download function)
then you click on download and after the finished download
you had an template file with the resource information for the Api
Connection(s)
In many cases this ARM-file works direct for deployment, but there could be some expression make problems (e.g. use [[ instead [ in text ) but the Api Connection(s) should be correct in the downloaded file.
I think there was 2 powershell scripts that shows you the correct API connection informations too, 1 script I have tested and it worked not for me but i only make a few tests and then Cancel it. So I didn't added the links here and it was and I have not kept it in in mind.

If your using logic app custom connector then you have to define those parameters with the same

Related

Json-ld data does not help my website to be foound on google by name or email

I've been learning lately about json-ld data and its goods at the time of getting some attention from google.
I had before simple websites with some html, js and css and google picked them up quickly and associatted them with my name and so on.
Now I have a react app with no SSR, so I thought some json-ld data at the index.html file woud help googe figuring out what and who the website represents.
{
"#context": "https://schema.org",
"#type": "Service",
"name": "Development Services",
"serviceType": "Software Development Services",
"description": "Description of my services",
"provider": {
"#type": "Person",
"familyName": "My lastname",
"givenName": "My firstname",
"email": "my-email#meh.com"
}
}
Google has the Schema Markup Testing Tool to test your structured data to see if it's placed correctly. I have good results, the tool finds the code.
Despite the good results with the tool I've never could find my website using my name or email. This was set months ago, so that should be working already.
I'd really appreciate any help.
Thanks

Logic App Deployment - integration account cannot be found: The workflow must be associated with an integration account to use the workflow run action

I have a logic app that was deploying from visual studio without issue a few weeks ago.
Today its throwing the following error on deployment:
17:27:10 - "error": {
17:27:10 - "code": "IntegrationAccountAssociationRequired",
17:27:10 - "message": "The workflow must be associated with an integration account to use the workflow run action 'Liquid transform' of type 'Liquid'."
17:27:10 - }
Within my logic app, it has a parameter that references the integration account:
"IntegrationAccountRef": {
"type": "string",
"minLength": 1,
"defaultValue": "/subscriptions/99x99x9x-9xx9-x99x-x99x-x99x99x99x99/resourcegroups/devResourceGroup/providers/Microsoft.Logic/integrationAccounts/devIntegrationAccount"
},
I also reference this parameter in the parameters section of the logic app resource, so the logic app knows its the integration account:
"integrationAccount": {
"id": "[parameters('IntegrationAccountRef')]"
}
Yet it still throws the error mentioned at the top.
Has something changed in how Logic Apps now reference integration accounts in an arm template?
Appreciate any advice and expertise.
Just summarize the steps in your comments for other communities reference:
Even though we have set the reference to the integration account in the template code, it also needs to be done in the logic app properties within visual studio.
Click anyplace in the white space of the Visual Studio Logic App.
Look inside the Property Windows for the Integration Account selection windows.
Select the Integration Account you want to use and save your Logic App

Can you edit a Logic App custom connector? and how does one deploy then maintain (update)

I created a logic app custom connector successfully (via the portal, not ARM) and it's in use (demo) working fine. It's a wrapper for an azure function but to provide better usability up front to less tech savy users i.e. expose properties VS providing json.
Any how once created my query is a simple one. Can it be edited 1. in the portal? 2. via ARM (if it was created by arm)? i.e. I want to add a better icon.
When I view the logic apps custom connector though in the portal and click EDIT all it does is populate the Connector Name and no more. See below. All original configuration, paramaters etc is missing.
So my queries.
Is this the norm?
On export of the custom connector (azure portal menu item) the template really has nothing in it. No content either of the connector details?
Is there an ARM template to deploy this?
If yes to 3, how do you go about modifying in the scenario you have to?
I also understand in using it in a logic app it created an API Connection reference. Does this stand alone, almost derived off the customer connector? And further uses say of a modified connector would create different API connections?
I feel I'm just missing some of the basic knowledge on how these are implemented. which in turn would explain the deploying, and maintenance.
Anyone :) ?
EDIT:
Think I've come to learn the portal is very buggy. The swagger editor loaded no content either and broke the screen. I've since tried a simpler connector i.e. no sample markup with escaped regex patterns and it seems to like going back into it to edit :) (Maybe one to report as a bug after all this)
That said then - Yes, edit should be possible but the other queries regarding ARM, export, redeploy and current connections still stands :)
You can deploy the Logic apps custom connector really easily. You need to do following steps
Configure you custom connector with proper settings and update it.
Once updated, click on the download link available at the top of the connector.
Download the ARM template skeleton using the Export Template.
In the properties section, just add a new property called swagger and paste the swagger you downloaded in step 2.
Parameterise your ARM template
Deploy using your choice of deployment using Azure DevOps , PowerShell etc.
Please refer to following ARM template for your perusal.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"customApis_tempconnector_name": {
"defaultValue": "tempconnector",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Web/customApis",
"apiVersion": "2016-06-01",
"name": "[parameters('customApis_tempconnector_name')]",
"location": "australiaeast",
"properties": {
"connectionParameters": {
"api_key": {
"type": "securestring",
"uiDefinition": {
"displayName": "API Key",
"description": "The API Key for this api",
"tooltip": "Provide your API Key",
"constraints": {
"tabIndex": 2,
"clearText": false,
"required": "true"
}
}
}
},
"backendService": {
"serviceUrl": "http://petstore.swagger.io/v2"
},
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
"displayName": "[parameters('customApis_tempconnector_name')]",
"iconUri": "/Content/retail/assets/default-connection-icon.e6bb72160664a5e37b9923c3d9f50ca5.2.svg",
"swagger": { "Enter Swagger Downloaded from Step 2 here" }
}
}
]
}

Importing .bacpac to SQL Azure via Azure Resource Manager from public blob

I created a .bacpac from the original SQL Azure DB I want to import to a new database during my deployment process. To do this, I want to have a github page with the usual Deploy to Azure button, that in as close to one click performs the deployment task, and sets up my entire application.
To do this, however, I need to set up some initial data on the database. After consulting the internet, I saw the post Using Azure Resource Manager to Copy Azure SQL Databases, which had a similar issue.
Right now, I have a MSDeploy extension running in the ARM template that deploys a website from a public azure blob. I'd ideally like to do this with the database too, but the command seems to require storageKeyType and storageKey parameters to be filled.
Is there any way to go around this limitation? Should I just give up and have my application perform the initial setup of the database? Sharing the storage key in a public github template does not seem like a very good plan!
Here's a code snippet:
"resources": [
{
"name": "Import",
"type": "extensions",
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[variables('sqlsrvmymisName')]",
"[variables('sqldbmymisName')]"
],
"properties": {
"storageUri": "https://publicblob.blob.core.windows.net/artifacts/publicblob.bacpac",
"administratorLogin": "MasterAccount",
"administratorLoginPassword": "P#ssw0rd",
"operationMode": "Import",
"storageKeyType": "Primary",
"storageKey": ""
}
}
]
If you really want it to be public, try this:
"storageKeyType": "SharedAccessKey",
"storageKey": "?",

how to define to use existing database server in ARM template?

Tuning the quick start, helps me deploy the App and DB. The thing I noticed was each time, my ARM template dictate to create a new DB server and load database. The tricky thing is that subscription got a limit of 6 DB servers.
Is there a way, I could define this as a configuration parameter and ARM template uses this db server than creating new one?
Error Message I get in shell console is :
>New-AzureRmResourceGroupDeployment : Resource Microsoft.Sql/servers
>'sqlserverXXXXXt6fXX' failed with message 'Cannot move or create server.
>Subscription '123XXXXXXXXXXXXXXXXXXe5X' will exceed server quota.'
Any suggestion or pointers would be great help!
Thanks
H Bala
My bad! This could be done with setting the servername variable to existing database server name and letting it be fixed always.
"resources": [
{
"name": "[variables('sqlserverName')]",
"type": "Microsoft.Sql/servers",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "SqlServer"
to
"resources": [
{
"name": "{**sqldbservername_desired**}",
"type": "Microsoft.Sql/servers",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "SqlServer"
Thanks & Regards,
H Bala

Resources