Skip to content

Is there a way to read a YAML file from stdin when creating containers #20293

@booyaa

Description

@booyaa

Action

We use envsubst to replace values in a YAML to allow us to reuse the template in multiple environments.

We would like to pipe the modified YAML into Azure CLI and use this as a stdin file (using @-):

envsubst < containers-template.yaml | az container create -g some-resource-group --file @-`

Expected outcome

Creates a container using the modified YAML

Actual outcome

Azure CLI tries to parse each line as a "YAML" file

No such file or directory: api-version: 2019-12-01
location: centralus
name: aci-name-of-container-group
<< shorten for brevity >>

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions