Notify when a container instance restarts

Francisco Dominguez 386 Reputation points
2022-01-11T08:01:36.317+00:00

Hi,

I currently have a container instance in my Azure subscription. This container instance is accessed by different entities via SSH to leave some kind of files in our storage account.

This container instance is set to restart on failure. I want to get notified when it gets restarted so I can notify those entities that they have to change their firewall rules, so that they can keep uploading their files.

How can I achieve this?

Thanks in advance.

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
757 questions
0 comments No comments
{count} votes

Accepted answer
  1. Manu Philip 20,206 Reputation points MVP Volunteer Moderator
    2022-01-11T09:15:38.133+00:00

    You can easily setup an alert rule to get SMS/Email or other methods to receive a notification regarding the restart of the container instance. Following are the steps to setup the alerts

    1. Go to Alerts as shown below from the container blade
      163861-image.png
    2. Select Alert rule from create button
    3. Under the 'Scope' section, make sure that the container instance is selected.
    4. Click 'Add Condition'. Select 'Restart Container Group' Signal and press 'Done'
      163872-image.png
    5. Under 'Actions' click 'Add Action Groups'. Click 'Create Action Group' in the window pops up
    6. Select the Subscription Name, Resource Group name. Under Instance Details, enter an action group name like 'alert' and display name
      163881-image.png
    7. Click Next: Notifications. Enter the preferred way of notification needed. Here, I am selecting the notifications to be received as email as indicated below:
      163856-image.png
    8. Review and Create the alert rule. The email entered will get a notification now to indicate that the email has been added to receive alerts.
    9. Under Alert rule details, enter a meaningful name and details so that the alert can be easily recognized up ton reception. Press Create Alert rule and you are done with setting up an alert while the container instance restarts.
      163818-image.png
    10. You may test the alert created, by manually restarting the container and verifying the alert received in your email something like shown below:
      163827-image.png
    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.