Azure 网站:有哪些陷阱?

发布于 2024-12-11 05:17:23 字数 278 浏览 1 评论 0原文

我正在设计一个网站,该网站最初将托管在标准 ASP.Net 环境中,但希望以后能够轻松地将其移动到 Azure。这两个环境之间有什么问题,我需要注意什么。我试图弄清楚在设计网站时需要注意什么。

一般站点要求/上下文:

  • 简单的应用程序站点
  • 支持个人用户登录
  • 支持数据存储,不一定必须是
  • 上传/下载单个文件的关系支持(平均 1k - 25k,基于文本)

任何帮助或值得关注的内容如果能够跨越这两个世界,我们将不胜感激。

I'm designing a web site that will initially be hosted in a standard ASP.Net environment but want to be able to easily move it to Azure later. What are the gotchas between the two environments, and what do I need to be careful of doing. I'm trying to figure out as I design the site what I need to be careful of doing.

General site requirements / context:

  • Simple application site
  • support individual user login
  • support for data store, doesn't necessarily have to be relational
  • support for upload/download of individual files (1k - 25k on avg, text based)

Any help or things to watch out for in straddling these two worlds would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ι不睡觉的鱼゛ 2024-12-18 05:17:23

陷阱可能意味着很多事情...... :)

一般来说,代码应该很容易从 ASP.NET 迁移到 Azure

需要注意的事情:

  • 会话状态很糟糕,因为你永远不确定你会遇到哪个 Azure VM
  • 您不想将任何内容保留到文件系统中。 MS 将保证虚拟机正常运行,但它们可以回收服务器上的任何文件,并且这些文件将会丢失。持久性应该发生在 Blob 和/或表存储中。
  • 如果您要对单个文件进行大量下载,请考虑从单独的 URL 开始。然后,您可以轻松使用 Azure CDN 进行全球分发,并为用户提供更好的
  • Azure 表存储性能。这将提供比 SQL 存储低一个数量级的成本,并且非常适合某些场景。但是,没有本机 ASP.NET 版本。如果您认为想要使用 Azure 表存储,请从它开始。 MS 的典型示例是博客文章。我们过去曾成功使用过,但存在一些问题,例如如果您的应用程序需要
  • 登录,则数据区分大小写,可以使用 ASP.NET 堆栈中的成员身份提供程序构造。显然,开箱即用的是 SQL,但您可以自行使用表存储

还有很多其他东西,但一般来说,ASP.NET 应用程序可以非常轻松地迁移。如果您想考虑利用一些 Azure 特定功能,例如表存储或辅助角色,这些功能本身并不存在于 ASP.NET 堆栈中,最好只在 Azure 中启动站点。

如果您有具体问题,请 Ping

Gotchas can mean a whole lot of things..... :)

In general, the code should easily migrate from ASP.NET to Azure

Things to be aware of:

  • Session state is bad since you are never sure what Azure VM you will hit
  • You don't want to persist ANYTHING to the file system. MS will gurantee VMs will be up, but they can recycle any files you have on the server and they will be lost. Persistence should happen in Blob and/or Table storage.
  • If you are doing lots of downloads of individual files, consider starting out with a separate URL. You can then easily use the Azure CDN for distributing globally and providing users better performance
  • In regards to Azure table storage. This will provide an order of magnitude less cost than SQL storage and works great for certain scenarios. However, there is not a native ASP.NET version of this. If you think you want to use Azure table storage, start with it. The canonical example from MS are blog posts. We have used successfully in the past, but there are some gotchas like data being case sensitive if you need for your application
  • Logins can use the Membership provider constructs in the ASP.NET stack. Obviously, out of the box is SQL, but you could roll your own to use table storage

There are plenty of other things, but in general, ASP.NET applications can migrate pretty easily. If you want to look at utilizing some Azure specific features, like table storage or worker roles, those do not exist natively in the ASP.NET stack and it would be best to just start the site in Azure.

Ping if you have specific questions

提赋 2024-12-18 05:17:23

我一直在 Windows Azure 网站备忘单 上构建了一系列更深入的技术内容,您可以查看该列表以获取更多内容。目前它主要包含 PHP 信息,但我希望很快能够扩展 Python、Node.js、.NET、Java 和其他网站技术内容。

这个网站最酷的一点是,它可以在 github Microsoft Azure 网站备忘单上找到,所以如果您遇到问题,您可以将其记录下来以帮助更大的 Azure 网站社区。

I've been building up a list of deeper technical content on Windows Azure Web Sites Cheat Sheet which you could view for more content. Currently it's heavily weighted with PHP information, but I hope to extend with Python, Node.js, .NET, Java and other Web Sites technical content soon.

The cool thing about this site, is that it is available on github Microsoft Azure Web Sites Cheat Sheet so if you run into something, you can document it to help out the greater Azure Web Sites Community.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文