We would like to receive notifications once the user change SQL Server size from S9 to S12 (increase). Is this possible natively or can we develop custom webhooks to receive notifications?
This action gets logged to the Activity Log. See here. So with this you should be able to create alerts following this tutorial: https://learn.microsoft.com/en-us/azure/azure-monitor/platform/alerts-activity-log
Use the Usage and the RateCard APIs to get estimated cloud consumption and charges.
Usage API will get you a metricID which you can use in query using RateCard to predict the price,
https://learn.microsoft.com/bs-cyrl-ba/azure/billing/billing-usage-rate-card-overview
Sample is here
Another Option would be to create custom Azure Policy to audit SQL SKUs and then create an alert once the resource is not compliant with the Azure policy to notify users.
https://learn.microsoft.com/en-us/azure/governance/policy/samples/allowed-sql-db-skus
#silent's answer is probably the best option today. On top of this, you can also use Resource Graph to identify changes: https://learn.microsoft.com/en-us/azure/governance/resource-graph/how-to/get-resource-changes.
Related
I have an Azure function that runs a few times a day. I'd like to email myself a daily list of log messages, and wondered if I could use another Azure function for that?
Is it possible to read an Azure function logs from within an Azure function? Or is there another way to achieve the above?
Or is there another way to achieve the above?
Yes, you can use Azure Logic apps to get the logs of Function app recurrently.
I have created a logic app in Consumption plan, then created a workflow with Recurrence Trigger like below:
Then in next step I have chosen the Azure Applications insights like below:
Then I have opted send an email action and then I got the logs to my email :
Then in email I received logs:
I would propose two possible solutions in the realm of Azure.
In both cases I would suggest to include application insights.
It is a general recommendation by Microsoft.
Then goes what Peter Bons called "use case".
If it is enough for you get the critical information about recurring issues with N minutes of frequency, then you could make us of alerts. Last time I checked one needed to pay extra for each email, please double-check that.
If for some reason you want to have more control over what logs you want to send and fetch, you can fetch data directly from application insights through the REST API. To complete the idea you could use bindings that allow send emails (see here for practical points). I would say that there variations on how you can achieve fetching data, although the feature will be deprecated in two years.
Since the existing instagram APIs are deprecated, I am switching to the graph api.
Below is what i want to achieve and what the issue is.
Requirement.
I would like to track the number of likes and comments on instagram posts in which my business account is mentioned using #. I have setup the faccebook and instagram accounts along with the webhook. The webhook is going to send me the "mediaid" in which i my business account is tagged.
Since the app is in the development mode i am not receiving the webhooks if i mention the business account in any of the post, but i am able to send the test webhook from the developer account console. So i assume once the app is in LIVE mode it will start sending the webhooks to my server.
Once the "mediaid" is received i would like to make a call to another api https://developers.facebook.com/docs/instagram-api/reference/user/mentioned_media
in order to get the number of likes and comments.
I am facing an issue on the 2nd part. Whenever i call the api mentioned in the 2nd part i am getting the error
This api call works fine when i pass the mediaid that my instagram business account owns. But as soon as i pass the mediaid of the post which mentioned my business i am getting the above error.
I just wanted to check if this is also a limitation of my facebook app being in a development mode ? Please suggest a solution to achieve this scenario.
I tried the same what you did but with a live facebook app. From the webhook, I got an event when any other user mentioned my instagram business handle in caption and am able to fetch the mentioned media details using the mentioned media API https://developers.facebook.com/docs/instagram-api/reference/user/mentioned_media.
As you didn't share the webhook event payload, I am just assuming you are using the correct user id while making the API call. The JSON path of the user id in event payload is entry[0].id
My company has an internal application where I need to pull/display pictures of all the employees from office 365 with out user intervention.
From what I read online I think I need to call Microsoft graph getphoto API in daemon application to achieve this as per this link (https://developer.microsoft.com/en-us/graph/docs/authorization/app_only).
Will this be a right approach? If yes please point me to any C# sample codes related to this.
Appreciate your responses.
Yes, this is exactly the type of application you will want to build. App-only (machine-to-machine) authentication should be used anytime you don't need a user present to execute functionality.
You can take a look at the ASP.NET Core App Only sample to get a sense of how to register and set up your app to use app-only authentication. The sample goes on to use this access token to set up webhooks, but you can replace this logic with your custom code. You will want to select the scope User.ReadBasic.All to have access to users' profile photos.
We have the ability of "AutoLogin" in our systems.
So if I create a new user in AD as "John" - then John has the ability to access the intranet web site ( we query AD to see if the current user is in AD).
But
We also have a users table (SQL Server) which needs to have the FirstName and LastName of the new user.
We want to update that Users table each time a new user in AD is created - some C# code should be run to enter the relevant data into SQL Server (and some other things).
HOw can I catch the event of "new user in AD created" ?
Check out Ryan Dunn's excellent blog post:
Implementing Change Notifications in .NET
that deals with this exact topic. He offers three options:
Polling for Changes using uSNChanged
Polling for Changes Using the DirSync Control
Change Notifications in Active Directory
and shows pros and cons for each of the options, and some C# code for the third option (Change Notifications).
You can use System.DirectoryServices.Protocols.DirectoryNotificationControl from C# for this purpose so you don't have to poll AD for changes.
WMI is perhaps a second solution you can dig in.It exists AD WMI Providers. Using WMI to Monitor AD gives you some clues about that. This article don't do more than what you get so far, but I think that with WMI events you can create the notifications you need. You can find Microsoft informations about this begining in Monitoring Active Directory Health, especialy Active Directory WMI Providers.
It is unlikely that you can capture that kind of event without wrapping the actual function of adding the new user into some kind of c# routine. If you go down this route, you can add the used to AD and mysql at the same time.
Another option would be to poll the AD users and check this against the existing mysql users and add new when found.
I would like to know what is the possibilities to programmatically change data on Exchange Server?
with Exchange Web Service (EWS) can I (change means add/edit/delete):
change data on Exchange Server for other users?
change Global Address List?
if not, how I can do that programmatically?
we have a system that we need to make it communicate with Exchange Server to do different tasks, related to calendar, email, GAL
what is the best practice and approach I should think about?
cheers
I dont't know what about GAL, but surely You can manage users calendars(adding meeting,s adding taksks, ...) and emails(reading, sending etc.).
To manage other user accounts You have to enable impersonation.
Some time ago I wrote two posts on my blog how to impersonate Exchange Service Binding and how to add an appointment to any users calendar in Exchange. I won't paste the code here because it makes no sense, just here You have links if You're interested:
Impersonation
Creating appointment
But now it's easier way to achieve the same results as above, but with less lines of code thanks to Exchange Web Services Managed API 1.1 SDK. So, if You want to enable communication with excahnge You should read more about this API and see if it suits You and Your demands.