Microsoft Graph API beta/reports has no data - azure-active-directory

I have been trying to access MFA information for my account using the Microsoft Graph API. This information is included in the beta version of the API and is located at https://graph.microsoft.com/beta/reports/credentialUserRegistrationDetails. Although I can GET this with no issue, there seem to be no results available, as the response is:
{'#odata.context': 'https://graph.microsoft.com/beta/$metadata#reports/credentialUserRegistrationDetails', 'value': []}
when I expect something more like:
"#odata.context":"https://graph.microsoft.com/beta/reports/$metadata#Collection(microsoft.graph.credentialUserRegistrationDetails)",
"value":[
{
"id" : "id-value",
"userPrincipalName":"userPrincipalName",
"userDisplayName": "userDisplayName-value",
"authMethods": ["email", "mobileSMS"],
"isRegistered" : false,
"isEnabled" : true,
"isCapable" : false,
"isMfaRegistered" : true
}
]
}
I make this API call using the reports.read.all permission and whilst I may be lacking other permissions to be able to access the data, I really have no idea how to start troubleshooting this issue. I was wondering if anyone could shed some light on why I cant see any "value" data?

Related

Access Storage Account Key from a resource outside the ARM template

I'm using several ARM templates in our project, each of them meant for a different component, and there's also a Common ARM template that includes all resources that most of the elements need to work, as SqlServer, Storage Accounts, Redis cache(only one of this resources for all the elements)
The thing is, as Storage account is in a separate ARM template(Common infrastructure ARM template), I'm not able to access the Storage account keys from the component template. I need this to properly set the value of the connection string for the component to use it. If I include the storage account resource in the component template, I can access it via:
[concat('DefaultEndpointsProtocol=https;AccountName=',
variables('YFO.StorageAccount.Name'), ';AccountKey=',
listKeys(resourceId('Microsoft.Storage/storageAccounts',
variables('YFO.StorageAccount.Name')), providers('Microsoft.Storage',
'storageAccounts').apiVersions[0]).keys[0].value)]
But when I remove it from the component template, as it should be, then I get the following error:
New-AzureRmResourceGroupDeployment :
Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'The template reference '**********' is not valid: could not
find template resource or resource copy with this name. Please see
https://aka.ms/arm-template-expressions/#reference for usage details.'
It seems listKeys won't do the work if the resource is outside the template you are trying to deploy
For the AppInsights component, I was able to do this with:
[reference(concat('Microsoft.Insights/components/',
variables('AppInsightsName'))).InstrumentationKey]
even if the AppInsights resource is located out of the component ARM template, but I cannot do it with Storage account as the object returned for Storage Account in reference function is as following:
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
},
"supportsHttpsTrafficOnly": false,
"encryption": {
"services": {
"file": {
"enabled": true,
"lastEnabledTime": "2018-08-18T06:05:57.3069884Z"
},
"blob": {
"enabled": true,
"lastEnabledTime": "2018-08-18T06:05:57.3069884Z"
}
},
"keySource": "Microsoft.Storage"
},
"provisioningState": "Succeeded",
"creationTime": "2018-08-18T06:05:56.8228127Z",
"primaryEndpoints": {
"blob": "https://yfomormonttest.blob.core.windows.net/",
"queue": "https://yfomormonttest.queue.core.windows.net/",
"table": "https://yfomormonttest.table.core.windows.net/",
"file": "https://yfomormonttest.file.core.windows.net/"
},
"primaryLocation": "westeurope",
"statusOfPrimary": "available",
"secondaryLocation": "northeurope",
"statusOfSecondary": "available"
}
Any clue?
Thanks and regards.
The problem was in providers('Microsoft.Storage', 'storageAccounts').apiVersions[0] to get the API version that listkeys needs as a parameter. Setting directly the parameter as 2018-07-01 did work

Need to read cookies value by it's name angularjs

