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

WebJobs SDK needs to create and manage app.config transformations #5

Closed
robertmclaws opened this Issue Oct 18, 2014 · 21 comments

Comments

Projects
None yet
@robertmclaws

robertmclaws commented Oct 18, 2014

In a complex web application, WebJobs have the potential to be deployed in many different "environments" inside Azure. At AdvancedREI, we have 3 environments for beta, staging, and production. Since WebJobs are console apps, there is not built-in support for app.config transformations. I tried downloading a 3rd-party VSIX on the Visual Studio Gallery that is supposed to enable this, but Publishing from Visual Studio does pick up the transformed file.

It would be easier if the SDK would just allow this to happen automatically, either through improved compatibility with the 3rd-party VSIX, or through end-to-end added support.

Thanks!

@kobynet

This comment has been minimized.

Show comment
Hide comment
@kobynet

kobynet Dec 29, 2014

We face the same problem, was very helpful if this was out of the box feature.

kobynet commented Dec 29, 2014

We face the same problem, was very helpful if this was out of the box feature.

@johnkattenhorn

This comment has been minimized.

Show comment
Hide comment
@johnkattenhorn

johnkattenhorn Jan 2, 2015

I second that, it would be good to get some guidance on this from the team.

johnkattenhorn commented Jan 2, 2015

I second that, it would be good to get some guidance on this from the team.

@demirag

This comment has been minimized.

Show comment
Hide comment
@demirag

demirag Jan 5, 2015

Same problem here. Also an emulator would be nice to run/test those webjobs locally. Currently, I have to set a windows scheduled tasks and configure its schedule just to run everything correctly on development machine. I hope those features will be added soon.

demirag commented Jan 5, 2015

Same problem here. Also an emulator would be nice to run/test those webjobs locally. Currently, I have to set a windows scheduled tasks and configure its schedule just to run everything correctly on development machine. I hope those features will be added soon.

@bradygaster-zz

This comment has been minimized.

Show comment
Hide comment
@bradygaster-zz

bradygaster-zz Jan 7, 2015

I'm investigating this with the team and will keep this issue updated as we progress. Great feedback, we'll try to accommodate this.

bradygaster-zz commented Jan 7, 2015

I'm investigating this with the team and will keep this issue updated as we progress. Great feedback, we'll try to accommodate this.

@johnsone2

This comment has been minimized.

Show comment
Hide comment
@johnsone2

johnsone2 commented Jan 28, 2015

+1

@mrstick2000

This comment has been minimized.

Show comment
Hide comment
@mrstick2000

mrstick2000 Feb 5, 2015

This would be great for us as we need to use a transform to swap out log4net configuration depending on the environment that we are publishing to.

mrstick2000 commented Feb 5, 2015

This would be great for us as we need to use a transform to swap out log4net configuration depending on the environment that we are publishing to.

@kmaneshk

This comment has been minimized.

Show comment
Hide comment
@kmaneshk

kmaneshk commented Feb 13, 2015

+1

@DannyRyman

This comment has been minimized.

Show comment
Hide comment
@DannyRyman

DannyRyman Mar 26, 2015

Still no movement on this? This is the problem with MS at the moment: they build some new technologies to the point that they look good in a demo and then move on to the next thing without considering how this is going to be used in an enterprise environment. At the moment, web jobs are unusable for us without being able to transform that config files based on environment. In my opinion, MS approach to config transformation is a mess. Some project types support it out the box (websites), in some scenarios you can get it working using SlowCheetah and some customisation, and some scenarios there is just no solution to this problem. Grrr.

DannyRyman commented Mar 26, 2015

Still no movement on this? This is the problem with MS at the moment: they build some new technologies to the point that they look good in a demo and then move on to the next thing without considering how this is going to be used in an enterprise environment. At the moment, web jobs are unusable for us without being able to transform that config files based on environment. In my opinion, MS approach to config transformation is a mess. Some project types support it out the box (websites), in some scenarios you can get it working using SlowCheetah and some customisation, and some scenarios there is just no solution to this problem. Grrr.

@geekcubed

This comment has been minimized.

Show comment
Hide comment
@geekcubed

geekcubed Mar 26, 2015

I've worked around this by using CloudConfigurationManager ( https://msdn.microsoft.com/en-us/library/microsoft.windowsazure.cloudconfigurationmanager.aspx )

This will take app.settings stored in the container Website in preference to those in a app.config or web.config. This is fully compatible with command line (exe) WebJobs. Just change your code from appsettings to CloudConfigurationManager & set the settings once per website. Job Done.

geekcubed commented Mar 26, 2015

