Azure サービスプリンシパル コマンドラインからの認証情報検証 (CLI) Issue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } <!-- div.margin{ padding: 10px 40px 40px 30px; } table.tocTable{ border: 1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); padding-top: .6em; padding-bottom: .6em; padding-left: .9em; padding-right: .6em; } table.noteTable{ border:1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); width: 100%; border-spacing:2; } table.internaltable { white-space:nowrap; text-align:left; border-width: 1px; border-collapse: collapse; font-size:14px; width: 85%; } table.internaltable th { border-width: 1px; padding: 5px; border-style: solid; border-color: rgb(245, 245, 245); background-color: rgb(245, 245, 245); } table.internaltable td { border-width: 1px; padding: 5px; border-style: solid; border-color: #E0E0E0; color: #000000; } .title { color: #D1232B; font-weight:normal; font-size:28px; } h1{ color: #D1232B; font-weight:normal; font-size:21px; margin-bottom:-5px } h2{ color: #646464; font-weight:bold; font-size:18px; } h3{ color: #000000; font-weight:BOLD; font-size:16px; text-decoration:underline; } h4{ color: #646464; font-weight:BOLD; font-size:15px; text-decoration:; } h5{ color: #000000; font-weight:BOLD; font-size:13px; text-decoration:; } h6{ color: #000000; font-weight:BOLD; font-size:14px; text-decoration:; } ul{ list-style: disc outside none; margin-left: 0; } li { padding-left: 1em; } --> コンテンツ 概要一般的なエラー原因前提条件検証追加情報 1.概要 Azure ディスカバリーが複数のエラーで失敗し、Azure 認証情報、ServiceNow クラウド API、MID サーバー、またはその他の理由である可能性があるなど、問題の原因を理解するのが難しい場合があります。この記事では、コマンドラインから Azure 認証情報を確認して問題を絞り込む方法を示します。 2.一般的なエラー Failed to execute API - Failed with status code and message: 403: {"error":{"code":"AuthorizationFailed","message":"The client '572864c1-e43f-43b3-8770-d51eaa7db603' with object id '572864c1-e43f-43b3-8770-d51eaa7db603' does not have authorization to perform action 'Microsoft.Resources/subscriptions/locations/read' over scope '/subscriptions/51da9d66-1794-405e-b15f-6d9838208edd'."}} (script_include:CloudRESTAPIInvoker; line 122) java.lang.IllegalArgumentException: Invalid uri 'https://management.azure.com/subscriptions/ 6d1fadd8-05a4-4b22-9dec-5e7ca49f8674/resourcegroups?api-version=2015-01-01': escaped absolute path not valid", which says the subscription is invalid, and couldn't recognise it for discovery. Custom operation Cloud REST - add response to context failed to execute script due to Custom operation Failed to run script due to the following error: JAVASCRIPT_CODE_FAILURE: com.snc.sw.exception.CommandFailureException: Failed to execute cloud request. Reason: SSLHandshakeException:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (script_include:AzureApiCommand; line 58). Check the discovery logs for more details. 3.原因 秘密キーの有効期限が切れている可能性があります。アプリケーション ID に関連付けられた秘密キーが一致しません。不明なアプリケーション ID と秘密キーサブスクリプション ID を持つユーザーには、アクセス権がないか、リーダーロールがありません。 4.前提条件 ドキュメント (を作成する」) で説明したように、Azure 資格情報とサービス プリンシパルを構成するには、次のものが必要です。 ディレクトリー IDアプリケーション IDアプリケーションキーサブスクリプション ID サブスクリプション ID は、サービスプリンシパルの構成時に使用され、その他は Azure 認証情報に使用されます。顧客は、親サブスクリプション ID と複数のアプリケーション ID およびアプリケーションキーを持っている場合があります。 5.検証 注: 認証情報が ServiceNow 認証情報テーブルに保存されると、提供された秘密キーは表示されず、カスタマーが検証のためにすべての情報を手元に用意しておく必要があることを知ることはできません。 Azure Cloud Shell にログインします。 (利用できない場合は、お客様がインストールする必要があります。) APP_IDを手元に置いてコピーし、コマンド「az role assignment list --assignee APP_ID」を実行します。 コマンドで出力が返されませんでした。これは、APP_IDにロールが指定されていないことを意味します。 コマンドは何らかの結果を含む出力を返し、APP_IDに「閲覧者」ロールが提供されていることがわかります。 6.追加情報 Azure CLI を使用して Azure サービスプリンシパルを作成します [Microsoft] Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } }