Azure Data Catalog Assets are not editable when I register an asset via REST API - azure-data-catalog

I am using the REST API of Azure Data Catalog to register new assets. My users need to be able to add/change tags and description. However, when I register new assets over REST API, add tag buttons and description text field disappear.
I suspect I need to pass a parameter in the json to make the fields editable. In the official documentation I couldn't find anything related.
I have all of the admin rights in all of my users, so I don't think it is an access rights issue.
How can I make the assets editable?

The solution is explained here. By default, the assets that are created by REST API are only editable by their owners. In order to change that behaviour, the following json object should be added to the payload:
{
"roles": [
{
"role": "Contributor",
"members": [
{
"objectId": "00000000-0000-0000-0000-000000000201"
}
]
}
],
//properties start here
//"properties": {
//...
// }
}
if it is still unclear, please check the following sample code.

Related

Create Sharepoint Site via REST API with multiple owners

So, I have a Power Automate Flow, which creates a Sharepoint Site using the Sharepoint REST API via "Send HTTP Request to Sharepoint" connector. I`ve following body:
{
"request": {
"Title": "#{variables('strSPName')}",
"Url":"#{variables('strSPAddress')}",
"Lcid": 1031,
"ShareByEmailEnabled":true,
"Description":"-",
"WebTemplate":"SITEPAGEPUBLISHING#0",
"SiteDesignId":"-",
"Owner": "#{outputs('Get_my_profile_(V2)')?['body/mail']}"
}
}
So right now I have only me as owner, but I need an additional owner.
I`ve tried to set two owners in an array like this:
"Owner": ["#{outputs('Get_my_profile_(V2)')?['body/mail']}", "email#test.com"]
Unfortunately, I`m getting the following error:
An unexpected 'StartArray' node was found when reading from the JSON reader. A 'PrimitiveValue' node was expected.
Any suggestions?
Thanks in advance.
As far as I am aware you can only set one owner when creating a site via the SPSiteManager endpoint. However, a workaround could be to add the second user to the Owners group directly after creation with a second POST request.
Below is an example
The principal id of the sitegroup should be 3.
Uri
_api/web/SiteGroups(3)/users
Body
{
"__metadata": { "type": "SP.User" },
"LoginName":"i:0#.f|membership|jane#contoso.onmicrosoft.com"
}

Trying to setup the JSON for Onelogin to Druva to setup profiles based on Department

We are trying to setup user provisioning via custom JSON schemas in Onelogin for Druva, to move users to profiles based on department.
The issues we are facing might be down to our Onelogin account not being an enterprise account. However, we found a workaround which did work, basing the mapping off company instead, as per this setup where the company field is used for "department".
While this works it doesn't seem the best option long term.
Any reason this shouldn't work?
{
"schemas": [
"urn:scim:schemas:core:2.0",
"urn:scim:schemas:extension:enterprise:1.0"
],
"userName": "{$user.email}",
"displayName": "{$user.firstname} {$user.lastname}",
"company": "{$user.company}",
"urn:scim:schemas:extension:enterprise:1.0": {
"department": "{$parameters.department}",
}
}
Any other suggestions?

Is there a way to get user permissions in a specific Azure Devops Project using rest api?

Hi I want to check the permissions of a user in a specific Azure Devops Project. Is there a possible way to get it? As far as I know project level permission is different than organization level permissions. Thanks.
Already test some several rest apis but still I can't have the project level permission.
There is currently no out-of-the-box rest api to get the user's permission in project.
To achieve this demand, you can use this rest api :
https://dev.azure.com/{org}/_apis/Contribution/HierarchyQuery?api-version=5.0-preview.1
Request body:
{
"contributionIds": ["ms.vss-admin-web.org-admin-permissions-pivot-data-provider"],
"dataProviderContext": {
"properties": {
"subjectDescriptor": "msa.ZjE1ZTk0NmMtOTI4OS03Mjg5LTljMGUtMDIwMTdlYmM2Nzhj",
"sourcePage": {
"url": "https://dev.azure.com/xxx/xxxx/_settings/permissions",
"routeId": "ms.vss-admin-web.project-admin-hub-route",
"routeValues": {
"action": "Execute",
"adminPivot": "permissions",
"controller": "ContributedPage",
"project": "XXX",
"serviceHost": "0933e8b2-f504-4b7e-9e9e-xxxxx (xxx)"
}
}
}
}
}
You can track this rest api by press F12 in browser then select Network .Then looking for the record that response body included returned permission. From this record you can get the rest api and request body.
I tested with postman , with this api ,I can successful get user's permission in project. As shown below:

Creating Azure App Insights using REST API fails requires ROLE

I am generating API Key for an App Insight. I am using the URL
"https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys"
I don't have any clear documentation and I found this from the MS SDK:
https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/applicationinsights/Microsoft.Azure.Management.ApplicationInsights/src/Generated/APIKeysOperations.cs
However, when I try to generate by mentioning a "name", an error comes in response:
{
"code": "The API Key needs to have a Role",
"message": "The API Key needs to have a Role",
"innererror": {
"diagnosticcontext": "e1f66da1-9247-459e-a519-6426fa1449d1",
"time": "2019-09-20T07:48:20.2634617Z"
}
}
My POST body is as following:
{
"name": "asimplekeyname"
}
Please help if someone has used this specific API.
You need to include the following properties in the body.
{
"name":"test3",
"linkedReadProperties":[
"/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/microsoft.insights/components/<appinsight-name>/api",
"/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/microsoft.insights/components/<appinsight-name>/agentconfig"
],
"linkedWriteProperties":[
"/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/microsoft.insights/components/<appinsight-name>/annotations"
]
}
The three properties correspond the ones in the portal -> your appinsight -> API Access -> Create API key.
api - Read telemetry
agentconfig - Authenticate SDK control channel
annotations - Write annotations
You need to select at least one of them, inculde in the request body.
For example, you just select the first one as below.
The body should be:
{
"name":"test3",
"linkedReadProperties":[
"/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/microsoft.insights/components/<appinsight-name>/api"
],
"linkedWriteProperties":[]
}

Unable to get user properties from users imported by Azure AD

I'm using Graph to get all users on my sharepoint online site. The code works just fine expect for one example.
I've the sharepoint users is synced from azure ad, then im not able to get the properties of the user.
Here is the webApiPermissionRequests:
"webApiPermissionRequests": [
{
"resource": "Microsoft Graph",
"scope": "User.ReadBasic.All"
},
{
"resource": "Microsoft Graph",
"scope": "Contacts.Read"
},
{
"resource": "Microsoft Graph",
"scope": "User.Read.All"
}
]
The request where i get my users:
const users: MSGraphClient = this.context.serviceScope.consume(MSGraphClient.serviceKey);
users
.api("/users")
.select("displayName,mobilePhone,mail,photo,department,jobTitle,mailNickname")
.top(999)
.get((error, response: any, rawResponse?: any) => {
As i said, Everything works just fine expect when a user is imported from the Azure AD.
Can anyone tell me why all properties except displayName is null when it's an imported user.
UPDATED
I've added a picture. It' is only the Mobile Phone number (Mobiltelefon) that I'm able to get with the api above. The rest of the data and information is not being received. Let's take Office (Kontor) is coming from the azure add and is not is NOT being received in the API.
According to your description, you want to get the user's properties by MS Graph API.
Based on my test, we can get the properties. For your case, we should check the properties whose the value is null.
Check the properties in Azure AD whether it is null.

Resources