Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
ElektroHulk
Regular Visitor

Programatic shortcut creation in Lakehouse, using Fabric API.

Good day, 

Just a note, I did reply to a topic that had a relatively similar Subject, however it was old and I thought I would create a new Post, as I am not sure how often old topics are checked by the moderators of the forum. 

I have attempted to programatically perform a shortcut creation in a Lakehouse, that will point to a Dataverse entity in a Fabric Notebook using the Fabric API, however I can not make it work. 
Therefore, my question is, has the support for shortcut creation has already been added to the API or not yet? 

Just in case, I will add some context to my case. I have created a 'Link to Microsoft Fabric' from my Dataverse environment to a Lakehouse in Fabric. I have removed 1-2 tables in Fabric, thus removing the shortcuts. I want now to add the shortcuts back, but I need to do it programatically. 
This is the code that I am using to call the API:

 

entity = 'actioncard'
DATAVERSE_END_URL = 'https://myorgxxx.crm4.dynamics.com'

url = f"https://api.fabric.microsoft.com/v1/workspaces/{WORKSPACE_ID}/items/{LAKEHOUSE_ID}/shortcuts"

headers = {
    "Authorization": f"Bearer {token}",
    "Content-Type": "application/json"
}

# create shortcuts for a list of entities
for entity in MISSING_ENTITIES:
    print(entity)
    payload = {
        "name": entity,
        "path": f"Tables/{entity}",
        "target": {
            "dataverse" : {
                "deltaLakeFolder": "",
                "environmentDomain": DATAVERSE_END_URL,
                "tableName": f"{entity}",
                "connectionId": CONNECTION_ID
            }
        }
    }

    try:
        response = requests.post(url, headers=headers, json=payload)

 


I am getting the following 400 error:

 

Failed to create actioncard: 400 - {"requestId":"1534w4aa-e00a-4f05-aa9f-d4c5573456c9","errorCode":"BadRequest","moreDetails":[{"errorCode":"RequestBodyValidationFailed","message":"Shortcut target uri /actioncard:Dataverse is malformed."}],"message":"The request could not be processed due to missing or invalid information"}

 


If the support has been implemented but I am taking the wrong approach, please reffer to the correct documentation. 

Thanks a lot in advance.

7 REPLIES 7
ElektroHulk
Regular Visitor

Good day, guys. 

@v-saisrao-msft @nilendraFabric 


Unfortunately, I was on medical leave starting Thursday last week and did not have a chance to try this. I will do so today or tomorrow and will most definitely come back with updates and feedback. 

ElektroHulk
Regular Visitor

Good day, @v-saisrao-msft  and @nilendraFabric .
Thank you very much for taking the time to help with some good advice and pointers/hints. 
I will go through both your recommendations and will let you know the output afterwards. 

Hi @ElektroHulk,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

Hi @ElektroHulk,

Just checking in  have you had a chance to go through the suggestions we shared us?

Thank you.

nilendraFabric
Community Champion
Community Champion

Hello @ElektroHulk 

try this code

entity = 'actioncard'
DATAVERSE_END_URL = 'https://myorgxxx.crm4.dynamics.com'

url = f"https://api.fabric.microsoft.com/v1/workspaces/{WORKSPACE_ID}/items/{LAKEHOUSE_ID}/shortcuts"

headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}

# Create shortcuts for a list of entities
for entity in MISSING_ENTITIES:
print(entity)
payload = {
"path": "Tables",
"name": entity,
"target": {
"type": "Dataverse",
"dataverse": {
"environmentUrl": DATAVERSE_END_URL,
"tableName": entity,
"connectionId": CONNECTION_ID
}
}
}

try:
response = requests.post(url, headers=headers, json=payload)

hi @nilendraFabric 
Your solution did not work, unfortunately. 

It still asks for the "deltaLakeFolder" property and value. If I add the deltaLakeFolder property it is telling me it's malformed. 

As far as I understand, the "deltaLakeFolder" would be useful only when creating the Link via Synapse, as it stores the entities as parquet delta tables in a an ADLS. But for "Link to Microsoft Fabric", such property might not be of much use, the 'ghost' copy of the Dataverse that is created when using this Link option is stored on Dataverse storage. 

Maybe I am wrong. 

v-saisrao-msft
Community Support
Community Support

Hi @ElektroHulk,
Thank you for reaching out to the Microsoft Fabric Forum Community. 

According to the official Microsoft documentation, creating shortcuts to Dataverse tables is supported via the Fabric REST API. However, it’s a relatively new capability, and some behaviors may still differ slightly from shortcuts created via the Fabric UI (e.g., through Power Apps or the Power Platform Admin Center). 
The error you're encountering: 

"Shortcut target uri /actioncard:Dataverse is malformed." 
 suggests there might be a structural issue in the request body — either a missing required field or a mismatch in expected values. 

Here are a few areas to review while troubleshooting: 

  • Ensure all required fields in the request body are populated correctly — for Dataverse, this typically includes environmentDomain, tableName, connectionId, and deltaLakeFolder. 
  • Validate that the connectionId being used is correct and linked to the Dataverse connection established via the Fabric UI. 
  • Make sure that tableName and environmentDomain match the exact values in your Dataverse setup, as the API can be sensitive to formatting and casing. 
  • Avoid leaving optional fields blank if the API still expects a value (e.g., deltaLakeFolder). 

