Microsoft.Azure.Management.Resourcemanager.Fluent 和 Microsoft.Azure.Management.Fluent nuget 包有什么区别?

What is the difference between Microsoft.Azure.Management.Resourcemanager.Fluent and Microsoft.Azure.Management.Fluent nuget packages?

A​​zure 资源管理有 2 个 nuget 包:

  1. Microsoft.Azure.Management.Resourcemanager.Fluent
  2. Microsoft.Azure.Management.Fluent

这些 nuget 包究竟有何不同以及何时使用哪一个?

Microsoft.Azure.Management.Fluent is a wrapper package,依赖其他专用包,如Microsoft.Azure.Management.Resourcemanager.Fluent / Microsoft.Azure.Management.Storage.Fluent等,你可以参考下面这个截图:

Microsoft.Azure.Management.Fluent包提供了认证/指定订阅等基本功能,同时也提供了很多属性,比如ResourceGroups/StorageAccounts,你可以使用这些属性来创建ResourceGroups / StorageAccounts 管理的入口点。截图如下:

Microsoft.Azure.Management.Resourcemanager.Fluent 用于管理 Azure 资源,如创建/更新/删除资源组/存储帐户等。它需要包 Microsoft.Azure.Management.Fluent 进行身份验证/获取入口点。

所以对于你的问题,你应该总是安装包 Microsoft.Azure.Management.Fluent,它会自动安装我在屏幕截图 1 中列出的所有其他专用包。然后在你的代码中,Microsoft.Azure.Management.Fluent 提供了一些基本的诸如身份验证/创建入口点之类的服务,然后使用 Microsoft.Azure.Management.Resourcemanager.Fluent 等其他包来为 Azure 资源(如创建/更新/删除)做一些管理工作。

为了更好地理解,您可以查看示例 here