Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi
How can I test license API before publishing the bundle to AppSource?
I have React to build my own visul and use license API for payments.
I found examples here:
https://learn.microsoft.com/en-gb/power-bi/developer/visuals/licensing-api
How I can test it?
My code:
constructor(options: VisualConstructorOptions) {
this.host = options.host
this.licenseManager = options.host.licenseManager
this.licenseManager.getAvailableServicePlans().then((result) => {
this.isPowerBILicense = !!(
result.plans &&
result.plans.length &&
result.plans.some(
(plan) =>
PAID_PLANS.includes(plan.spIdentifier) &&
(plan.state === powerbi.ServicePlanState.Active ||
plan.state === powerbi.ServicePlanState.Warning),
)
)
})
}Now, I am in developer mode and I can't get real data, because the visual is not published.
How can I test the license?
Thanks. I know how to work with Postman, but I want to know another thing.
I use licenseManager to get license data (plans, isLicenseUnsupportedEnv, isLicenseInfoAvailable) from powerBI to know if I have to show a watermark (watermark to buy a license).
Example:
options.host.licenseManager.getAvailableServicePlans().then((result: LicenseInfoResult) => { ... }
So, the question is “How I can test the license plans before publishing the app?”
How can I test instructions from this page? (https://learn.microsoft.com/en-gb/power-bi/developer/visuals/licensing-api)
I want to test cases if I have a plan with a license key or if I have a trial period or if I don’t have a license. How can I test these cases?
Hi @Anonymous ,
I think you can try to send API by third party tool Postman.
For reference:
https://learning.postman.com/docs/getting-started/sending-the-first-request/
https://hevodata.com/learn/postman-rest-client/
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 4 | |
| 3 | |
| 2 |