How do I get the repository defaults in an GitHub organisation? - github-api

I am planning to create a GitHub app that can auto assign the default labels in a GitHub organisation to previously created repositories. For that, I am looking for an API to get the default labels in a GitHub organisation and I couldn't find any. The APIs available related to labels are all scoped to repositories. I also couldn't find an API that could give or update the default branch in an organisation.
Is such as API available?

Related

Azure Repo support in Azure API Management, or custom repos

Is it possible to configure Azure Repos or custom repos? This provides more functionalities including branching policy, pull request and code review.
Currently, Git is enabled by default, pointing to Azure centralised database.
https://learn.microsoft.com/en-us/azure/api-management/api-management-configuration-repository-git
In short:
No, this is not possible.
The longer answer:
No, I don't think this is possible.
Although there's no documentation that states it is not possible, I can also not find any documentation it is possible. And the lack of UI, REST APIs or documentation on how to specify a custom Git repo leads me to believe this is currently not possible.
The SCM endpoint is one of the managed service components hence it is out of your control.

How to hide git feature branches from other team?

I have a Azure DevOps Git repo on which two teams are currently working.
We created separate folders under 'feature/' for each team. Can we hide team1's feature folder from team-2?
Using git tf permission command, I was able to restrict the contributory access to other team's folders. But I just don't want the feature team folder visible to other team members.
Please click here to view my branch folder structure
As per the image, team-1 members should be able to see only 'feature/team-1/' branches. 'feature/team-2/' should not be visible to team-1 people.
It's NOT supported to hide specific branch for other team in Azure DevOps UI.
It's only supported to hide specific repo for one team, but cannot for branch level.

Azure LinkedAuthorizationFailed on Active Directory Account / Key Vault Authentication when running DevOps Server Deployment Template

I am trying to deploy an on-prem instance of Azure DevOps Server to a VM in an Azure Government subscription (which by nature, seems it does not support standard DevOps).
This template is referenced within support material directly from Microsoft:
https://github.com/usri/deploy_DevOps_Server_AzureSQL
All the referenced resources were created from scratch for the purpose of getting this server running.
This requires an AAD account with the associated password stored in a Key Vault. However, every attempt I make to run the template returns the following error on the 'Write VirtualMachines' step (when all other components pass):
The client has permission to perform action 'Microsoft.Compute/images/read' on scope '(MY_SUBSCRIPTION)\(MY_RESOURCEGROUP)\(VM)', however the current tenant '(MY_KEYVAULT)' is not authorized to access linked subscription '(ID in the template with the deployment files)'
This seems to me like the password cannot be retrieved from Key Vault- is it a formatting issue with the Secret? An access control issue somewhere? I've tried many various combinations of both. Hopefully this is just a trivial issue..
I am the original author of the code in that repo. I went ahead and merged a pull request into that repo which should address your issue. I did the following:
Updated the ReadMe file to include information on creating the image
Updated the azuredeploy.json with parameters for Key Vault & image references
Updated the ps1 file to eliminate hard links for KV (a particularly bad oversight on my part, my apologies).
Updated and tested everything for the latest version of Azure DevOps Server 2020
This should fix your issue and several other related ones. I retested the entire deployment from scratch and it worked as designed. A couple of other quick notes:
The USRI and all of it's repositories including the one being utilized here are not Microsoft official repositories. They represent an open-source Azure community dedicated to regulated entity customers. The members which contribute there are mostly Microsoft employees and the repos themselves just represent interesting and sometime niche templates that might be of interest.
This particular repo shows a manner in which Azure templates could be used to deploy services when no internet connection is available or permitted. I just used Azure DevOps Server because it was interesting and regulated industry customers use it.
All the best

Azure DevOps Wiki for multiple projects

I have newly started exploring capabilities of Azure DevOps Wiki. I have multiple projects in Azure DevOps. I want to create one separate project to store Business & Technical documentation for all my projects in a centralize place. How can I add multiple Wiki pages to keep this organize.
Second question is I have a predefined structure for the documentation. For eg. Purpose Of Application, Local Build Steps, Deployment Steps, Third Party Control used, etc. How can I create & store this as a template so that whenever a new project documentation is to be created this document can be used as a placeholder to be followed by everyone.
How can I add multiple Wiki pages to keep this organize.
In Azure Devops, Wiki is similar to another kind of Repo. You could Clone Wiki to the target project and Publish the code as wiki.
Here are the steps:
Use the Clone wiki option to get the URL from other projects.
2.Navigate to the target project -> Repos. Use the import repositoryoption to import the wiki to the Repo.
Use the Publish Code as wiki option to publish the repo as wiki page.
Here is a doc about clone wiki.
How can I create & store this as a template?
Azure Devops doesn't support creating wiki templates now.
Here is a suggestion ticket about this feature. You could vote and add comments in this ticket.
Hope this helps.

How to separate Development and Production environment on Azure API management?

I am developing an application using microservice-based architecture. I Know that on Azure API management we can register our APIs. Now the problem I am facing is that my micro-services(development and production ) are deployed on AKS(Azure Kubernetes Service) and both have different IP Addresses as provided by the AKS. How do I differentiate between the two environments so that my front end team has two separate URLs for development and production? The base URI of the API Gateway on azure is pre-configured and cannot be changed, how do I get two URLs?
My main concern is do I need to create two instances of Azure API Management Service?
Have you checked Azure API Management DevOps Resource Kit . As recommended, yes you need to create two instances for your environments and deploy using ARM templates
If you don't want to create several instances, you might also try using versions and revisions.
Revisions
You can create revisions by right-clicking an API and tap "Add revision".
The revision can be accessed via the rev=2 url specifier as shown in the picture above. After successful testing, you can easily set a revision to be the "current" API, which won't need a revision specifier anymore.
Versions
You can create a version by right-clicking an API and tap "Add version".
In the "Versioning scheme" dropdown, you can also choose how the version should be specified. The options are:
Path
Query string
Header
so you can target each version separately.

Resources