LoginSignup
5
0

船井総研デジタルのよもぎたです。

この記事は船井総研デジタルのアドベントカレンダーの17日目の記事です。
昨日は@kozue-shの「Microsoft Fabric使ってみる(データウェアハウス編)」でした。
明日は@coitateの「OpenAI の API でスマートホームエージェントつくってみた」の予定です。
よろしければこれらの記事もお読みいただければと思います。

この記事はプレビュー中のMicrosoft Copilot for Azureを取り上げています。GAしたあかつきには挙動が異なることは十分考えられます。その点をご留意いただけますようお願いいたします。

Microsoft Copilot for Azureさんがやってきた

11月に開催されたMicrosoft Ignite 2023では、たくさんのプロダクトがアナウンスされました。

そのなかで、「IT管理を簡素化 - 時間を節約し、迅速に回答を得る」という謳い文句のMicrosoft Copilot for Azureはリミテッドパブリックプレビューが開始されています。早速申し込んだところ、使えるようになりました!

20231217_01.png

なお申し込み手続きは興奮しながら勢いでやったので、スクリーンショットはおろか手順のメモさえ残っていません。こちらから申し込めるので、ご興味のある方は申し込んでみてはいかがでしょうか。

Microsoft Copilot for Azureさんと対話するための設定

現時点ではMicrosoft Copilot for Azureさんは日本語を理解してくれません。そこで、Azure Portalの設定(Portal右上の歯車マーク)の「言語と地域」で言語を英語に設定する必要があります。地域は日本のままで大丈夫です。

20231217_02.png

なお、この記事の質問はDeepL先生監修 翻訳してもらいました。

Microsoft Copilot for Azureさんと対話してみる

仮想マシンの作成について聞いてみる

私の質問

Please give me step-by-step instructions for creating a Virtual Machine.

Microsoft Copilot for Azureさんの回答

To create a Virtual Machine in Azure, you can use the Azure portal. Here are the general steps:

  1. Sign in to the Azure portal.
  2. Select Virtual machines.
  3. Select + Create and + Virtual machine from the drop-down menu to open the Create a virtual machine screen.
  4. Select the image from the dropdown list or select See all images to search or browse all available virtual machine images. You can also configure the VM generation of your image depending on the image you select.
  5. Select the size of the VM to deploy.
  6. Provide the other required details to create the VM.
  7. Select Review + create to review your choices. When the Validation passed message appears, select Create.

You can find more detailed instructions and screenshots in the "Quickstart: Create a Windows virtual machine in the Azure portal" tutorial in the Microsoft documentation.

References:
---snip---

省略しましたが、ちゃんとリファレンス付きで回答してくれます。一度でもPortalで仮想マシンを作ったことがある方なら、「うんうん、そうそう。」と言える回答だと思います。しかし、こういう質問をするのは回答のステップ2番のVirtual Machinesを見つけられないからではないでしょうか。というわけで追加質問をします。

私の質問

Please give me step-by-step instructions on how to find the Create Virtual Machine button in Azure Portal.

Microsoft Copilot for Azureさんの回答

To find the 'Create Virtual Machine' button in the Azure portal, follow these steps:

  1. Sign in to the Azure portal.
  2. In the left-hand menu, select 'Virtual machines'.
  3. In the 'Virtual machines' pane, at the top, you will find the '+ Create' button. Click on it.
  4. In the drop-down menu, select '+ Virtual machine'. This will open the 'Create a virtual machine' screen.

Now, you can proceed with creating your Virtual Machine.

これなら初めてでもVirtual Machineの作成画面にたどり着けるでしょう。

次に仮想マシンのSKUについても聞いてみます。

私の質問

What SKUs of Virtual Machine can be created in the Japan East region that meet the following requirements?

  1. CPU 8 cores
  2. 32GB memory

Standard_D8d_v5等が該当します。しかし、Copilotさんの回答は…

20231217_04.png

該当なし、となってしまいました。ただ、ここで注目すべき点はAzure Resource Graphを検索していることです。クエリ言語はKQLのようですね。クエリの内容が良くないのでしょうか。そこで、Azure Resource Graph Explorerを使ってCopilotさんが生成したクエリを1ステップずつ試してみます。

そうしたところ…

20231217_06.png

なんと一発目で検索結果ヒット無しでした。
=~(イコール、チルダ)なのがいけないのかなと思って==(イコール2つ)でも試してみましたが、やはりNo results.でした。どうやら右辺の 'Microsoft.Compute/virtualMachineSizes' がよろしくないようです。参りました。

Copilotさんが正しいクエリを生成出来るようになることを願います。

現時点では残念な結果でしたが、回答のたびにAzure Resource Graphを検索しているということは、SKUの追加・廃止に随時追従出来ることが期待できます。ある時点での学習結果をもとに回答を生成するよりも優れたアプローチだと思います。

お勧めのサービスを聞いてみる

まずはシンプルな質問から。期待する回答はAzure Static Web Appsです。

私の質問

What is the best service for hosting a static website?

Microsoft Copilot for Azureさんの回答

Azure Storage is the best Azure service for hosting a static website. You can serve static content (HTML, CSS, JavaScript, and image files) directly from a storage container named $web. Hosting your content in Azure Storage enables you to use serverless architectures that include Azure Functions and other Platform as a service (PaaS) services. Azure Storage static website hosting is a great option in cases where you don't require a web server to render content. If you need a web server to render content, you can use Azure App Service.

For more information, you can refer to the following resources:
---snip---

