Azure Notification Hub, what is 'top' when retrieving Registrations - azure

The Azure NotificationHubClient has a function called GetRegistrationsByChannelAsync, and one of the parameters is an int called top, as shown below.
I assumed top is referring to the max number of retrieve, e.g top 100 items. But at the same time it could be referring to the location to start the retrieval, for example top = 100 would start the retrieval at position 100 onwards.
However, the documentation says top refers to "the location of the registration".
I am certainly missing something obvious, but what does top really refer to here?

Related

How to use ODATA skip and top on Power Automate SharePoint GetItems?

I need to get all the items of a SharePoint list and send as JSON
But the default is 100
If I set a larger number like 10000 it gives this error on the flow:
The attempted operation is prohibited because it exceeds the list view threshold.
So I am trying to get it in batches of 350 items.
But how can I use the Filter Query to start at a position x and return y items?
I tried
$skip eq 350
But this error occurs:
Column 'skip' does not exist
I think your question has 2 layers to it.
To increase the number of items returned by the Get Items Actions from Sharepoint you need click on the three dots on the left side of the action, and then go to Settings and you will see the image below, then set the size to 5000, that means your Get Items action will now return a maximum of 5000 items.
$top and $skip - I am not too confident what you are trying to do with this but perhaps share a bit more context, it sounds like you want to build a dynamic pagination ? Please explain this part unless the first point already achieve what you were aiming for

Azure Maps Indoor Module: Change floor without user input

I've been working with the Azure maps indoor module https://learn.microsoft.com/en-us/azure/azure-maps/tutorial-creator-indoor-maps . You can allow a user to pick a level with a level control element from the library, however I cannot figure out a way to pre-set a certain level (e.g. I want to start with a certain facility and the 2nd level pre selected when the map loads.) For the facility there is a indoorManager.setFacility() function that allows you to select a facility but I have not found the equivalent for the level.
Requirement: I want to to select a level in Azure Maps without user input.
There doesn't appear to be any official way to do this yet, note that Azure Maps Creator is still in preview. That said, I did figure out a hacky way around this (may break in the future).
var facilityId = 'FCL13';
var level = 2;
//Set the facility and the levels "ordinal number". The ordinal number appears to be off by 1.
indoorManager.setFacility(facilityId, level - 1);
//Used to trigger the level control to refresh.
map.events.invoke('moveend')

How to get alerted for new (unique) errors

A useful feature of application monitoring services is sending alerts (e.g. emails) each time a new, unique error/problem/exception occurs (i.e., not for each occurrence). Either only the very first time, or at most once per X time (a day or week or such). This is, for example, possible with Visual Studio App Center. Unfortunately I haven't been able to find any such feature in Application Insights.
For clarification, a "new, unique error/problem/exception" can be thought of as a specific log statement in the code. I'm using Serilog, so all logged traces/exceptions have a MessageTemplate property which may help. But ideally the "problem ID" would be based on the code location, too (since multiple log statements may use the same message template).
The best lead I have found is the ability to send alerts based on a custom analytics query, but I'm not sure if it's possible to write a query that can give a behaviour similar to (if not exactly like) to what I describe above.
Is something similar to the behaviour I describe above possible to achieve with Application Insights? If it's possible through a custom query, how might such a query look?
Just through UI of azure portal, it's hard or impossible to achieve your first requirement: alert only the very first time. But you can try to use app insights rest api to fetch the data, then use code to implement your logic.
There is a similar solution(not exactly like you describe) for alert once per X time. The steps are as below:
1.Nav to azure portal -> you application insights -> Alerts -> new alert rule -> in the Condition, click Add button -> then select "Custom Log Search"
2.In the "search query" textbox, write your query like below:
exceptions
| where xxxx
Note that in the where clause, use some properties to identify the unique error.
3.Then in the "Alert logic", use the following settings:
Based on: Number of results, Operator: Greater than, Threshold value: 0
4.In the "Evaluated based on", set proper value for Period(max value is 2880 minutes) / Frequency(max value is 1440 minutes).
So if you want to trigger alert 1 time per day, you can set Period to 1440 minutes, set Frequency to 1440 minutes. But you also need to note that, if in the next day, there is no such specified error, it will not trigger in the next day.

Clearing the "Group by" drop down on the Application Insights portal

I have a new Windows Application that I am adding Application Insights to. Adding a new chart gives the ability to Group on specific custom properties using a drop down. This drop down has 65 properties that AI must have added at some point. There were not specifically added.
We have a main AppInsights that takes all events. We've also created a AppInsight for development. The list of custom properties in the drop down is different between these two, even though the source code is the same.
It makes me suspect that there is some process that creates the drop down contents based on the incoming data.
The problem here is that the code has changed, and some properties are no longer available. We want to eliminate these values from the drop down, and add the new ones.
I am perfectly happy just deleting the entire list. Is there a way to do this?
The items that are available in the group by are properties that have ever been received by the back end in data you've sent, and aren't editable.
for custom properties/metrics, there's a limit on how many properties the backend will allow before it stops collecting new named custom properties. Conceptually, think of it as the backend storing an array of 200 elements for each telemetry item you sent, and mapping each custom property name to an index, and that mapping lasts forever. (i believe at the current time that limit is 200 each, but we're working on expanding that)
so if developers did things in your dev portal, even sent one item with custom property "foo", then that property will be there forever, and takes up one of those 200 slots. They can't be deleted or cleared at the moment.
Also, the contents of the group by box is also limited to events that have sent less than some threshold of distinct values, too. (I'm not sure on that exact value, but i believe it < 100 distinct values.) So fields like Id fields, or guids, etc, will eventually stop showing up as group by options, because the group by would create N distinct buckets of 1 item.
It seems like this would be something already mentioned in the App Insights UserVoice site, or documented in the azure documentation for group by but i'm not seeing it.
The only real workaround at this time is to create a new application insights resource in azure, and start submitting data to that new resource instead of your old one. And then you have to be proactive about never submitting custom properties that you're never going to use, or mixing case, as "Property1" and "property1" will be distinct properties...
If this is a big issue for you, i'd suggest submitting it to microsoft connect as a bug, or entering a uservoice suggestion above. I'll pass this on as something that really needs to be documented in the group by thing in the azure docs, too.

Expression engine: Maximum number of entries allowed per membrr group

Is it possible to limit the number of channel entries a member can create?
I would like to set a max number per member group.
Thanks
Yes, but it would require writing an extension. The logic would be something like this (assuming you're talking about limiting on the back-end ... from the front-end, if you're using a Safecracker entry form for example, you'd need to take a different approach):
use the sessions_end hook
check to make sure you're in the control panel ($this->EE->input->get('D') == 'cp')
check to make sure you're on the publish screen ($this->EE->input->get('C') ==
'content_publish')
query the database to see how many entries in exp_channel_titles with the channel_id of $this->EE->input->get('channel_id') belong to $this->EE->session->userdata('member_id')
if the result is greater than your allowed maximum, show them an error
That should get you started.

Resources