I've worked around this by using CloudConfigurationManager ( https://msdn.microsoft.com/en-us/library/microsoft.windowsazure.cloudconfigurationmanager.aspx )

This will take app.settings stored in the container Website in preference to those in a app.config or web.config. This is fully compatible with command line (exe) WebJobs. Just change your code from appsettings to CloudConfigurationManager & set the settings once per website. Job Done.

@kobynet

This comment has been minimized.

Show comment
Hide comment
@kobynet

kobynet Mar 26, 2015

@geekcubed there are more than just appSettings section in app/web config files (common logging, log4net etc....) which can't be transformed, you can make all this manually by code but do we really want to go in that path?

I agree with @DannyRyman with the fact that this is a big defect in the design and is a big issue for everyone who uses webjobs.

kobynet commented Mar 26, 2015

@geekcubed there are more than just appSettings section in app/web config files (common logging, log4net etc....) which can't be transformed, you can make all this manually by code but do we really want to go in that path?

I agree with @DannyRyman with the fact that this is a big defect in the design and is a big issue for everyone who uses webjobs.

@DannyRyman

This comment has been minimized.

Show comment
Hide comment
@DannyRyman

DannyRyman Mar 26, 2015

Indeed. In my current scenario I need a more complex configuration hierarchy. On a separate note, I don't think you need to use CloudConfigurationManager when using .Net 4.5 as the standard ConfigurationManager appears to pick up the settings from the portal.

