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

Dhanalakshmi Hariharan 46 Reputation points
2021-08-11T16:12:55+00:00

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
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,899 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 69,581 Reputation points
    2021-08-18T05:11:39.313+00:00

    @Dhanalakshmi Hariharan 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 %}    
       ]  
    }  
    

0 additional answers

Sort by: Most helpful