Reload TeamCity build configuration programatically - rest

I am creating multiple TeamCity projects via the rest api.
After adding some Versioned Settings properties via:
teamcity/app/rest/projects/MyProject/projectFeatures
I would like to be able to reload the projects programmatically, so that the changes take effect.
I don't see anything in the rest api that can do that. Does anyone has any suggestion on how to do that?
Currently I am going to project configuration -> Versioned Settings -> Context Parameters, and I manually save the changes which triggers a reload of the configuration and applying the required settings.

AFAIK, there's no api method to reload versioned settings. However, you could try to select use settings from VCS option in Versioned Settings. It should force TeamCity to reload versioned settings on each build

Related

Accessing Merge Settings via the GitLab API

I would like to view and perhaps change the merge settings in GitLab (see the screenshot). How do I do this via the API?
If this is when creating a project there is a string named "merge_method" & "remove_source_branch_after_merge"
merge_method
remove_source_branch_after_merge
So this would be
GET /projects id/merge_method
for existing projects you can use
https://docs.gitlab.com/ce/api/projects.html#project-merge-method

Disable "commit mention ..." settings for Git repo by default

For every repository there are two "commit mention" settings enabled by default.
Is there a way to disable one of these or both by default (per project or even org) when a new repo is created?
I did not find any project or org setting in the web ui. Can this maybe done using some rest api?
Thank you
Instead of manually changing these options you can use the very same API as the WebUI does:
Endpoint:
https://dev.azure.com/{ORG}/{PROJECT-ID}/_api/_versioncontrol/UpdateRepositoryOption?__v=5&repositoryId={REPO-ID}
Request Type:
POST
Payload:
{"key":"WitResolutionMentionsEnabled","value": <true|false>}
Project ID and REPO ID (hash values) can be extracted either using the Developer Tools in your browser or using the Python API Wrapper.
I searched and tried with the related REST API (Repositories - Update) and Azure CLI (az repos), but did not find any available interface can change two option on repository settings.
Looks like, currently we have no available method to change the options of repository settings in batches. You may need to manually change these options.
If your projects really need this feature, I recommend that you can report a feature request on Developer Community. That will allow you to directly interact with the appropriate product team, and make it more convenient for the product team to collect and categorize your suggestions.

Strategy to avoid storing secret web.config settings on github

I got a .net framework solution that has secret settings (API keys, connectionstrings etc) in a web.config.
The solution code lives at github.com.
I want to avoid having those secret settings at github at all.
I got a teamcity build server, that has those settings and merges them into the web.config at build time for the different enviroments, just before deploy time. This works great.
But I need ideas of how to handle those settings for developing locally, where the teamcity server (of course) does not build and merges settings.
Could it maybe be possible to inject some code i global.asax on Application_Start, to fetch the settings from a secure place and set the settings there?
Or maybe have a different config file just for development that is only loaded when developing and is not committed in github?
Or is there some other smart way that I can't think of?
I found a way through powershell and the 'file' reference in web.config and made a Blog post about it: https://codebuildplay.wordpress.com/2018/11/30/how-to-store-settings-in-teamcity-and-merging-into-a-net-config/

Using VSTS Release Management, how can I modify the configuration of an Azure Web App for each environment?

I'm using Visual Studio Team Services and I'm trying to set up Release Management to allow automated deployments for our Azure Web App to multiple environments. I would like the same source to be deployed to each environment, but with modified configuration settings.
I was hoping that I could create a single Build for my application, and then modify the configuration at deployment time for each environment. I'm aware that this can be done for appSettings and connectionStrings (either through Tokenization, or even managing those settings via the Azure portal), but I'd like to be able to make more general changes to the web.config file. For example, I want to be able to:
Update 'simple' settings such as appSettings/connectionStrings
Update multiple attributes on elements (like httpErrors)
Insert or rewrite sections of the config file itself (for example to add IIS rewrite rules, or to remove unwanted HTTP handlers for production)
Currently we achieve this by using config file transformations and separate publish profiles for each environment (manual deployment). I can't see a way to re-use this if I want a single release pipeline.
I'm hoping someone can help point me in the right direction. I'm also happy to accept alternative solutions - ultimately I just want to be able to deploy the same source (e.g. from the same commit in source control) to multiple environments, with different configuration, while keeping some kind of flow from dev, to test, to eventually production.
You can use Tokenization Task to update the files base on the environment variables.
More similar extensions: Replace Tokens and Colin's ALM Corner Build & Release Tools.

How to disable visualstudio.com stored project's multiple check-out default effect all users?

Im doing this from workspace manual for all my project. And my colleague making same. Cant i set defaul somewhere when i'm creating project? or from .visualstudio.com ?
Thanks
If users have Server Workspaces you can configure this via Team Explorer. If you connect to a Team Project and click Settings, then Version Control you should see the options that you are looking for.
This setting affects all users of that team project. You will need to set it for each new team project.