Closed dombarnes closed 1 year ago
@dombarnes Hey Dom, thanks for filing this issue -- I just want to confirm the behavior that you're seeing with this task:
The step you've provided at the end of your issue (under the azure-pipelines.yml
text) is what you're providing that results in the error message saying that 'uk-west' is not currently supported?
The location of a Container App is tied to the location of the managed environment that the Container App was created in, so if you're using an existing managed environment and provide a location, that location will be ignored in favor of the location associated with the managed environment. (There is currently no way for a Container App managed environment to migrate regions)
I did some further testing and think I found the solution. Unfortunately my code of azure-pipelines.yml
above was misleading.
My project actually had a repo checkout
stage because my deploy step is not in a deploy strategy block (In my actual pipeline, i am doing a DockerC. My project also has a .azure/config
file which specifies a default location for the azure CLI (guess where - UK West). Once I removed the checkout stage, the AzureContainerApp stage proceeded.
The command az containerapp up -n my-app-name -g my-resource-group -i myacr.azurecr.io/myimage:dev --ingress external
does not pass the location as an argument so it defaults back to the .azure/config
setting.
Location 'uk-west' is not currently supported. To get list of supported locations, run 'az provider show -n Microsoft.App --query "resourceTypes[?resourceType=='managedEnvironments'].locations"'
I can also assume that by checking out the repo, your working directory is moved from Pipeline.Workspace
to DefaultWorkingDirectory
So by setting checkout: none
in my pipeline (contradictory to my snippet above) this solved the issue.
This seems like an undocumented fact, and if you are using this task and are required to build a Docker file in the process (i.e setting imageToBuild
) then you are going to checkout your required repo, and if that were to contain an azure CLI config file, then this would being applied in the background.
@dombarnes Hey Dom, thanks for the update -- I'm glad to hear that you were able to resolve your issue, and thanks for providing the additional context on what you found.
To follow-up on this, is there anything actionable on our side that you need from us? We can look at updating the documentation to call out the notes you made, but if there's anything else, please feel free to let me know.
I'm going to close this issue since it seems to be resolved, but we can continue discussing any follow-up items here and I'd be happy to reopen the issue if necessary.
The only follow up I would say is to clarify how location may be overwritten or ignored such as this case. My original assumption was that location was location was passed with a command line flag, which presumably takes priority over the .config file. So I was expecting to see the flag in my DevOps logs.
Secondary comment is that it was unusual that this action would try to create the resources needed when this isn't my experience with other Azure tasks. Most other deploy tasks I've used would just fail on missing resources.
Task name
AzureContainerApps@1
Task version
1.225.0
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
Ubuntu 22.04.2 LTS
Task log
Relevant log output
Aditional info
I am running this as part of a step in my CI template. However, it seems to be ignoring the location option, and as a result, giving me an error that it can't be run in UK West. The command runs as expected when run on my local development machine adding the
-l uksouth
argument to the same command line:az containerapp up -n my-app-name -g my-resource-group -i myacr.azurecr.io/myimage:dev --ingress external -l uksouth
azure-pipelines.yml