如何部署成员提供分贝魔豆 [英] how to deploy membership provider db to beanstalk

查看:135
本文介绍了如何部署成员提供分贝魔豆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个默认的MVC 4应用程序使用Web API。到目前为止,我已经增加了一些API调用。
我想用开箱成员提供的,没有定制。

i have created a default MVC 4 app with web api. so far i have added a few API calls. i would like to use the out of the box membership provider with no customization.

在我的本地计算机上我已经添加两个用户,并增加了两个用户角色。

on my local machines i have added two users and added two user roles.

在我所添加的API [授权]的API调用属性类。

in the api i have added [Authorize] attribute for the API calls class.

它工作得很好,如果用户没有登录prevents调用API。

It works well and prevents calls to API if the user is not logged in.

然而,当我到Amzaon魔豆部署应用程序的注册和登录功能都坏了。我正在

However, when i deploy the app on to Amzaon Beanstalk the Register and Login functions are broken. I am getting

Error. An error occurred while processing your request.

在应用程序中我有web.config中:

in the web.config of the application i have:

  <connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-UserListsActionsTest-20131103214231;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-UserListsActionsTest-20131103214231.mdf" providerName="System.Data.SqlClient" />
  </connectionStrings>

另外,我还去了项目的属性,并设置项目部署在这个项目中的所有文件。

Also, i have gone to the properties of the project and set "Items to deploy" to all files in this project.

应该说是不够的?我是否需要创建一个青苗SQL数据库?

should that not be enough? do i need to create a SQL db on beanstalk?

将大大AP preciate一些帮助。

would greatly appreciate some help.

推荐答案

在我的经验中,我使用亚马逊RDS服务,创建一个SQL Server实例,我的连接字符串指向在我要跑了我所有的迁移到该数据库。这也可以将其指向任何SQL Server实例你有适当的连接字符串。

In my experience, I've used Amazons RDS service to create a SQL Server instance and point my connection string to that in which I'll run all of my Migrations to that database. That or you can point it to whatever SQL Server instance you have with the appropriate connection string.

您可以调用更新数据库,并有在种子创建了用户/用户角色()方法。

You can then call update-database and have your Users / User Roles created in the Seed() method.

FYI:您可能需要将RDS实例中配置一定的端口/权限与弹性青苗实例友好。 (想想安全组)

FYI: You may need to configure certain ports/permissions within the RDS instance to be friendly with the Elastic Beanstalk instance. (Think about security groups)

我也下载AWS工具包Visual Studio的,因为它会帮助你与数据库连接字符串,并直接发布到AWS弹性魔豆的能力设置。

I would also download the AWS Toolkit for Visual Studio as it'll help get you setup with the database connection string and the ability to publish straight to AWS Elastic Beanstalk.

这篇关于如何部署成员提供分贝魔豆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