How to create a new Azure Website with integration to private Github repo using the Azure REST API? - powershell

There are many trivial examples that show how this is done without the Github integration. The Azure Powershell commandlet New-AzureWebsite supports only public repos (can be confirmed from source code [1]). Has anyone tried to create it with a connection to a private repo? It doesn't seem to be documented anywhere.
UPDATE: I've realized this might be something Kudu helps me with.
[1] https://github.com/Azure/azure-powershell/blob/e06a22c22f7a1c8153e9c2fa7c159ae7b1fd1dab/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/GithubClient.cs#L124

We have not added the functionality to powershell. However, you could try using the ARMClient tool below to achieve just that. See its readme and wiki for info.
https://github.com/projectkudu/ARMClient
https://github.com/projectkudu/ARMClient/wiki/Setup-GitHub-publishing-to-Site

Related

Templates & Resources for creating documentation using Azure DevOps Wiki

Working on a relatively new team in a much larger organization, and as a side project I am looking at our current documentation for opportunities to improve/standardize our best practices/standards. The ideal tool we would like to use, if up to the task, is Azure DevOps Wiki (this is AZDO Service, not Server) since it lines up with the rest of our PM functions. I was doing some digging, and I have not found much in the way of resources/templates/guides that can really get you going for Azure DevOps Wiki.
Beyond general documentation best practices, is there any helpful tricks/resources that we can use to make the most out of that particular tool? Or is there just a better tool we should consider? Looking for ideas! Any feedback is appreciated.
What I am looking for is a library of templates/resources that could
be used to help standardize documentation.
Official doesn't provided any template or resources for standard. There has been a feature request here:
Make it possible to create wiki page based on a template
You can upvote this feature request of Azure DevOps and share your ideas.
But since the DevOps wiki is designed based on Azure DevOps repository, you can clone the template you want to your wiki repository.
The repository url of your wiki should be:
https://dev.azure.com/<Organization Name>/<Project Name>/_git/<Project Name>.wiki
Use this command to clone the wiki repository:
git clone https://<Personal Access Token>#dev.azure.com/<Organization Name>/<Project Name>/_git/<Project Name>.wiki
PS:
Every DevOps project has a hidden repository, which named '<Project Name>.wiki', this repository can't be access via the repository UI list, also can't be listed via the List Repositories REST API. This repository also unable to be managed as other common repositories. Only 'Security for Wiki'. The repository will store all of the information in the pages of wiki permanently unless you delete the file in the repo.
And the comments section of the wiki is implemented quite differently, it is not based on a git repo and does not provide an explicit manage method. If you accidentally delete an image in a comment from the wiki, you won't have any way to get it back.

Is there a cli equivalent of Github cli for Bitbucket?

I'm looking for a Bitbucket tool that is similar to the Github cli. I'm aware of API, but that's not what I'm looking for. This tool is for the Bitbucket cloud version.
i don't think so there is one yet officially. If it's of any use, you could make use of my script https://github.com/psadi/bbcli - it is api based, and its for enterprise.

Show front-end UI from Azure Repos (Github Pages equivalent)

I was recently told by my IT department that I can't use Github as a code repository, so I'm using Azure Repos in Azure Devops.
I am primarily a designer, and my only usage for Github was to render HTML, CSS, and Javascript as a working prototype in Github Pages that can be shared to anyone with an internet connection.
I am not at all familiar with Azure DevOps or Azure Repos, is there any way to show my front end code as a generated page using Azure? Would I have to use something like Jekyll or Hugo?
Is there any way to show my front end code as a generated page using
Azure? Would I have to use something like Jekyll or Hugo?
Displaying the front-end UI directly in Azure Repos is still a not-supported scenario for now.
Azure Repos in Azure Devops Service supports Git and TFVC version control system to manage the code. But it doesn't mean it supports same functions like Github, at least Azure Repos itself doesn't have the feature to render HTML, CSS, and Javascript and display the front-end UI.
Also, I checked the Azure Devops extensions here and didn't find one extension that meet your needs. So I think what you want is now not supported for Azure Repos. You may use the Azure Repos to host the HTML, CSS, and Javascript files like what Github repos do, clone it locally and use third-party tool to display the UI when necessary.
Also, you may post a feature request with details about what you want with Azure Devops Repos here. If it gets enough votes, the team would consider it seriously! Hope all above helps :)

