You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Azure CLI启用az security assessment及解决扩展缺失问题

Fix for "az security: 'assessment' is not in the 'az security' command group" Error

I’ve run into this exact issue before—here’s how to get the az security assessment commands working properly:

Step 1: Update your Azure CLI first

Chances are, your Azure CLI version is outdated and doesn’t include the assessment subcommand in the core az security group. Updating to the latest version will often resolve this automatically. Run:

az upgrade

This command updates both the CLI itself and any installed extensions to their latest versions. Once it finishes, try running az security assessment --help—if the command now shows up, you’re good to go!

Step 2: Install the security extension (if updating isn’t enough)

If updating the CLI doesn’t add the assessment commands, you’ll need to install the dedicated security extension. This extension adds extra security-related commands that aren’t in the core CLI yet. Install it with:

az extension add --name security

To confirm the extension was installed correctly, run:

az extension list --query "[].name"

You should see security in the output list. Now your az security assessment commands should work as expected.

Step 3: Double-check permissions and subscription

If you still have issues, make sure you’re logged into the right Azure subscription with az account show, and that your account has permissions like Security Reader or Owner to access security assessments. Without the right permissions, even the correct commands will fail.

内容的提问来源于stack exchange,提问作者Jason

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 07:38:38