次の方法で共有

Key Vault証明書のWEBAPPS適用に関して

BNC 大山 彰 0 評価のポイント
2025-08-28T05:46:45.3633333+00:00

Azure Key VaultにてCSRを生成し、Azure Key Vault での証明書署名要求の作成とマージを行い証明書を作成しました。

その後WEBAPPS側で証明書をインポート使用としたら以下エラーとなった為調査したところ、

キーコンテナ側のアクセス制御をAzure ロールベースのアクセス制御に変更して、WEBAPPS側でステム割り当てマネージド ID を払い出してそれをキーコンテナ名のKey Vault Certificate User権限を付与するといいとの事で行いましたが別のエラーとなりました。

・Key Vault 証明書のインポート に失敗しました: The parameter keyVaultSecret has an invalid value.

この操作は RBAC で許可されていません。ロールの割り当てが最近変更された場合は、ロールの割り当てが有効になるまで数分お待ちください。→10分以上待っているが変わらなく証明書選択が不可となる。

上記設定をコンテナーのアクセス ポリシー戻して、一旦選択できるようにして選択後にAzure ロールベースのアクセス制御へ変更後に追加を行うと以下のエラーが出力される場合がある。

・The service does not have access to '/subscriptions/サブスクリプションID/resourcegroups/リソースグループ名/providers/microsoft.keyvault/vaults/キーコンテナ名' Key Vault. Please make sure that you have granted necessary permissions to the service to perform the request operation.

対処方法のご教授をお願いいたします。

Azure
Azure

Microsoft が管理する世界のデータ センター ネットワークを介してアプリケーションとサービスを構築、配置、および管理するインフラストラクチャおよびクラウド コンピューティング プラットフォーム。


2 件の回答

並べ替え方法: 最も役に立つ
  1. Raja Pothuraju 47,640 評価のポイント Microsoft 社員 モデレーター
    2025-08-28T09:10:04.3833333+00:00

    Hello BNC 大山 彰,

    Based on your description, I understand that you are trying to add a private key certificate to your App Service by importing it from Azure Key Vault. However, while you can view the certificate, you encounter an error when clicking "Add," which states:

    "The service does not have access to '/subscriptions/xxxxxxxxxxx/resourcegroups/keyvault/providers/microsoft.keyvault/vaults/rdcvaulttesting' Key Vault. Please make sure that you have granted the necessary permissions to the service to perform the request operation."

    I faced the same issue while performing this action in my tenant.

    User's image

    After investigating, I found that the problem isn't with Azure Key Vault itself but with Azure App Services, which do not fully support RBAC. As per: Authorize App Service to read from the vault:

    By default, the App Service resource provider doesn't have access to your key vault. To use a key vault for a certificate deployment, you must authorize read access for the resource provider to the key vault. Currently, a Key Vault certificate supports only the Key Vault access policy, not RBAC model.

    To resolve this issue, you need to assign the "Key Vault Certificate User" role to the Microsoft Azure App Service application (Object ID: 3f975d5d-2ff4-415d-9dc8-84cab13db1d5) in your Key Vault’s IAM (Access Control) settings.

    Authorize App Service to read from the vault

    1. Navigate to Azure Key Vault → Access Control (IAM).
    2. Click Add role assignment.
    3. Select "Key Vault Certificate User" role and click Next.
    4. Under Select members, search for Microsoft Azure App Service by name or enter the Object ID: 3f975d5d-2ff4-415d-9dc8-84cab13db1d5.
    5. Click Review + Assign to complete the role assignment.

    User's image

    User's image

    Once this is done, go back to App Service Certificates and try adding the private key certificate again. After following these steps, I was able to successfully import the certificate into my App Service from Key Vault.

    User's image

    I hope this information is helpful. Please feel free to reach out if you have any further questions.

    この回答は役に立ちましたか?


  2. チャブーン 6,716 評価のポイント MVP ボランティア モデレーター
    2025-08-28T08:37:32.72+00:00

    チャブーンです。

    この件ですが、現状ではKeyVaultのアクセス許可は「ロールベースのアクセス許可」が前提で、ポリシーベースのアクセス許可の新規作成はサポートされていない(ただし特別なソリューションでポリシーベースのアクセス許可が指定されている場合は除く)ように思います。以下のページにもその旨が書いてあるようです。

    https://onarimon.jp/entry/2024/06/07/080128

    なので、基本はRBACでのロールベースのアクセス許可が必要です。で、Key Vault Certificate Userロールなのですが、「証明書の読み出し」のみが可能な権限でインポートする権限はありません。セキュリティコンテキスト上厳密に分けられている点に注意してください。どの権限がインポートに適切なのかは、上記資料を参考にしてください。「Key Vault Certificates Officer」が対象だと思われます。

    この回答は役に立ちましたか?

    0 件のコメント コメントはありません

お客様の回答

質問作成者は回答に "承認済み"、モデレーターは "おすすめ" とマークできます。これにより、ユーザーは作成者の問題が回答によって解決したことを把握できます。