Design and Implement Microsoft DevOps Solutions: Automating Webhook for Contoso Repository

Automating Webhook for Contoso Repository

Question

SIMULATION -

You need to ensure that the https://contoso.com/statushook webhook is called every time a repository named az40010480345acr1 receives a new version of an image named dotnetapp.

To complete this task, sign in to the Microsoft Azure portal.

Explanations

See explanation below.

1. Sign in to the Azure portal.

2. Navigate to the container registry az40010480345acr1.

3. Under Services, select Webhooks.

4. Select the existing webhook https://contoso.com/statushook, and double-click on it to get its properties.

5. For Trigger actions select image push

Example web hook:

https://docs.microsoft.com/en-us/azure/container-registry/container-registry-webhook

Sure, I'll provide you with a step-by-step guide on how to ensure that a webhook is called every time a repository receives a new version of an image.

  1. Log in to the Azure portal (https://portal.azure.com/).

  2. Go to the Azure Container Registry where the repository is located.

  3. In the Azure Container Registry, navigate to the repository named az40010480345acr1.

  4. Click on the Webhooks tab.

  5. Click on the + Add button to create a new webhook.

  6. In the Add webhook panel, fill in the following details:

    a. Name: Enter a descriptive name for the webhook.

    b. Payload URL: Enter the URL for the webhook endpoint. In this case, the URL should be https://contoso.com/statushook.

    c. Resource group: Select the resource group that contains the Azure Container Registry.

    d. Subscription: Select the subscription that contains the Azure Container Registry.

    e. Action: Select Push.

    f. Status: Select Enabled.

    g. Headers: If required, you can add any custom headers that the webhook endpoint requires.

    h. Basic authentication: If required, you can add basic authentication credentials.

  7. Click on the Create button to create the webhook.

  8. Once the webhook is created, any time a new version of an image named dotnetapp is pushed to the repository named az40010480345acr1, the webhook endpoint at https://contoso.com/statushook will be called.

That's it! You have successfully ensured that a webhook is called every time a repository receives a new version of an image.