Publish an Azure DevOps Wiki as a stand-alone static site

I have set up a wiki in Azure DevOps and I want to set up a pipeline that takes the markdown files, transform them into HTML and publish them as a stand-alone static web site. When someone commits changes in the markdown files I want to build new static files to the site using a pipeline in Azure DevOps.
Gatsby is a platform that I'm somewhat familiar with, but the wiki consists of markdown files only + a file called "order" that determines the order of the documents in the wiki.
Does anyone have an idea as to how I should set this up?
You need this setup:
Expose your markdown files by an API. Azure should have some kind of serverless lambda function service. The query result should be an array or list of the files you need in the order you need them. It's best to let your Azure based API deal with the order file. Gatsby should only be concerned with building your site in the right order as supplied by your API.
Call your markdon API during the Gatsby build process. See the docs for how to fetch data at build time.
Create a template page for all your wiki pages. See the Gatsby tutorial part 7.
You need to create the wiki pages using the Gatsby node API. Use the createPages function.
PS: I'm interested in your decision what serverless lambda function service you would use because I am running into a similar use case. Feel free to comment how you solved the 1. of your setup.

Is there a way to import Jira issues to GitHub?

I've tried exporting issues from both GitHub and Jira to CSV files, but I've never tried exporting Jira issue then importing it to GitHub, is this possible? If so, what would be the best way to approach something like this?
There is simply not a "Import issues from JIRA" feature in GitHub.
The way I see it you have two options, either to integrate your current JIRA instance with GitHub or migrate the JIRA issues into GitHub issues using your own criteria and migration script.
GitHub and JIRA Integration
I would very much like to add all the instructions here but it's one of those cases where a link to the documentation makes much more sense.
There's also a video on youtube which is quite short and easy to follow.
Migrating JIRA issues into GitHub Issues
In order to do this you would have to write your own script that reads issues from the JIRA REST API and creates new ones using GitHub Issues REST API.
Note that JIRA and GitHub issues are different in nature, so your script would have to choose how to migrate one type of issue to another.
I hope this helps.
Another way is to export the JIRA issues as XML file.
The following project provides Python 2 scripts to import such a file into a GitHub project via its REST API:
https://github.com/hbrands/jira-issues-importer
Besides issues with comments, it imports milestones, labels and components as labels. References to issues in comments are to some degree converted. Also, JIRA relationships like "blocks" and "depends on" are migrated to special issue comments in GitHub.
It avoids the problem of running into abuse rate limits by using a special Issue Import API.
Please read the sections about the features, caveats, assumptions and prerequisites on the project site. Be sure to test the issue migration with a GitHub test project first.
Here are the things you need to do for export from JIRA and import to GitHub.
First export issues (to a csv file) from JIRA with the feilds you need.
Then read the csv file line by line and use the github api to create issue in GH.
https://github.com/susinda/github-client/blob/master/src/main/java/org/wso2/git/client/GitRestApiExecutor.java
Here is a sample client to do the job[1], readme contains the steps,feel free to modify it and use if that does not match with your requirement https://github.com/susinda/github-client
Try this node module https://github.com/gavinr/github-csv-tools, need to download issue form Jira and use this to upload on GitHub.
https://github.com/parcelLab/jira-to-github is a (pretty old) project to migrate JIRA issues to Github.
Export the issues from JIRA
First, create a full export to XML as described in this guide:
https://confluence.atlassian.com/adminjiracloud/exporting-issues-776636787.html
You'll need the exported entities.xml from JIRA to upload the
issues to your GitHub repository using the GitHub API.
Run the import to GitHub
Run node index.js to use the script