小编hon*_*onk的帖子

Azure Service Fabric中的应用程序设计

我需要帮助如何考虑设计我们的应用程序以适应新的Azure Service Fabric模板.

今天,我们有一个基于Azure云服务的应用程序.该应用程序是围绕DDD构建的,我们为应用程序的不同子系统部分提供了单独的有界上下文.今天有界上下文托管在一个工作者角色中,该角色使用单个WebAPI公开这些子系统.

此外,我们有一个托管Web前端的Web角色和一个处理后台队列的Worker角色.

我们努力转向微服务架构.我打算做的第一件事就是将所有有界上下文提取到自己的API主机中.这将导致5-10个新的WebAPI服务支持我们的子系统.

我的问题是,所有这些子系统/有界上下文/ API主机是否应该是他们自己的Service Fabric应用程序或单个Service Fabric应用程序中的服务?

我已经阅读了文档,在这里找到Service Fabric Application Model,一遍又一遍,我无法弄清楚我的服务适合哪里.

我们希望系统支持不同版本的服务,并且服务也应该可以扩展到不同的服务.甚至可能需要让一个微服务以更大的VM大小运行,然后其余的.

请有人指导我,以满足我的需求.

architecture azure asp.net-web-api2 azure-service-fabric

7
推荐指数
1
解决办法
960
查看次数

将discriminator列添加为Entity Framework中唯一索引的一部分

是否可以使用EF Fluent API将Discriminator列和另一个字符串列配置为唯一索引约束的一部分?

我有一个标识符列表,其中标识符可以是不同类型.每个标识符都有一个string类型的属性,用于保存标识字符串.

在我的情况下,客户可以使用不同的标识符.但每个鉴别器只能有一个带唯一字符串的标识符.

定义标识符类型的抽象类

 public abstract class CustomerIdentifier : Entity<int>
 {
    public string Identifier { get; set; }
 }
Run Code Online (Sandbox Code Playgroud)

从CustomerIdentifier派生的具体类

 class NationalIdNumberIdentifier : CustomerIdentifier
 {
 }
Run Code Online (Sandbox Code Playgroud)

我已经设法使用此处的答案为字符串列配置索引 ,实体框架中的多个列的唯一键约束如下所示

class CustomerIdentifierMap : EntityTypeConfiguration<CustomerIdentifier>
{
    public CustomerIdentifierMap()
    {
        Property(p => p.Identifier).HasMaxLength(100).IsRequired().HasUniqueIndexAnnotation("UQ_IdentifierPerDiscriminator", 0);
    }
}
Run Code Online (Sandbox Code Playgroud)

我需要以某种方式添加另一行,在此处指定discriminimnator应包含在唯一索引约束中.

c# sql-server entity-framework entity-framework-6

6
推荐指数
1
解决办法
1797
查看次数

使用Azure SDK 2.8在VSO上托管构建失败

我们最近将Azure SDK更新为2.8.现在,在VSO托管构建上构建我们的解决方案时,我们会遇到构建错

未找到导入的项目"C:\ Program Files(x86)\ MSBuild\Microsoft\VisualStudio\v14.0\Windows Azure Tools\2.8\Microsoft.WindowsAzure.targets".
确认<Import>声明中的路径是正确的,并且该文件存在于磁盘上.

我发现另一个问题与MSDN上发布的问题有类似问题,但没有任何答案.在托管构建中支持Azure SDK 2.8

任何人都知道如何解决这个问题?我们必须降级吗?

azure azure-sdk-.net azure-devops azure-pipelines

5
推荐指数
1
解决办法
998
查看次数

如何使用 ARM 模板为注释创建 Application Insights API 密钥

我正在尝试从 ARM 模板创建 Application Insights API 密钥。我需要在资源部署期间创建用于写入注释的 API 密钥,以便在从 Azure Devops 部署应用程序期间使发布注释正常工作。

我尝试查找有关如何实现此功能的信息,但我只能找到有关如何使用 PowerShell 或 Azure REST API 创建密钥的示例。

我需要开始工作的是使用 ARM 模板创建 API 密钥。我已经尝试了很多与此类似的 json 尝试,但没有成功;

 {
  "name": "[variables('applicationInsightsName')]",
  "type": "Microsoft.Insights/components",
  "location": "[resourceGroup().location]",
  "apiVersion": "2014-04-01",
  "tags": {
    "displayName": "[concat('Component ', variables('applicationInsightsName'))]"
  },
  "properties": {
    "applicationId": "[variables('applicationInsightsName')]"
  },
  "resources": [
    {
      "name": "action",
      "type": "apikeys",
      "location": "[resourceGroup().location]",
      "apiVersion": "2015-05-01",
      "properties": {
        "name": "Azure Devops Release Annotations",
        "linkedWriteProperties": [
          "[concat(resourceId('Microsoft.Insights/components', variables('applicationName')), '/annotations')]"
        ],
        "linkedReadProperties": []
      },
      "dependsOn": [
        "[resourceId('Microsoft.Insights/components', variables('applicationInsightsName'))]"
      ]
    } …
Run Code Online (Sandbox Code Playgroud)

azure azure-resource-manager azure-application-insights azure-rm-template

2
推荐指数
1
解决办法
1530
查看次数