Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options for pre-commands and environment variables to lambda package command #329

Open
2 tasks
mark-hopper opened this issue Jul 17, 2024 · 5 comments
Open
2 tasks
Labels
feature-request A feature should be added or improved. module/cli-ext p2 This is a standard priority issue queued

Comments

@mark-hopper
Copy link

Describe the feature

Add an option which will allow you to specify a set of commands to be pre-pended prior to the dotnet publish command when using package. Additionally it would be really useful to be able to specify additional environment variables sent to the docker container that is ran.

Use Case

When using a private NuGet feed, we need to make use of appropriate PAT tokens or credentials. In our specific use case we'd like to use the Azure Artifacts Credential Provider, but this requires some installation and setup prior to the dotnet publish command.

In the case of the installation, I'm aware we can go ahead take the base image, add what additional tools we need, and then use the -cifb switch to specify the appropriate container. But this is only part of the problem, in order to use the credentials provider we need to specify additional environment variables namely VSS_NUGET_EXTERNAL_FEED_ENDPOINTS which currently as far as I can see the CLI does not support us providing as part of the build.

For context the above is in reference to a .NET 8 AOT Native build.

The only workaround that I can see currently, is to specify the credentials in plaintext in the Nuget.Config file at the root of the project prior to running the dotnet lambda package command, which is not ideal.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Targeted .NET platform

8.0.303

CLI extension version

5.10.7

Environment details (OS name and version, etc.)

MacOS Sonoma 14.5

@mark-hopper mark-hopper added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jul 17, 2024
@bhoradc
Copy link

bhoradc commented Jul 17, 2024

This needs to be reviewed with the team.

@bhoradc bhoradc added needs-review p2 This is a standard priority issue queued and removed needs-triage This issue or PR still needs to be triaged. needs-review labels Jul 17, 2024
@normj
Copy link
Member

normj commented Jul 22, 2024

Hi @mark-hopper, why wouldn't you set the VSS_NUGET_EXTERNAL_FEED_ENDPOINTS environment variable yourself before executing the the dotnet lambda command. Or is this to get the container environment that dotnet lambda is spinning up for AOT to have this set?

@mark-hopper
Copy link
Author

@normj this is for the latter case in your question, there is no means to set additional environment variables against the container, nor install the required tools I need prior to running the dotnet lambda package command

@normj
Copy link
Member

normj commented Jul 23, 2024

That makes sense, so should it be a switch to specify script file that runs once the container is started? I would rather not have this tool be the one to figure out how to run the commands because I can imagine users coming up with complicated scenarios that shell scripts already solve.

@mark-hopper
Copy link
Author

@normj I can see your concerns, and would agree if you add a switch to specify a scripting file, it's then on the consumer of the command to manage the script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. module/cli-ext p2 This is a standard priority issue queued
Projects
None yet
Development

No branches or pull requests

4 participants