I want to automate the workflow to send out mail notifications once Load test under Azure Devops project is completed. I get to see there is no direct option available for the same. Please suggest what could be the best suitable solution.
I have created a simple URL based Load test and ran it. One way I already tried is using Devops REST API and get the status in Azure function. But that is tedious process. Please help in this.
result expected is immediately once Load test is done, there should be email triggered to the group or individual members
For now, the way you mentioned might be the way to go, as Azure DevOps does not provide notifications from this type of events OOB. Please submit your suggestion here.
References:
Default and supported notifications
Supported event types
Meanwhile, another idea I had was to have this test configured as a task in a Pipeline, so that you get an email notification sent upon build completion. However, do note that while the Cloud-based Load Test task can be added to a Job as of today, it has been deprecated, with these options as alternatives.
Related
I am totally lost in this point I have finished my subscriptions payment from android application and I need to listen for any subscription on my own backend server to give subscriber the service, but I don't know how to make this happen in proper way, if any one had experience in this point please help .
I haven't find any thing useful in google documentation or YouTube .
thanks
I need step by step to make it work.
You need to enable PUB/SUB API in your project; check this quick guide and also ensure that you have selected Android Management API is enabled.
Once you have enabled the API you need to create a topic which can publish notifications. You can do it manually in GCP console and by using Pub/Sub topic method
Now you need to create a subscription which captures the stream of messages published. check create subscription method.
Grant Android device policy and you cand do them manually from console or by Pub/Sub; check this.
You need to call enterprises.patch to specify the below parameters
pubsubTopic: projects/{project}/topics{topic}.
enableNotificationTypes: ENROLLMENT, STATUS_REPORT and COMMAND.
You can use Pub/Sub API to get notifications.
I'm trying to build an app to help a friend with diabetes. The diabetic will click a check in button on a phone app which will call an azure function passing an email address/mobile number etc, a duration stating when they can next check in, and another duration which specifies when it is too late to check in. If the diabetic doesn't check in during the allowed window an email or text will be sent to alert someone that the diabetic hasn't checked in. If they click the button in the next check in window the previously scheduled work needs to be cancelled (or perhaps something with state needs to be set that can then be checked before sending the email).
I have built the phone app and have managed to get a HttpTriggered function to email me. I'm now a little bit stuck. How do I schedule something to happen at a specific point in the future and how could I cancel it following the correct user interaction? Any help would be much appreciated.
I suggest you look into Durable Functions, which is an extension for Azure Functions (installed as a NuGet package) that allows running long running workflows (incl waiting for events and timers).
This extension uses storage queues and tables under the hood, but you only need to know the Durable Functions API. You also don't need to provision any other Azure services, since a Storage Account is already used by your Function App.
In your case you could use the Human Interaction pattern in combination with timers.
I have quite some video's explaining Durable Functions, you might find these helpful: https://youtube.com/playlist?list=PLoSzmz8jSD1fahiSdKdf4073AOdti_rx8.
How do I schedule something to happen at a specific point in the
future
You can make use of a Queue triggered Function (you can either use Azure Storage Queue or Azure Service Bus Queue).
Basically the idea is that you send the message to the queue with a visibility timeout so that the message only appears in the queue when you are ready to process it. This you can do in your HTTP triggered Function.
how could I cancel it following the correct user interaction?
This is where things get interesting!
The way you could do it is have some field in your database which would indicate that the user has already interacted and no further processing would be required.
Your Queue triggered Function would still fire but what you would do is first check your database if any further action is required.
If no action is required, then you would simply let the Function complete so that the message is removed from the queue.
If any action is required, then you would perform that action and then let the Function complete so that the message is removed from the queue.
I am building bots based on the QnA Maker and the Microsoft Bot Framework V4 on C#. I have several Knowledge Bases and i want to verify that the bot responds with the right Answers to my questions. Is there a way to automatically test this type of bot?
And is there a possibility to implement this automated testing process into Azure Pipelines?
I can't help you with C# specifically, but I am doing this type of testing with my nodejs bot so this may be of some help. I replied to another of you questions here where I've given my specific nodejs code for testing. This answer will focus more on the approach to automate testing and use Azure Pipelines to execute it.
I'm using mocha as my test framework, but if there is something similar in C#, this method should work. This is where my knowledge is incomplete; I don't know what the C# equivalent of npm test is.
Anyway, I'm hopeful that my approach in nodejs is transferrable for you in C#. I want to mention up from that there are really two different approaches you can take to implementing your test.
Create a test bot adapter and simulate your entire bot, testing specifically recognizing the utterance, sending it to QnA Maker, processing the response as necessary, and posting the response to user (and validating that response content).
Make a REST call directly to QnA maker and validate the result
If you are concerned about the bot processing the activities correctly, invoking the QnA Maker connecter at the right time, parsing the response correctly, AND having the correct answer, go with option 1. If you simply want to make sure your QnA Service is functioning and returning the expected results, you can go with method 2. Personally I use method 1, but I mock the webservice response (using nock from the npm library) so I'm not testing QnA Maker at all, only the bot. Having live tests in your pipeline (if your tests determine if a release is created or not) can be problematic.
If you check the answer on your other question, that should give you the approach needed for option 1. For option 2, I would suggest using an Azure Function and just write your own test to make the REST call to QnA Maker and validate the result.
Either of these tests can be done in Azure Pipelines. For nodejs/option 1, I just run the npm test command which is configured to execute all of my test files. If any tests fail, the pipeline fails and (per my configuration) no release is created. I am unsure what the equivalent is for C#. For option 2, honestly I wouldn't even worry about putting it in the pipeline because it's independent from your bot code. Just set up your testing schedule in Azure Functions (if that's what you use) or whichever execution trigger you want, and have some actionable output. E.g. I have a live integration tester in Azure Functions which is a similar concept, and it sends out service down and service restored messages based on results and changes in status.
I am using HTML Agility pack in Xamarin forms to scrape data from a website. When a condition returns true, I want to send a push notification to all users. However, this data is changing a lot and I think it would cost a lot of internet data and maybe battery, if the device with this app is constantly collecting the data in the background to check a certain condition.
This is a piece of the code to give you an idea:
var url = "https://www.goal.com/en-us/live-scores";
var httpClient = new HttpClient();
var html = await httpClient.GetStringAsync(url);
var htmlDocument = new HtmlDocument();
htmlDocument.LoadHtml(html);
var voetbalWedstrijdenHTML = htmlDocument.DocumentNode.Descendants("div").Where(node => node.GetAttributeValue("class", "")
.Equals("main-content")).ToList();
So I thought it might be a good idea to let only one device use this code and check if the condition is true and then only send the push notification to all users. I've made this image to give you a better idea about what I mean.
I thought it might be a good idea to use firebase messaging to send push notifications to all users, but how or what do I use to have only one device checking the C#? Should I use a website with the C# code that is running 24/7 (is this possible?), or something else? So... how do I run C# code 24/7?
EDIT:
I found out about 'Firebase functions'. Would this work for me? I'd have to change to javascript so I rather stick to C#.
Here's how i would have done it
Create an Azure web job that checks the condition. You can schedule it to run according to your requirements.
Create an Azure notification hub (ANH) and link it to Firebase and equivalent in IOS and other platforms as per requirements.
Create a web api that every app user will call. In this api call, register every device with Azure notification hub. The registrations can include tags to which you can send notifications to.
When the web job needs to trigger a notification, it will call the ANH directly or through the web api and send a broadcast notification. You can also narrow down the users to send notifications based on tags.
One advantage of using ANH is that you don't need to worry about sending to multiple platforms. You just send to tags it will go corresponding users of all platforms.
I believe that this document may help you. https://learn.microsoft.com/en-in/azure/notification-hubs/. Hope I have helped.
EDIT:
Would you be using 2 projects: Yes you would be using atleast 2 projects. One for web api and 1 for each platform that you want your app to be in.
Point in Using Azure Notifications: It comes with great deal of features that will make your life easier especially if your application runs on multiple platforms. However, you can use FCM directly. Actually ANH will also use FCM behind the doors.
Putting the code you want to run every some time in Startup.cs: Thats a bad idea. You should ideally be using a web job for that. Startup code is executed only once in lifetime of application. You don't want your notification trigger code to be in Startup class. However if using webjob is not something you want, you can be using the cron scheduler.
EDIT 2:
You can use the timer in Startup.cs however, i would not recommend that. One class should ideally have only one purpose and business logic is not for Startup. You should consider moving out the method to another class.
If you decide to use webjobs, you would create different projects for web job. These offerings like ANH, web job etc exist for one reason - to make your life easier. You can always do everything on your own if you are ready to work extra mile.
PS web job is becoming obsolete and people are now moving to Azure functions.
I have read it on few msdn forum that test Management service in Team Foundation Server raises notifications on some specific actions by its users. You can subscribe
to these notifications to understand what’s going on in the server. Here are some of the important notifications which are raised by test management service.
TestRunStartedNotification
TestRunChangedNotification
TestRunCompletedNotification
TestPlanChangedNotification
TestSuiteChangedNotification
TestConfigurationChangedNotification
Can anybody share the step for it like how to set alert for this
after TestRunCompletedNotification mail should be sent to user. Can
it be done through MTM. I know TFS alert but i want to it for
specific suite or plan that email should be sent after test run
over.
please help
If you start automated tests manually from MTM, there is no default way like TFS alert for these events. To use these services, you need to create a listener to listen to these events. That means you have to use TFS API and implement sending e-mail yourself. You can check the blog on how to create a event handler: http://vgaltes.com/index.php/2013/04/14/create-a-team-foundation-server-event-handler/
If you only want to get alert of the test result, you can create a build definition using LabDefaultTemplate, and use this build definition for starting your tests instead of starting them from MTM. Each time, you want to run tests, you can queue this build. In this way, you can create Build Alerts in TFS to get notification of the test result.