Open kumarmo-2 opened 11 months ago
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @antcp @AzureAppServiceCLI.
I believe this is a root cause of an issue I've been debugging as well: volume mounts don't show up (e.g. the directories don't exist in the container) when I programmatically start a Container Apps Jobs execution, but they do when I start them from the UI (Run now
) or via the az
CLI.
Here's an example az
CLI invocation:
az containerapp job start \
--name ... \
--env-vars '...' \
--command '...' \
--image ... \
--resource-group ... \
--verbose
# And the output:
Request URL: 'https://management.azure.com/subscriptions/.../resourceGroups/.../providers/Microsoft.App/jobs/.../start?api-version=2024-03-01'
Request method: 'POST'
Request headers:
... removing irrelevant headers ...
'Content-Type': 'application/json'
'CommandName': 'containerapp job start'
'ParameterSetName': '--name --env-vars --command --image --resource-group --verbose'
Request body:
{
"containers": [
{
"image": "...",
"name": "...",
"command": [
"..."
],
"args": null,
"env": [
...
],
"resources": null,
"volumeMounts": null
}
],
"initContainers": null
}
The "volumeMounts": null
is the main difference versus what the Azure Go SDK would generate, and my guess is that the API backend interprets null
as "use the default volume mounts for the Container Apps Job", whereas it interprets the absence of the "volumeMounts"
key as "don't add any mounts". I don't know if those semantics necessarily make sense, but they're my best guess as to what is actually happening.
I'm running github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3
, but even the latest v3.1.0-beta
doesn't contain a volumeMounts
option
Bug Report
import path of package in question: ` aca "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v2"
SDK version:
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0
go list -m <module>
, for examplego list -m github.com/Azure/azure-sdk-for-go/sdk/azcore
.output of
go version
: go version go1.21.5 linux/amd64go sdk
. I want to pass the arguments to my app running in side the container. To do that, I need to define the template for the container(I had already defined in when created the job).Below is how i am defining the template.
The behavior i am seeing doing this is that, my volume mount and my environment variables that i defined at the time of job creation are not present when the job is running.
Now what i believe is happening here, is basically its overriding the configuration that i created at the time of the job creation. I could have done that, but I am seeing no way to attach volumes to the container. Although i can define environment variables.
The struct
JobExecutionTemplate
, allows me to defined theContainers
andInit Containers
but not volumes. This is a deal breaker for me to use jobs.What did you expect or want to happen? Either i wanted to be able to just pass the arguements to the container in the job or able to also attach volume to the container job.
How can we reproduce it? Basically create a container job with volume and environment variables defined and try passing just the arguments to the container.
Anything we should know about your environment. I am running the job on dedicated workload profiles