exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 8 question 7 discussion

Actual exam question from Microsoft's AZ-400
Question #: 7
Topic #: 8
[All AZ-400 Questions]

SIMULATION -
You need to ensure that the https://contoso.com/statushook webhook is called every time a repository named az400123456789acr1 receives a new version of an image named dotnetapp.
To complete this task, sign in to the Microsoft Azure portal.

Show Suggested Answer Hide Answer
Suggested Answer: See explanation below.
1. Sign in to the Azure portal.
2. Navigate to the container registry az400123456789acr1.
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:

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

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Willsmt
Highly Voted 8 months, 3 weeks ago
I got this and 7more of this labs in a single shot and 1 use case, labs when you start a lab you will have the labs in a right panel and a kind of virtual machine in the middle (this will be a simulator where it will open a browser with the azure portal page)
upvoted 8 times
...
vsvaid
Most Recent 11 months, 2 weeks ago
Correct answer
upvoted 1 times
...
makros88
2 years ago
I think that solution is partially correct. We also need to setup scope to "dotnetapp:*" based on https://learn.microsoft.com/en-us/azure/container-registry/container-registry-webhook: "The scope at which the webhook works. If not specified, the scope is for all events in the registry. It can be specified for a repository or a tag by using the format "repository:tag", or "repository:*" for all tags under a repository." example here https://learn.microsoft.com/en-us/azure/app-service/deploy-ci-cd-custom-container?tabs=acr&pivots=container-linux az acr webhook create --name <webhook-name> --registry <registry-name> --resource-group <group-name> --actions push --uri $ci_cd_url --scope '<image>:<tag>'
upvoted 4 times
xRiot007
1 year, 4 months ago
Technically the answer is correct without the scope because the requirement does not say to restrict all other events.
upvoted 2 times
...
AzureJobsTillRetire
1 year, 11 months ago
The scope probably should be set as “image:dotnetapp”
upvoted 2 times
mfawew223
1 year ago
My first inclination was to agree with image:dotnetapp, but: https://learn.microsoft.com/en-us/cli/azure/acr/webhook?view=azure-cli-latest#az_acr_webhook_create-optional-parameters This source defines the optional 'scope' parameter as: The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means events for all repositories.
upvoted 1 times
mfawew223
1 year ago
'Bar' must be the tag. So in this case, the repo is az400123456789acr1, so thats the first part of the scope. It doesnt say that the image dotnetapp is tagged, but if it were tagged with 'dotnetapp', then you would do: 'az400123456789acr1:dotnetapp' as the scope. I am not 100% on this, because its possible that images in a repo are treated as separate "repos" under the scope parameter. I wasnt able to dig up many examples of it.
upvoted 2 times
...
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...