vsaisraomsft_1-1744190695951.png

 

Please refer the below documents for your reference: 
OneLake Shortcuts - Create Shortcut - REST API (Core) | Microsoft Learn 
Unify data sources with OneLake shortcuts - Microsoft Fabric | Microsoft Learn

 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly. 

 
Thank you. 

Helpful resources

Announcements
MarchFBCvideo - carousel

Fabric Monthly Update - March 2025

Check out the March 2025 Fabric update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

"); $(".slidesjs-pagination" ).prependTo(".pagination_sec"); $(".slidesjs-pagination" ).append("
"); $(".slidesjs-play.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-stop.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-pagination" ).append(""); $(".slidesjs-pagination" ).append(""); } catch(e){ } /* End: This code is added by iTalent as part of iTrack COMPL-455 */ $(".slidesjs-previous.slidesjs-navigation").attr('tabindex', '0'); $(".slidesjs-next.slidesjs-navigation").attr('tabindex', '0'); /* start: This code is added by iTalent as part of iTrack 1859082 */ $('.slidesjs-play.slidesjs-navigation').attr('id','playtitle'); $('.slidesjs-stop.slidesjs-navigation').attr('id','stoptitle'); $('.slidesjs-play.slidesjs-navigation').attr('role','tab'); $('.slidesjs-stop.slidesjs-navigation').attr('role','tab'); $('.slidesjs-play.slidesjs-navigation').attr('aria-describedby','tip1'); $('.slidesjs-stop.slidesjs-navigation').attr('aria-describedby','tip2'); /* End: This code is added by iTalent as part of iTrack 1859082 */ }); $(document).ready(function() { if($("#slides .item").length < 2 ) { /* Fixing Single Slide click issue (commented following code)*/ // $(".item").css("left","0px"); $(".item.slidesjs-slide").attr('style', 'left:0px !important'); $(".slidesjs-stop.slidesjs-navigation").trigger('click'); $(".slidesjs-previous").css("display", "none"); $(".slidesjs-next").css("display", "none"); } var items_length = $(".item.slidesjs-slide").length; $(".slidesjs-pagination-item > button").attr("aria-setsize",items_length); $(".slidesjs-next, .slidesjs-pagination-item button").attr("tabindex","-1"); $(".slidesjs-pagination-item button").attr("role", "tab"); $(".slidesjs-previous").attr("tabindex","-1"); $(".slidesjs-next").attr("aria-hidden","true"); $(".slidesjs-previous").attr("aria-hidden","true"); $(".slidesjs-next").attr("aria-label","Next"); $(".slidesjs-previous").attr("aria-label","Previous"); //$(".slidesjs-stop.slidesjs-navigation").attr("role","button"); //$(".slidesjs-play.slidesjs-navigation").attr("role","button"); $(".slidesjs-pagination").attr("role","tablist").attr("aria-busy","true"); $("li.slidesjs-pagination-item").attr("role","list"); $(".item.slidesjs-slide").attr("tabindex","-1"); $(".item.slidesjs-slide").attr("aria-label","item"); /*$(".slidesjs-stop.slidesjs-navigation").on('click', function() { var itemNumber = parseInt($('.slidesjs-pagination-item > a.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); });*/ $(".slidesjs-stop.slidesjs-navigation, .slidesjs-pagination-item > button").on('click keydown', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); var itemNumber = parseInt($('.slidesjs-pagination-item > button.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); }); $(".slidesjs-play.slidesjs-navigation").on('click', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); }); $(".slidesjs-pagination-item button").keyup(function(e){ var keyCode = e.keyCode || e.which; if (keyCode == 9) { e.preventDefault(); $(".slidesjs-stop.slidesjs-navigation").trigger('click').blur(); $("button.active").focus(); } }); $(".slidesjs-play").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-stop").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-play")) { $(".slidesjs-stop").focus(); } } }); $(".slidesjs-stop").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-play").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-stop")) { $(".slidesjs-play").focus(); } } }); $(".slidesjs-pagination-item").keydown(function(e){ switch (e.which){ case 37: //left arrow key $(".slidesjs-previous.slidesjs-navigation").trigger('click'); e.preventDefault(); break; case 39: //right arrow key $(".slidesjs-next.slidesjs-navigation").trigger('click'); e.preventDefault(); break; default: return; } $(".slidesjs-pagination-item button.active").focus(); }); }); // Start This code is added by iTalent as part of iTrack 1859082 $(document).ready(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); $("#tip2").attr("aria-hidden","true").addClass("hidden"); $(".slidesjs-stop.slidesjs-navigation, .slidesjs-play.slidesjs-navigation").attr('title', ''); $("a#playtitle").focus(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").mouseover(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").blur(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#playtitle").mouseleave(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#play").keydown(function(ev){ if (ev.which ==27) { $("#tip1").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); $("a#stoptitle").focus(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").mouseover(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").blur(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").mouseleave(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").keydown(function(ev){ if (ev.which ==27) { $("#tip2").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); }); // End This code is added by iTalent as part of iTrack 1859082
Users online (1,607)