Azure DevOps Role based menu item - azure-devops

Currently I have build an Azure DevOps extension with a menu item who is visible for everyone. This was not a problem, but now we want to hide some of the pages for specific user groups.
I can only find limited information about setting up custom menu items and I didn't find any solution how to make the menu item role or team based.
Below you can see my current extension file. Can anyone tell me how to solve this problem?
{
// ...
"contributions": [
{
"id": "xxx-hub-group",
"type": "ms.vss-web.hub-group",
"description": "XXX",
"targets": [
"ms.vss-web.project-hub-groups-collection"
],
"properties": {
"name": "XXX",
"icon": "img/xxx.png"
}
},
{
"id": "sub-xxx",
"type": "ms.vss-web.hub",
"description": "sub-xxx",
"targets": [
".xxx-hub-group"
],
"properties": {
"name": "sub-xxx",
"title": "sub-xxx",
"icon": "img/sub-xxx.png",
"uri": "pages/sub-xxx.html",
"supportedScopes": [
"project_team"
]
}
}
]
}

Related

Azure DevOps Server 2019: Custom Dashboard Widget not available

We have a self-hosted Azure DevOps Server 2019 for which I have created my own widget using the tutorial https://learn.microsoft.com/en-us/azure/devops/extend/develop/add-dashboard-widget?view=azure-devops-2019.
I was also able to successfully add the extension to the server and the extension is also visible.
However, when I edit my dashboard, my newly created widget is not displayed. What could be the reason for this?
Furthermore, I also installed the extension VstsDashboardWidgetProjectTemplate (https://github.com/GregTrevellick/VstsDashboardWidgetProjectTemplate) in Visual Studio and also created an extension/widget from it. Unfortunately with the same result that I can install and see the extension, but not the actual widget.
I am attaching the vss-extension.json file as I suspect this is where the error is most likely to be found. However, I can also supply the other files if needed.
{
"manifestVersion": 1,
"id": "MyVeryFirstCustomExtension",
"version": "1.0.0",
"name": "My Very First Custom Extension",
"description": "Samples containing different widgets extending dashboards",
"publisher": "MyCompany",
"categories": [
"Azure Boards"
],
"targets": [
{
"id": "Microsoft.VisualStudio.Services"
}
],
"icons": {
"default": "img/logo.png"
},
"contributions": [
{
"id": "HelloWorldWidget",
"type": "ms.vss-dashboards-web.widget",
"targets": [
"ms.vss-dashboards-web.widget-catalog"
],
"properties": {
"name": "Hello World Widget",
"description": "My first widget",
"catalogIconUrl": "img/CatalogIcon.png",
"previewImageUrl": "img/preview.png",
"uri": "hello-world.html",
"supportedSizes": [
{
"rowSpan": 1,
"columnSpan": 2
}
],
"supportedScopes": [
"project_team"
]
}
}
],
"files": [
{
"path": "hello-world.html",
"addressable": true
},
{
"path": "sdk/scripts",
"addressable": true
},
{
"path": "img",
"addressable": true
}
],
"scopes": [
"vso.work"
]
}

Extensibility point on release results page

I am part of VS performance team, I need to create a new tab for the Release result page.Release result page
Previously it was possible with the target ms.vss-releaseManagement-web.release-details-view but that no longer works on the new experience, do you know how the contribution configuration should look?, this is what I have so far:
"id": "pit-tab",
"type": "ms.vss-releaseManagement-web.release-summary-tab",
"targets": [
"ms.vss-releaseManagement-web.release-details-view"
],
"properties": {
"name": "Performance",
"uri": "dist/index.html",
"order": "99",
"icon": "asset://img/icon.png",
"supportsMobile": true
}
Try with below script:
{
"id": "release-environments-tab",
"type": "ms.vss-web.tab",
"description": "Adds a 'Merlin Insert' tab to the release environment.",
"targets": [
"ms.vss-releaseManagement-web.release-environment-editor-tab"
],
"properties": {
"name": "Merlin Insert",
"order": "30",
"uri": "index.html"
}
},

How to add a custom tab to the new Azure DevOps Releases Hub with an extension?

The Azure DevOps UI is evolving, and I'm trying to add a custom tab to the new Release Pipeline view while looking at a particular release:
I was able to do so in the old UI, using the ms.vss-releaseManagement-web.release-summary-tab contribution and targeting ms.vss-releaseManagement-web.release-details-view:
{
"id": "my-release-tab",
"type": "ms.vss-releaseManagement-web.release-summary-tab",
"description": "My release tab",
"targets": ["ms.vss-releaseManagement-web.release-details-view"],
"properties": {
"name": "My Custom Tab",
"uri": "tab.html"
},
"includes": ["ms.vss-releaseManagement-web.release-service-data-external"]
}
What is the new contribution type? Has the target changed?
From Microsoft Docs it looks like you need to change the contribution type and target to this:
{
"id": "rm-details-view-sample",
"type": "ms.vss-releaseManagement-web.release-summary-section",
"targets": [ "ms.vss-releaseManagement-web.release-details-summary-tab" ],
"properties": {
"name": "Tab name",
"uri": "index.html"
}
}

Can alerts be added to a Grafana Panel on a dashboard using API?

There is a Grafana dashboard with a panel inside it. Is it possible to add (or define) an API?
To create new alerts or modify them you need to update the dashboard json that contains the alerts. Use dashboard API and edit particular panel alert section. You need to define an alert there. For example:
"alert": {
"conditions": [
{
"type": "query",
"query": {
"params": [
"A",
"5m",
"now"
]
},
"reducer": {
"type": "avg",
"params": []
},
"evaluator": {
"type": "gt",
"params": [
null
]
},
"operator": {
"type": "and"
}
}
],

Azure Data Factory V2: Custom Activity inside a If Condition activity

I'm working on an Azure Data Factory V2 Pipeline but I having a problem when I try to execute a "Custom activity" inside an "If Condition Activity".
If I try to test my pipeline with "Test Run" button on the ADF's Web interface, this error appeare:
{"code":"BadRequest","message":"Activity PPL_ANYFBRF01 failed: Invalid linked service reference. Name: LNK_BATCH_AZURE","target"...}
I'm sure that there is no error in the linked service reference's name. If I create a "Custom Activity" directly in my pipeline, it's working.
I think it can be a syntax error on my activity but I can't find it.
Here is my "If Condition Activity"'s Json template (the expression "#equal(0,0)" is just for testing purpose):
{
"name": "IfPointComptageNotExist",
"type": "IfCondition",
"dependsOn": [
{
"activity": "PointComptage",
"dependencyConditions": [
"Succeeded"
]
},
{
"activity": "SousPointComptage",
"dependencyConditions": [
"Succeeded"
]
}
],
"typeProperties": {
"expression": {
"value": "#equal(0,0)",
"type": "Expression"
},
"ifTrueActivities": [
{
"type": "Custom",
"name": "CustomActivityTest",
"linkedServiceName": {
"referenceName": "LNK_BATCH_AZURE",
"type": "LinkedServiceReference"
},
"typeProperties": {
"command": "Batch.exe",
"resourceLinkedService": {
"referenceName": "LNK_BLOB_STORAGE",
"type": "LinkedServiceReference"
},
"folderPath": "/test/app/"
}
}
]
}
},
Thank you in advance for your help.
The problem is now solved. I have recreate the pipeline and it's working now.
Regards,
Julien.