0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Azure DevOps Demo Generatorを使ってサンプルプロジェクトを体験してみた

Posted at

Azure DevOps Demo Generatorを使ってサンプルプロジェクトを体験してみた

Azure DevOpsを学習・検証するときに「とりあえずサンプルが欲しい」と思ったことはありませんか?
そんなときに便利なのが Azure DevOps Demo Generator です。

公式が用意しているテンプレートから簡単にプロジェクトを生成できるので、実際に試してみた流れを紹介します。


Azure DevOps Demo Generatorとは?

Azure DevOps Demo Generatorは、マイクロソフトが提供しているWebアプリケーションで、以下のようなことが可能です。

  • 用意されたテンプレートから数クリックでプロジェクトを作成できる
  • Boards(タスク管理)、Repos(ソース管理)、Pipelines(CI/CD)などがすぐに体験できる
  • DevOpsのベストプラクティスが組み込まれたサンプルを学習用に利用できる

事前準備

使う前に必要なのは以下だけです。

  1. Azure DevOpsのアカウント
    → 無料で作成できます(こちらから)。
  2. Azure DevOpsで使うOrganization(組織)
    → 作成したアカウントに紐づけておく必要があります。

準備ができたらAzure DevOps Demo Generatorにアクセスします。


サンプルプロジェクトを生成してみる

実際に操作してみた手順をまとめます。

1. サインイン

「Sign in with Microsoft」をクリックし、Azure DevOpsアカウントでログインします。

2. Organizationの選択

自分のAzure DevOps Organizationを選びます。
(複数持っている場合はドロップダウンから選択可能)

3. プロジェクト名を入力

作成するプロジェクト名を入力します。
例: demo-devops-project

4. テンプレートを選択(詳細手順)

ここが一番のポイントです。

  1. テンプレート選択画面が表示されます。

    • 「Select Template」をクリックすると、利用可能なテンプレート一覧が表示されます。
  2. 任意のテンプレートを選びます。
    例: eShopOnWeb, MyShuttle, ContosoAir, Terraform, Docker など

  3. 「Select Template」を押すと右側に選択内容が表示されます。

  4. そのまま「Create Project」を押せば、数分でプロジェクトが自動的に生成されます。

代表的なテンプレートの例はこちらです。

Index Template Name Description (英語) 日本語訳
1 eShopOnWeb Source code, pipelines, and e2e implementations for GitHub Advanced Security using eShopOnWeb. eShopOnWeb のソースコードを用いた GitHub Advanced Security のデモ環境。
4 MyShuttle Java + MySQL + Maven + Tomcat を組み合わせたサンプル。 MySQL をバックエンドに持つ Java アプリケーション MyShuttle のサンプル。
5 ContosoAir Node.js + CosmosDB を用いた航空予約アプリ。 Node.js と CosmosDB を使ったサンプル航空予約アプリ。
6 Terraform Terraform と Azure Pipelines による IaC 学習用。 IaC とクラウド自動デプロイを体験可能。
12 Azure Kubernetes Service ASP.NET Core + Docker を AKS にデプロイする例。 AKS (Kubernetes) を利用した CI/CD サンプル。

⚠️ ローカル実行時の注意点

もし公式のWeb UIではなく、GitHubリポジトリ (microsoft/AzDevOpsDemoGenerator) をクローンしてローカルで dotnet run を実行する場合、認証方法の選択画面が出ます。

Choose authentication method: 
1. Device Login using AD auth 
2. Personal Access Token (PAT)

ここで 1. Device Login を選ぶと、環境によって以下のエラーが出ることがあります。

Unhandled exception. System.ArgumentException: The authority URI should have at least one segment in the path (i.e. https://<host>/<path>/...).  (Parameter 'authority')
   at Microsoft.Identity.Client.AuthorityInfo.ValidateAndCreateAuthorityUri(String authority, Nullable`1 authorityType)
   ...
   at Program.<Main>$(String[] args) in C:\Repos\AzDevOpsDemoGenerator\src\ADOGenerator\Program.cs:line 45
解決方法

src\ADOGenerator\appsettings.json を開き、Azure DevOpsの テナントID を追記してください。

{
  "TenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "ClientId": "demo-generator-client-id",
  "RedirectUri": "http://localhost"
}

できあがったプロジェクトを確認

作成後、Azure DevOpsのポータルに移動すると以下のような状態になっていました。

  • Boards: 既にバックログやカンバンボードが用意されている
  • Repos: サンプルコードがコミット済み
  • Pipelines: CI/CDの設定が組み込まれていて、すぐに実行可能
# 一例: pipelinesの定義(azure-pipelines.yml)
trigger:
- main

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: DotNetCoreCLI@2
  inputs:
    command: 'build'
    projects: '**/*.csproj'

まとめ

Azure DevOps Demo Generatorを使うと、

  • サンプルプロジェクトをすぐに体験できる
  • 豊富なテンプレートから自分のユースケースに近いものを選べる
  • IaC・CI/CD・ML など幅広いテーマを試せる
    というメリットがあります。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?