I've cookie in my application and I need to read it using angularJS ngCookies.
When I exported the cookies from browser extension it looks like following json :
[
{
"domain": "localhost",
"hostOnly": true,
"httpOnly": false,
"name": "JSESSIONID",
"sameSite": "no_restriction",
"secure": true,
"session": true,
"storeId": "0",
"value": "00FC04BF082458FFE6F175C7E03F5712",
"id": 18
}
]
there can be more objects in this JSON along with 'JSESSIONID'. so I want to read only JSESSIONID's value.
my Code :
var jsessionCookie = $cookies.get('JSESSIONID');
console.log(" Cookies 'JSESSIONID' : "+jsessionCookie);
I'm getting undefined object.
The code you have seems fine, but the underlying issue is different.
You have your cookie marked as
"httpOnly": true
This means that cookie cannot be accessed by client side code including Angular.js.
The only way to access it is to change the code that generates the code so the cookie is not marked as httpOnly. There are some security considerations for making the change, so make sure you understand what you are doing.
You can read more about HttpOnly at OWASP web site.
To store a cokkie,
$cookies.put("cookie_name","cookie_value",{"expires":expireDate,"domain":"domain_name"});
To get a stored cookie
var cookieValue = $cookies.get("cookie_name);

Is including additional information in the output object a good idea?

I'm experimenting with a Conversation where I would like to modify the output in a couple of different ways:
different output for speech or text
different output depending on the tone of the conversation
It looks like I can add extra output details which make it through to the client ok. For example, adding speech alongside text...
{
"output": {
"speech": {
"Hi. Please see my website for details."
},
"link": "http://www.example.com",
"text": {
"Hi. Please see http://www.example.com for details."
}
}
}
For the tone, I wondered about making up a custom selection policy, unfortunately it seems to treat it the same as a random selection policy. For example...
{
"output": {
"text": {
"values": [
"Hello. Please see http://www.example.com for more details.",
"Hi. Please see http://www.example.com for details."
]
},
"append": false,
"selection_policy": "tone"
}
}
I could just add a separate tone-sensitive object to output though so that's not a big problem.
Would there be any issues adding things to output in this way?
You can definitely use the output field to specify custom variables you want your client app to see with the benefit that these variables will not persist across multiple dialog rounds (which they would if you would add them to the context field).
Now currently there is no "easy" way how to define your custom selection policy (apart from the random and sequential supported by the runtime right now) - but you could still return an array of possible answers to the client app with some attribute telling the client app which selection policy to use and you would implement this policy in the client app.

How to change kik bot config?

It seems like after initial config POST request I can't change any properties (webhook and features), what is the way to change those? is this a temporary bug? :)
{
"webhook": "http://example.com/api/kik",
"features": {}
}
what I get
{
"webhook": "http://example.com/incoming",
"features": {
"receiveReadReceipts": false,
"receiveIsTyping": false,
"manuallySendReadReceipts": false,
"receiveDeliveryReceipts": false
}
}
The python library has a set_configuration function, that if called with a Config object with just a webhook set, will set the webhook. See http://kik.readthedocs.org/en/latest/user.html#configuration, though there’s a bug in those docs right now, the seconds function is set_configuration
If you aren't using that library can you show me what code you are using. Blank out your bot-name and api-key

How to NOT delete a file in a Azure FTP connector action if the transfer fails in a logic app

I have a successful connection setup between a FTP site and dropbox using a azure logic app. But while setting it up it kept just downloading the file then, since I had the next step wrong, deleting.
In a test environment this is annoying. In production, pretty awful.
Here is the code I am using on the action part:
"operation": "UploadFile",
"parameters": {
"FilePath": "#{triggers().outputs.body.FilePath}",
"content": {
"Content": "#{triggers().outputs.body.Content}",
"ContentTransferEncoding": "None"
},
"overwrite": true
},
Is there anything I can do so that if it fails it leave the file on the server?
I'm not 100% sure what you mean, but I will give it a try. Maybe you can reformulate the question if I misinterpret you.
But yes, there exists "conditions" in Logic Apps which can be used. If you are new to Logic Apps I'd suggest you use "designer view" and you can then click "Add condition to be met". This would visualize a text box in which you can formulate conditions. For instance:
#equals({your data}, bool('true'))
To check if some value is true, or something similar to check if data is null.

Resources