Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Visual Studio: use configuration other then develop #298

Open
h3yduck opened this issue Mar 27, 2020 · 4 comments
Open

Visual Studio: use configuration other then develop #298

h3yduck opened this issue Mar 27, 2020 · 4 comments

Comments

@h3yduck
Copy link

h3yduck commented Mar 27, 2020

Hi!

Is it possible to choose AZDS configuration when running from Visual Studio? There isn't a dropdown for this on the UI and specifying commandLineArgs in launchSettings.json is ignored by AZDS.

Thanks in advance!

@h3yduck
Copy link
Author

h3yduck commented Mar 27, 2020

I've also tried devSpacesConfigName and alike in launchSettings.json, none of them work. I would also be happy with setting an environment variable like MS_VS_AZUREDEVSPACES_TOOLS_LOGGING_ENABLED for logging but couldn't find a documentation for this anywhere.

@amsoedal
Copy link
Collaborator

Hi @h3yduck ,

  1. Are you trying to pass command line arguments to your own application, or to the AZDS process? If you want to configure how your application is run, have you seen if editing the azds.yaml file in your project directory can give you what you need?
  2. For logging, if you want to see logs from Dev Spaces, you need to have a line in your ~/.azure/config file like this under the [logging] section:
[logging]
enable_log_file = yes

(You can also accomplish the same thing with the AZURE_LOGGING_ENABLE_LOG_FILE environment variable.) After enabling this, you should see logs in these directories, depending on your OS:
For Windows: %TEMP%/Azure Dev Spaces
For OSX/Linux: $TMPDIR/Azure Dev Spaces

Let us know if this helps!

@h3yduck
Copy link
Author

h3yduck commented Mar 28, 2020

Hi @amsoedal ,

Thank you very much for the quick response!
Logging is working fine, I have problems with specifying a development configuration for AZDS. Let me bring you up to speed on what I'm trying to achieve:

We run our services on multiple environments, let's call them A and B.
I created development configurations for both of them in azds.yaml:

configurations:
  A:
    install:
      set:
        vault: vault-of-env-A
        # some other value overrides...
  A:
    install:
      set:
        vault: vault-of-env-A
        # some other value overrides...

Running azds up --config A and azds up --config B from the CLI works fine: it's overriding the desired values specific to A or B environment.

I would like to do the same but inside Visual Studio. It defaults to a development configuration called develop and I couldn't find a way to use anything other than that. Is there a way (setting an environment variable/field in launchSettings.json/some setting in Visual Studio/etc.)?

@danegsta
Copy link

danegsta commented Apr 1, 2020

Hey @h3yduck,

There's currently some basic functionality in the VS extension to support changing the deployment configuration we use when deploying to Dev Spaces. You can edit the .csproj file for the DevSpaces project to add an MSBuild Property for DevSpacesConfiguration that sets the configuration name to use.

For example:

<PropertyGroup>
  <DevSpacesConfiguration>A</DevSpacesConfiguration>
</PropertyGroup>

That's definitely not as straightforward or flexible as the config flag from the CLI though. I'll add a work item to our backlog to support specifying a custom config name in the launch profile.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants