【事象】
MS Learnのクラウドスキルチャレンジ Java 特別編の登録を行い、
最初の単元である Azure 上の Java の概要 - Learn | Microsoft Docs を実施しようとしていた。
Azureは自身MS Learnのアカウントはまだ無料登録したことなかったため、Azureの無料サブスクリプションを事前に紐づけていた。
また、Azure App Serviceがポータル経由で追加できることも確認を行っていた。
そこで、以下のコマンドを実行する事になっているので実行した。
mvn com.microsoft.azure:azure-webapp-maven-plugin:1.12.0:config
しかしながら、以下の様なエラーメッセージが表示されてしまい、進めれなかった。
[INFO] Scanning for projects... [INFO] [INFO] ------------< org.springframework.samples:spring-petclinic >------------ [INFO] Building petclinic 2.4.5 [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- azure-webapp-maven-plugin:1.12.0:config (default-cli) @ spring-petclinic --- [WARNING] The POM for com.microsoft.azure.applicationinsights.v2015_05_01:azure-mgmt-insights:jar:1.0.0-beta is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [INFO] Auth Type : AZURE_AUTH_MAVEN_PLUGIN, Auth Files : [C:\Users\hogehoge\.azure\azure-secret.json] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8.526 s [INFO] Finished at: 2021-04-30T19:38:43+09:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:1.12.0:config (default-cli) on project spring-petclinic: Cannot get Web App list due to error: No available subscription found in current account.. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
【対応方法】
以下で解決した。
1.azure-secret.jsonというファイルが生成されているので削除
2.Azure CLIをインストール
3.コマンドプロンプトを起動し、az loginを実行
4.同じコンソールで、mvn~を実行
【原因】
不明
但し、GitHubで同じ様な記載を発見した。
github.com
az loginを実行後には、azureProfile.jsonというファイルが生成されていたが、元々生成されていたazure-secret.jsonと見比べたが色々フォーマットが違うところはあるが、自身のアカウント事態には紐づいてそうだったので、何が原因かは正直分からないがあまり追いかけるところではないかと思いこれで解決とする。
【補記情報】
azure.microsoft.com
B1:8.40[円/時間]、P1V2:22.400[円/時間]
azure-webapp-maven-pluginからは選択できないが、
Azure App ServiceにはF1:0[円/時間]や、D1:1.456[円/時間]というインスタンスもある。
それぞれ利用制限は厳しめであるが、簡単な検証用途であれば利用するシーンあるかも。
- 作者:日本マイクロソフト株式会社
- 発売日: 2018/10/30
- メディア: Kindle版