'What is 'az acr build' with a local context doing under the hood?

I was trying to do this in Pulumi where I had a local Dockerfile and wanted it to be sent to build the same as the command 'az acr build' sadly it kept erroring as it wanted a full url.
I did some digging but I can't quite figure it out. I'm not a developer as such, just a dabbler. what is az acr build doing under the hood and can this be replicated using the APIs ?

This is the build command https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/acr/build.py

And it also calls this as part of it https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/acr/_archive_utils.py

What it seems to be doing is calling the api to get a storage account and sas that lives behind the ACR and then Tar/gzip and uploading to it and then referencing it? But I can't find any documented behaviour for that for ACR. Like how do you see that zip and remove it once it's built. That kind of thing.

https://docs.microsoft.com/en-us/rest/api/containerregistry/registries%20(tasks)/get-build-source-upload-url

If anyone can explain what's going on there that would be great thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source