なるほど、それもアリですね。もう少し質問を工夫してAzure Static Web Appsという回答を引き出したいです。

私の質問

What web hosting service consists of static files and allows me to define route and security rules, custom headers, and network settings?

Microsoft Copilot for Azureさんの回答

Azure Static Web Apps is the Azure web hosting service that consists of static files and allows you to define route and security rules, custom headers, and network settings. It is a great alternative to static websites and is appropriate in cases where you don't require a web server to render content. Azure Static Web Apps also provides a fully managed continuous integration and continuous delivery (CI/CD) workflow from GitHub source to global deployment.

For more information, you can refer to the following resources:
---snip---

Azure Static Web Appsを引き出せました。満足です(笑)。GitHubと連携してCI/CD出来ることも教えてくれます。でも、Azure DevOpsも忘れないで下さい。

違うアプローチでAzure Static Web Appsを引き出すのにチャレンジしてみます。

私の質問

What services are available for free static website hosting?

Microsoft Copilot for Azureさんの回答

Azure Static Web Apps offers free static website hosting for personal projects. The Free plan includes web hosting, GitHub and Azure DevOps integration, globally distributed static content, free SSL certificates, and up to 3 staging environments per app.

For more information, you can refer to the following resources:
---snip---

ちゃんと無料プランがあることも把握しています。さすがです。

次はもう少し込み入った質問をしたいと思います。

私の質問

I want to build a web service consisting of a web server running on a virtual machine and a PaaS RDB. Please let me know the virtual machine service and network service required to dynamically increase or decrease the number of virtual machines according to the number of requests.

Microsoft Copilot for Azureさんの回答

To build a web service consisting of a web server running on a virtual machine and a PaaS RDB, with the ability to dynamically increase or decrease the number of virtual machines according to the number of requests, you can use Azure Cloud Services. With Azure Cloud Services, you can provide a configuration file that tells Azure how many web role instances and worker role instances you'd like, and the platform will create them for you. You can also choose the size of the backing VMs. If your application needs to handle a greater load, you can ask for more VMs, and Azure creates those instances. If the load decreases, you can shut down those instances and stop paying for them. Azure Cloud Services also provides monitoring and detects failed VMs and applications, not just hardware failures. To achieve this, an Azure Cloud Services application shouldn't maintain state in the file system of its own VMs. Instead, it should explicitly write all state to Azure SQL Database, blobs, tables, or some other external storage.

For more information, you can refer to the following resources:
---snip---

期待した答えはVirtual Machine Scale SetsLoad BalancerApplication Gatewayだったのですが…
残念です。今後に期待しましょう。今はまだプレビュー中です。

作成済みのリソースを評価してもらう

まず、ssh(22/tcp)とRDP(3389/tcp)を全開にしたNetwork Security Groupを作成します。良い子の皆さんはマネしてはいけません。

20231217_07.png

私の質問

Evaluate the nsg-bad Network Security Group in the rg-bad resource group to see if there are any settings that are undesirable from a security perspective.

Microsoft Copilot for Azureさんの回答

To evaluate Network Security Group settings for security, you can start by reviewing the default security rules that are applied and the rule properties that you can modify to create an augmented security rule. Additionally, you can use Azure Policy to help control traffic in subnets that don't have network security groups and add a network security group to a subnet, even if it's minimally impactful. You can also integrate Azure Web Application Firewall with routers, such as Azure Application Gateway or Azure Front Door, and use service tags to summarize source and destination IP address ranges. However, it's important to note that network security groups work at layers 3 and 4 on the Open Systems Interconnection (OSI) stack, so they only contain shape and direction information. This means that restricting traffic doesn't imply that allowed flows are beyond the scope of an attack.

For more information, you can refer to the following resources:
---snip---

評価をお願いしたつもりなのに、手順を回答されてしまいました。さらにいろいろとセキュリティ関連のサービスをお勧めされてます。期待してたのとは違う…

ということで、質問の仕方を変えてみたいと思います。

私の質問

The nsg-bad network security group in the rg-bad resource group has security issues. Please let me know what the problem is.

Microsoft Copilot for Azureさんの回答

I'm sorry, but I'm unable to provide the information you're looking for at the moment.

丁寧ですがお断りされてしまいました。素直にDefender for Cloudなどを使うべきなのでしょう。カニバリズムが起きないようにセーフティがかかってるのでしょうね。これはGAしても変わらない気がします。

なお、このNSGとResouce GroupはCopilotさんとのチャットの後、すみやかに削除いたしました。

最後に

プレビュー中だからだと思いますが、Copilotさんとチャットできる回数、1回のチャットでのやり取りの往復数には制限がかかっています。記事にならないやりとりもあって、今日のところはこれで打ち止めです。

ゆくゆくは今のようなエンジニアのお仕事が無くなってしまうかも、という一抹の不安はありますが、構成を考えてそれを適切にCopilotさんに伝える、というニーズはしばらくはありそうです。それ以上に「やりたいこと」を適切な粒度で適切に言語化できれば、日々進化する多種多様なクラウドサービス群からその時点で最もマッチしたものを提案してもらえるかも、という期待さえあります。

また、ありそうなシナリオを考えてCopilotさんに聞いて、具体的なサービスを聞き出して学習の取っ掛かりにする、という使い方も出来そうです。夢が膨らみますね。

それにしても、なぜか「Copilotさん」と「さん付け」してしまいます。不思議ですね。私だけでしょうか?

最後までお読みいただきありがとうございました。

5
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
5
0