0

我正在尝试运行以下命令来删除 Azure 中未使用的网络安全组,但该命令不断返回“子网/默认值不能为空或为空。”??

let subnetParameters = {
            id: "/subscriptions/MysubscriptionId/resourceGroups/helloStorageResouceGrp/providers/Microsoft.Network/virtualNetworks/helloStorageResouceGrpvnet860/subnets/default",
            networkSecurityGroup: {                    
                id:'/subscriptions/MySubscription/resourceGroups/helloStorageResouceGrp/providers/Microsoft.Network/networkSecurityGroups/babNewMachineForEncryption-nsg',
                name: null
            }
        }
        let resourceGroupName = 'helloStorageResouceGrp';
        let virtualNetworkName = 'helloStorageResouceGrpvnet860';
        let subnetName = 'default';
        let removeSecurityGroup = await NetworkManagement.subnets.createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters)
        console.log('removeSecurityGroup: ', JSON.stringify(removeSecurityGroup));

4

1 回答 1

0

尝试这样做:

let subnetParameters = {
     id: "/subscriptions/MysubscriptionId/resourceGroups/helloStorageResouceGrp/providers/Microsoft.Network/virtualNetworks/helloStorageResouceGrpvnet860/subnets/default",
     networkSecurityGroup: {}
}
于 2020-08-19T12:58:40.983 回答