How to enable/disable project services through API - azure

I am migrating from TFS 2015 to Azure DevOps. The process of creating the target project and importing the old git repository can easily be done through the Azure DevOps API.
But each new project, either created manually or by API has always all services (Boards, Pipelines, Test Lab, ...) enabled. Is there a way to change the default setting of which services should be enabled on new projects? Or even better an API method to switch certain services on / off?
We have hunderets of projects and therefor it's not feasible to open each project in the browser, change to the project settings page and adjust the services.
I haven't found anything in the docs: https://learn.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-5.0

This guy wrote a blog post on how to do this
This is an excerpt pulled from his post:
PATCH https://{account}.visualstudio.com/_apis/FeatureManagement/FeatureStates/host/project/{project-id}/{feature-id}?api-version='4.1-preview.1'
content-type: application/json
{"featureId":"{feature-id}","scope":{"settingScope":"project","userScoped":false},"state":0}
Replace account,project-id and feature-id as appropriate. Here are the feature id’s I know of.
ms.vss-build.pipelines [Azure Pipelines]
ms.vss-test-web.test [Test Plans]
ms.vss-work.agile [Azure Boards]
ms.vss-code.version-control [Azure Repos]
ms.feed.feed [Azure Artifacts]
It looks like turning a service off really just means hiding it from the UI.
Edit: it looks like the .net SDK has built in support for this as well

Related

Is it possible to define parameters through portal for Logic App (Standard)?

I have a single-tenant logic app and a workflow under it that needs a configurable input. In a multi-tenant logic app, one can define parameters through the azure portal and reference them in workflow definition (actions/ triggers). Is this not possible with a single-tenant logic app?
I am not able to find the answer in the documentation.
I know a deployment template should consult parameters file for this, however, I still have the above question specifically if I am doing stuff through the portal.
Edit 7/12
I am referring to the parameters concept explained here, and not the parameters tab of the triggers or actions. See below the parameters that we can define through the portal when working with the consumption logic app.
The answer is: not yet. Support for parameters in the designer (and therefore in the Azure Portal) is on its way, but not available yet.
In VS Code, you can create a parameters.json file.
But in the portal, there's no option (yet) to create/edit parameters.
Bec Lyons (Microsoft) demoed a version of the designer with this in it, although I can't remember if this was in the June Logic Apps Live session, or in the July Integration Down Under session.
In any case, the only currently supported way to do this is to create a parameters.json file and upload it.
You can either do this from VS Code or Azure CLI (using the preview logicapps CLI extension) OR you can FTP to your Logic App and upload it via an FTP client (e.g. FileZilla) - you can get the FTP login details by clicking the "Get Publish Profile" button in the overview of your Logic Apps Standard resource.
Once they release support for this in the Portal/Designer, I'll update this answer.
Also, worth noting that as of this date (July 2021), there are issues using parameters in Managed API Triggers - not sure yet if this is by design, or if it's a bug. Specifically the FileSystem, FTP and FTPWithSSH (SFTP) triggers.
Hope this helps. Probably not the answer you were looking for, though!

CI/CD / Rebuild a Azure APIM developer portal content

In the Azure APIM, is it possible to manage the content in a programmatic way -let's say the REST API or SDK- when I have some changes in Developer Portal content?
I saw there are some articles mentioned to use the iFrame but it is still required to have manual change in portal. For CI/CD, the requirement is make everything as code. So when writer updated / create / rebuild content in the APIM platform, we can use the Jenkins or another tools to make it change.
Currently it is not possible to natively manage developer's portal content programmatically, with the exception of data generated by API Management (e.g., API descriptions or API operations are fetched live and API Management's API call response is mapped to UI).
However, there are plans to allow for more control and automation with regards to developer portal content, customizations and deployments.

How do I setup web pages within Azure Service Fabric Stateless Web API?

I am using VS 2017 and have successfully setup to use Stateless Web API. I can see the output of the default controller when I run it.
Now, I want to create web pages within this project and use AngularJS SPA within it to access its own API.
I am unable to find any examples which clearly show how to do this. Note this is ASP.NET Web API - not ASP.NET Core.
Someone please help.
I opened a support ticket with Microsoft and this can be done with the ASP.NET Web API support in service fabric. Web pages can be added to the self-hosted web api project, but each file has to be individually configured for this project - if you have hundreds of files, it does not allow you to configure the entire folder contents for the project, because you have to mark each file to build as content. The example they sent me is an obscure article in a Microsoft blog from a Microsoft Engineer nobody has heard of before.
Not worth it. Use the ASP.NET Core support.

Can't hit NuGet server hosted on an Azure website from Visual Studio, but can from web

My problem is that I have a NuGet server on an Azure website using Azure AD for auth. It works as expected if I hit the NuGet URL in Chrome (requires the login, which accepts appropriate credentials), but if I try to access it in Visual Studio 2013 (through manage NuGet packages) it won't accept the account/password as appropriate credentials (the prompt just pops up again). My approach was as follows:
With the goal of creating a simple internal NuGet server, I largely followed the instructions in this article to deploy one on an Azure website: http://www.codeproject.com/Articles/872230/Create-Your-Own-Private-NuGet-Server-in-Windows-Az
The NuGet server works just fine, but I wanted to add some basic auth since we'll be hosting some of our code there. I decided to try to use Azure AD for this. I added a couple Microsoft accounts (mine and a coworker's) to our otherwise empty default Azure active directory. Through the management portal, I then selected the 'configure' tab in the website dashboard and added the default directory in the auth section.
Since the developers who will be pulling down our packages will do so through Visual Studio, I need to figure this out or find an alternative. I would like (if possible) to avoid writing my own auth module, since this feature is supposed to be baked into Azure.
It turns out that NuGet does not currently support Azure AD. However, they are working on it and progress can be tracked here: https://github.com/NuGet/Home/issues/708

TFS 2013 Web Access Deployed Tab

I'm trying to understand what the "Deployed" tab is used for in TFS 2013 Team Web Access. There's another similar question here: What is the "deployed" tab for in TFS 2012 Web Access
Some of the information there seems to suggest that TFS Deployer is setting a build quality, but what is it? Another post indicates that it might be for Azure deployments.
Just trying to understand how it works.
When you use the built in Continious Build to Azure build template it will automatically set this for successfully deployments.
You may be able to set this through the API.

Resources