question

Dhanalakshmi-8414 avatar image
0 Votes"
Dhanalakshmi-8414 asked Dhanalakshmi-8414 commented

Powershell script for uploading map and schemas(artifacts) to Single tenant Logic App standard

Hi All,

Would be helpful if anybody can provide some reference on Powershell scripts for uploading map and schemas(artifacts) to Single tenant Logic App standard.

Requirement - Any automated way of uploading maps/schemas to LogicApp standard

Thanks,
Dhana

azure-logic-apps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered Dhanalakshmi-8414 commented

@Dhanalakshmi-8414 Apology for the delay. As of now there are no offical documented REST API or any powershell that can help you to upload the maps and schemas in logic app Standard SKU.

The workaround would be to capture the azure portal traces (F12/fiddler) to know what API is called at the backend for the specific operation and you can leverage the same if you need. Any changes on the API version/request body etc. you need to capture portal traces again to see the request flow. You need to call the REST API in your poweshell script and acquire the token. You can refer to this document for more details.

For your reference sharing the request URL/body that I have captured and tested the same at my end.

To Upload Schema:

PUT https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/{resourcegroup}/providers/Microsoft.Web/sites/{yourlogicappstandardname}/hostruntime/admin/vfs/Artifacts/Schemas/{yourfilenamewithextension}?api-version=2018-11-01&relativepath=1
Content-Type: application/json
Authorization: Bearer <your bearer token. For testing you can use the same token from portal F12/fidller traces but for automation you need to acquire the token>

Request Body :
<Your xsd or xml file content>

Example Request URL : https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/{resourcegroup}/providers/Microsoft.Web/sites/{yourlogicappstandardname}/hostruntime/admin/vfs/Artifacts/Schemas/myfile.xsd?api-version=2018-11-01&relativepath=1

Example Request Body:

 <?xml version="1.0" encoding="utf-8"?>
 <!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-technologies.com) -->
 <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:element name="note">
     <xs:complexType>
       <xs:sequence>
         <xs:element name="to" type="xs:string" />
         <xs:element name="from" type="xs:string" />
         <xs:element name="heading" type="xs:string" />
         <xs:element name="body" type="xs:string" />
       </xs:sequence>
     </xs:complexType>
   </xs:element>
 </xs:schema>

To Upload Maps:

PUT
https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/{resourcegroup}/providers/Microsoft.Web/sites/{yourlogicappstandardname}/hostruntime/admin/vfs/Artifacts/Maps/{yourfilenamewithextension}?api-version=2018-11-01&relativepath=1
Content-Type: application/json
Authorization: Bearer <your bearer token. For testing you can use the same token from portal F12/fidller traces but for automation you need to acquire the token>

Request Body :
<Your xslt or liquid file content>

Example Request URL : https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/{resourcegroup}/providers/Microsoft.Web/sites/{yourlogicappstandardname}/hostruntime/admin/vfs/Artifacts/Schemas/myfile.xsd?api-version=2018-11-01&relativepath=1

Example Request Body:

 {  
    "Employee Name" : "{<!-- -->{ content.FirstName }} {<!-- -->{ content.LastName }}",
    "Company Name" : "{<!-- -->{ content.Company }}",
    "Date Of Joining" : "{<!-- -->{ "now" | Date: "MM/dd/yyyy" }}",
    "Department" : "{<!-- -->{ content.department }}",
    "Technology" : "{<!-- -->{ content.Work | Size }}",
    "Skills" : [  
       {% for Skill in content.Work %}     
       {         
          "Name" : "{<!-- -->{ Skill.skil }}",
          "Marks" : {<!-- -->{ Skill.Mark }}     
       },  
       {% endfor %}  
    ]
 }
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MayankBargali-MSFT - Thank you so much. It is really helps.

0 Votes 0 ·