Workfront API -> How to get all task id's associated to a project from workfront API? - workfront-api

I need to fetch all associated task ID's with a project from workfront API's.
I have a project id like: 1234567890
There are 18 task associated with this project.
My use case: I need to mark all those associated task to complete, for which I need the task ID's.
Note: If there is any other way to mark task complete in workfront, Please let me know.

Got the answer:
Method Type: Get
Request: /attask/api/v9.0/search
Params:
projectID: 1234567890
apiKey : (When using APIKey)
In Response, you will see all the task associated to that project.

Related

Create Insights Log query from Azure cli not Log Monitor saved search

Using latest azure cli (2.28.1)
The creation of Kusto queries against Log Analytics with the azure cli is documented here:
https://learn.microsoft.com/en-us/cli/azure/monitor/log-analytics/workspace/saved-search?view=azure-cli-latest
using the saved-search directive. A minor irritation is that the cli always creates legacy categories rather than non-legacy and tags sometimes are not correctly applied.
But what I can not find is how to create queries against Insights with the cli. Combed the Microsoft docs without a hit. Insights is a subset of Log Analytics (Monitor) but the queries are stored separately. Alarms can target both resource groups (i.e. Insights and Log Analytics).
You need to use az monitor app-insights query command to run the kusto queries for application insights using Azure CLI.
We have tested in our environment Using the below cmdlets, can pull the appid for an application insights & also Total numbers requests for that particular application over a time period of 1day.
az monitor app-insights component show --app <app-insightsName> --resource-group <resource-Name> --query appId
az monitor app-insights query --app <appId> --analytics-query 'requests | summarize count() by bin(timestamp, 24h)' --offset 1h30m
Here is the reference document for more information about running app insight analytics-queries using Azure CLI.
With bicep (az bicep build --file <bicep file>) resource definitions can be defined in a template (json) then deployed with the azure cli (az deployment group create --resource-group <name> --template-file <bicep generated template>)
Hard part was making parent and child resources in bicep. Needed a parent query pack and a child queries:
resource querypack 'Microsoft.OperationalInsights/queryPacks#2019-09-01-preview' =
{
name: 'DefaultQueryPack'
location: 'northeurope'
properties: {}
}
resource query 'Microsoft.OperationalInsights/queryPacks/queries#2019-09-01-preview' = {
parent: querypack
name: '6967c00c-9b46-4270-bee0-5a27b8b85cef'
properties: {
displayName: 'BadEventsBySdcFileId'
description: ''
body: '<kusto query>'
related: {
categories: [
'applications'
]
resourceTypes: [
'microsoft.insights/components'
]
}
tags: {}
}
}
Also the query resource name has to be a GUID which is not at all clear in the documentation. Tags are helpful to group by topic when hunting around for queries say that belong to a project domain.

Get the user information from teams using Bot framework composer

I had created a bot using bot framework composer and integrated it with MS Teams with help of the azure web app.
Now I need to get the login user(MS Team) information i.e. the user who using the bot.
I need to get the user information and log it in the azure application insights using Bot Framework Composer.
Can anyone help me with it?
Get UserID from ${turn.activity.aadObjectId}
Get more user information by Microsoft Graph: https://learn.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http
In MS Teams, with each new interaction with the bot, a "conversation Update activity" is first sent to the bot, this is what triggers the welcome greeting. You get back the following context in the returned JSON - in the Turn.Activity memory scope.
...snip...
"serviceUrl":"https://smba.trafficmanager.net/emea/",
"channelId":"msteams",
"from":{
"id":"<<Unique MS Teams Identifier for the end user>>",
"name":"<<AAD firstname surname is returned here>>",
"aadObjectId":"<<GUID is returned here>>",
"role":"user"
},
...snip...
You can Use the aadObjectId to query the MS Graph using an HTTPRequest if you want to get further info. Or just use the persons "name" field (which is from AAD) if that is good enough.

how to get all the files present for a particular commit id in bitbucket using rest API?

I want to get all the files present for a particular commit Id in bitbucket server using rest API. Is there any api to get the complete data ?
Hi you can use this..
rest/api/1.0/projects/{projectname}/repos/{reponame}/commits/{commit
id}/changes
The reply will contain (among other information) the details of each files modified in the commit.
As an example, this is the related section from the entire json output:
path: {components: ["file1.txt"],parent: "",name: "file1.txt",extension: "txt",toString: "file1.txt"},
You are looking for this endpoint: https://docs.atlassian.com/bitbucket-server/rest/6.4.0/bitbucket-rest.html#idp178
GET /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/archive?at={commitId}
With this you will get in default a zip file with all the files at this specific commit. Following the link you can get more information about the endpoint.

Referencing a Managed Service Identity in ARM-template deploy

When deploying a Microsoft.Web resource with the new MSI feature the principleId GUID for the created user is visible after deployment. Screenshot below shows the structure in the ARM-template.
What would be the best way to fetch this GUID later in the pipeline to be able to assign access rights in (for instance) Data Lake Store?
Is it possible to use any of the existing ARM template functions to do so?
I just struggled with this myself. The solution that worked for me was found deep in the comments here.
Essentially, you create a variable targeting the resource you are creating with the MSI support. Then you can use the variable to fetch the specific tenantId and principalId values. Not ideal, but it works. In my examples, I'm configuring Key Vault permissions for a Function App.
To create the variable, use the syntax below.
"variables": {
"identity_resource_id": "[concat(resourceId('Microsoft.Web/sites', variables('appName')), '/providers/Microsoft.ManagedIdentity/Identities/default')]"
}
To get the actual values for the tenantId and principalId, reference them with the following syntax:
{
"tenantId": "[reference(variables('identity_resource_id'), '2015-08-31-PREVIEW').tenantId]",
"objectId": "[reference(variables('identity_resource_id'), '2015-08-31-PREVIEW').principalId]"
}
Hope this helps anyone who comes along with the same problem!
Here are a few sample templates: https://github.com/rashidqureshi/MSI-Samples that show a) how to grant RBAC access to ARM resources b) how to create access policy for keyvault using the OID of the MSI
There is new way to get identity information. You can directly get them from resource that support Managed Identity for Azure resources (Managed Service Identity in the past).
{
"tenantId": "[reference(resourceId('Microsoft.Web/sites', variables('serviceAppName')),'2019-08-01', 'full').identity.tenantId]",
"objectId": "[reference(resourceId('Microsoft.Web/sites', variables('serviceAppName')),'2019-08-01', 'full').identity.principalId]",
}
You can also get principal Id for resource in other resource group or/and subscription. ResourceId supports optional parameters:
"tenantId": "[reference(resourceId(variables('resourceGroup'), 'Microsoft.Web/sites', variables('serviceAppName')),'2019-08-01', 'full').identity.tenantId]",
or
"tenantId": "[reference(resourceId(variables('subscription'), variables('resourceGroup'), 'Microsoft.Web/sites', variables('serviceAppName')),'2019-08-01', 'full').identity.tenantId]",

CURRENT_RPC_CONTEXT.get() must not be null

Written the Integration test case for testing Corda Flows through API class as:
val api=ProjectApi(mockNode1.rpcOps)
val message = "some input message"
val resp: Response=api.publishSSI(message)
assertEquals(resp.status, 201,"Failed to publish SSI")
But getting CURRENT_RPC_CONTEXT.get() must not be null exception while starting corda flow inside api.publishSSI() method.
what could be the cause?
You need to use the RPC client API to connect to the node. You can find more details here: https://docs.corda.net/tutorial-clientrpc-api.html
You can't test the API by manually constructing it in this way. When the API is set up, some additional context is passed in, which is lacking here.

Resources