Date: Thu, 26 Mar 2015 09:29:56 -0700
From: notifications@github.com
To: azure-webjobs-sdk-samples@noreply.github.com
CC: mail.dan.ryan@googlemail.com
Subject: Re: [azure-webjobs-sdk-samples] WebJobs SDK needs to create and manage app.config transformations (#5)

@geekcubed there are more than just section in app/web config files (common logging, log4net etc....) which can't be transformed, you can make all this manually by code but do we really want to go in that path?

I agree with @DannyRyman with the fact that this is a big defect in the design and is a big issue for everyone who uses webjobs.


Reply to this email directly or view it on GitHub.

DannyRyman commented Mar 26, 2015

Indeed. In my current scenario I need a more complex configuration hierarchy. On a separate note, I don't think you need to use CloudConfigurationManager when using .Net 4.5 as the standard ConfigurationManager appears to pick up the settings from the portal.

Date: Thu, 26 Mar 2015 09:29:56 -0700
From: notifications@github.com
To: azure-webjobs-sdk-samples@noreply.github.com
CC: mail.dan.ryan@googlemail.com
Subject: Re: [azure-webjobs-sdk-samples] WebJobs SDK needs to create and manage app.config transformations (#5)

@geekcubed there are more than just section in app/web config files (common logging, log4net etc....) which can't be transformed, you can make all this manually by code but do we really want to go in that path?

I agree with @DannyRyman with the fact that this is a big defect in the design and is a big issue for everyone who uses webjobs.


Reply to this email directly or view it on GitHub.

@benfoster

This comment has been minimized.

Show comment
Hide comment
@benfoster

benfoster commented May 13, 2015

+1

@vidaica

This comment has been minimized.

Show comment
Hide comment
@vidaica

vidaica commented Jun 25, 2015

+1

@mauricionr

This comment has been minimized.

Show comment
Hide comment
@mauricionr

mauricionr commented Jun 25, 2015

+1

@AlanParr

This comment has been minimized.

Show comment
Hide comment
@AlanParr

AlanParr Jul 20, 2015

@DannyRyman IIRC CloudConfigurationManager is just for Web Roles on Cloud Services, I don't think it is needed for any .net version on Web Apps.
For what it's worth, I'm using Git deployment for sites and WebJobs, so my solution to this is to put the settings for the jobs in the hosting site's web.config, prefixed with the WebJob's name. It's not ideal but has served me well so far.
I've found it much simpler to avoid config transforms completely, and use Powershell scripts to set the correctly overridden settings on each environment. As the WebJob has access to the hosting site's config, the WebJob will use values that have been overridden in the Azure portal at the site level.

AlanParr commented Jul 20, 2015

@DannyRyman IIRC CloudConfigurationManager is just for Web Roles on Cloud Services, I don't think it is needed for any .net version on Web Apps.
For what it's worth, I'm using Git deployment for sites and WebJobs, so my solution to this is to put the settings for the jobs in the hosting site's web.config, prefixed with the WebJob's name. It's not ideal but has served me well so far.
I've found it much simpler to avoid config transforms completely, and use Powershell scripts to set the correctly overridden settings on each environment. As the WebJob has access to the hosting site's config, the WebJob will use values that have been overridden in the Azure portal at the site level.

@abatishchev

This comment has been minimized.

Show comment
Hide comment
@abatishchev

abatishchev commented Sep 1, 2015

+1

@bspunie

This comment has been minimized.

Show comment
Hide comment
@bspunie

bspunie Oct 27, 2015

+1 I am trying to publish webjob with dummy website but not able to find a way to upload web job config to appear in portal since my config has values specific to web job.

bspunie commented Oct 27, 2015

+1 I am trying to publish webjob with dummy website but not able to find a way to upload web job config to appear in portal since my config has values specific to web job.

@abatishchev

This comment has been minimized.

Show comment
Hide comment
@abatishchev

abatishchev Oct 27, 2015

Copied to the actual webjobs repo: Azure/azure-webjobs-sdk#587

Please close this one to avoid further confusion.

abatishchev commented Oct 27, 2015

Copied to the actual webjobs repo: Azure/azure-webjobs-sdk#587

Please close this one to avoid further confusion.

@mathewc

This comment has been minimized.

Show comment
Hide comment
@mathewc

mathewc Oct 27, 2015

Contributor

Closing because the issue has been moved by @abatishchev. Seems like a VS tooling issue, but we'll find the right home for the issue to address the scenarios.

Contributor

mathewc commented Oct 27, 2015

Closing because the issue has been moved by @abatishchev. Seems like a VS tooling issue, but we'll find the right home for the issue to address the scenarios.

@mathewc mathewc closed this Oct 27, 2015

@mathewc

This comment has been minimized.

Show comment
Hide comment
@mathewc

mathewc Oct 27, 2015

Contributor

This is a VS tooling issue, and we've looped in the VS team and they've opened an internal tracking item for this. There is also a public VS User Voice issue (link here) that has lots of traction. Since this issue isn't actionable in the SDK, I'm closing the issues in these repos. All further comments should go to the VS user voice issue.

Contributor

mathewc commented Oct 27, 2015

This is a VS tooling issue, and we've looped in the VS team and they've opened an internal tracking item for this. There is also a public VS User Voice issue (link here) that has lots of traction. Since this issue isn't actionable in the SDK, I'm closing the issues in these repos. All further comments should go to the VS user voice issue.

@brunobertechini

This comment has been minimized.

Show comment
Hide comment
@brunobertechini

brunobertechini Nov 18, 2016

I have it working including developer machine and VSTS automated build transformation without SlowCheeta.

Im using this extension in my developer machine: https://marketplace.visualstudio.com/items?itemName=GolanAvraham.ConfigurationTransform
This extension even transform when you use other configuration when debugging. It does that by modifying csproj with custom build tasks. After installing and use "Add config transformations" to your App.config (WebJob) you dont need the extension anymore.

I have the following scenario working:

  • One Web Project
  • One WebJob Project (referenced by Web using the json config -- default)

I have a CI build configured in VSTS using the following parameters:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=$(build.stagingDirectory) /p:AutoParameterizationWebConfigConnectionStrings=false

This is generating 02 WebDeploy Packages (Project.Web.zip and Project.WebJob.zip)

I am deploying only Project.Web.zip (as it includes the webjob as well)

In Release manager im using an extension to do config transformations:

  • Extract zip file
  • Execute transformation for all config files
  • Archive folder again
  • Deploy new archived to Azure AppService

This is working fine for quite a while.

If anyone needs any help please let me know

brunobertechini commented Nov 18, 2016

I have it working including developer machine and VSTS automated build transformation without SlowCheeta.

Im using this extension in my developer machine: https://marketplace.visualstudio.com/items?itemName=GolanAvraham.ConfigurationTransform
This extension even transform when you use other configuration when debugging. It does that by modifying csproj with custom build tasks. After installing and use "Add config transformations" to your App.config (WebJob) you dont need the extension anymore.

I have the following scenario working:

  • One Web Project
  • One WebJob Project (referenced by Web using the json config -- default)

I have a CI build configured in VSTS using the following parameters:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=$(build.stagingDirectory) /p:AutoParameterizationWebConfigConnectionStrings=false

This is generating 02 WebDeploy Packages (Project.Web.zip and Project.WebJob.zip)

I am deploying only Project.Web.zip (as it includes the webjob as well)

In Release manager im using an extension to do config transformations:

  • Extract zip file
  • Execute transformation for all config files
  • Archive folder again
  • Deploy new archived to Azure AppService

This is working fine for quite a while.

If anyone needs any help please let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment