Thank you for raising this issue and providing detailed context.
We understand that you're facing difficulty securely accessing private pip repositories (e.g., Azure DevOps Artifacts) via PAT during custom Docker builds in Azure ML Studio.
Since Docker builds happen in isolated environments, Azure ML connections/secrets (including Key Vault and managed identities) are not available by default at build time. To resolve this:
Recommended Approach:
· Store your PAT token in Azure Key Vault.
· Use Azure DevOps Pipelines to inject this secret into the Docker build as a build argument (--build-arg).
· Modify your Dockerfile to read this argument and install private packages accordingly.
Alternate Options:
· Use multi-stage Docker builds and inject secrets later via environment variables during runtime in Azure ML.
· Explore using Managed Identity if supported by Azure DevOps Artifacts.
We also acknowledge your feedback on improving documentation and tighter integration between Azure ML and Azure DevOps for such workflows and will share this feedback to the product team.
Please refer below documents for better understanding:
Secret injection in online endpoints (preview)
Building custom Docker images for training and deployment
Leverage private packages when training and deploying models
Hope this helps.
Thank you!