没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
PUBLISHED BY
Microsoft Press
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
Copyright © 2014 Microsoft Corporation
All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any
means without the written permission of the publisher.
ISBN: 978-0-7356-9565-8
Microsoft Press books are available through booksellers and distributors worldwide. If you need support
related to this book, email Microsoft Press Book Support at mspinput@microsoft.com
. Please tell us what
you think of this book at http://aka.ms/tellpress.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights
under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval
system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft and the trademarks listed at
http://www.microsoft.com/about/legal/en/us/IntellectualProperty/
Trademarks/EN-US.aspx are trademarks of the Microsoft group of companies. All other marks are property of
their respective owners.
The example companies, organizations, products, domain names, email addresses, logos, people, places, and
events depicted herein are fictitious. No association with any real company, organization, product, domain
name, email address, logo, person, place, or event is intended or should be inferred.
This book expresses the authors’ views and opinions. The information contained in this book is provided without
any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or
distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this
book.
Acquisitions, Developmental, and Project Editor: Devon Musgrave
Editorial Production: Flyingspress and Rob Nance
Copyeditor: John Pierce
Cover: Twist Creative • Seattle and Joel Panchot
1
Table of Contents
Introduction ............................................................................................................................................................................................ 9
Who should read this book ......................................................................................................................................................... 9
Assumptions .................................................................................................................................................................................. 9
This book might not be for you if… ......................................................................................................................................... 9
Organization of this book ..........................................................................................................................................................10
The Fix It sample application ....................................................................................................................................................12
Azure Websites ...............................................................................................................................................................................15
System requirements ....................................................................................................................................................................17
Downloads: Code samples .........................................................................................................................................................17
Acknowledgments .........................................................................................................................................................................18
Errata, updates, & book support ..............................................................................................................................................19
Free ebooks from Microsoft Press...........................................................................................................................................19
We want to hear from you .........................................................................................................................................................19
Stay in touch ....................................................................................................................................................................................19
Chapter 1 Automate everything ...............................................................................................................................................20
DevOps workflow ...........................................................................................................................................................................20
Azure management scripts ........................................................................................................................................................21
Environment creation script ......................................................................................................................................................21
Run the script ..............................................................................................................................................................................21
A look at the scripts .................................................................................................................................................................25
Parameters in the main script ..............................................................................................................................................25
Create the website ....................................................................................................................................................................25
Create the storage account ...................................................................................................................................................26
Create the databases ...............................................................................................................................................................26
Store app settings and connection strings .....................................................................................................................28
Preparing for deployment .....................................................................................................................................................29
2
Troubleshooting and error handling ................................................................................................................................ 29
Deployment script ......................................................................................................................................................................... 30
Summary ........................................................................................................................................................................................... 31
Resources .......................................................................................................................................................................................... 32
Chapter 2 Source control ............................................................................................................................................................ 33
Treat automation scripts as source code ............................................................................................................................. 33
Don’t check in secrets .................................................................................................................................................................. 34
Structure source branches to facilitate DevOps workflow ............................................................................................ 34
Add scripts to source control in Visual Studio ................................................................................................................... 36
Store sensitive data in Azure ..................................................................................................................................................... 38
Use Git in Visual Studio and Visual Studio Online ........................................................................................................... 40
Summary ........................................................................................................................................................................................... 46
Resources .......................................................................................................................................................................................... 46
Chapter 3 Continuous integration and continuous delivery ........................................................................................ 48
Continuous integration and continuous delivery workflow ......................................................................................... 48
How the cloud enables cost-effective CI and CD ............................................................................................................. 49
Visual Studio Online ..................................................................................................................................................................... 49
Summary ........................................................................................................................................................................................... 50
Resources .......................................................................................................................................................................................... 50
Chapter 4 Web development best practices ....................................................................................................................... 52
Stateless web tier behind a smart load balancer .............................................................................................................. 52
Avoid session state ........................................................................................................................................................................ 56
Use a CDN to cache static file assets ..................................................................................................................................... 56
Use .NET 4.5’s async support to avoid blocking calls ..................................................................................................... 57
Async support in ASP.NET 4.5.............................................................................................................................................. 57
Async support in Entity Framework 6 ............................................................................................................................... 58
Summary ........................................................................................................................................................................................... 59
Resources .......................................................................................................................................................................................... 60
Chapter 5 Single sign-on ............................................................................................................................................................. 62
3
Introduction to Azure Active Directory .................................................................................................................................62
Set up an Azure AD tenant ........................................................................................................................................................65
Create an ASP.NET app that uses Azure AD for single sign-on ..................................................................................75
Summary ...........................................................................................................................................................................................79
Resources ..........................................................................................................................................................................................79
Chapter 6 Data storage options ................................................................................................................................................81
Data storage options on Azure ................................................................................................................................................81
Hadoop and MapReduce ...........................................................................................................................................................83
Platform as a Service (PaaS) versus Infrastructure as a Service (IaaS) .......................................................................86
Choosing a data storage option ..............................................................................................................................................89
Demo—Using SQL Database in Azure ..................................................................................................................................91
Entity Framework versus direct database access using ADO.NET ..............................................................................96
SQL databases and the Entity Framework in the Fix It app ..........................................................................................97
Choosing SQL Database (PaaS) versus SQL Server in a VM (IaaS) in Azure ...........................................................99
Summary ........................................................................................................................................................................................ 101
Resources ....................................................................................................................................................................................... 101
Chapter 7 Data partitioning strategies ................................................................................................................................ 104
The three Vs of data storage .................................................................................................................................................. 104
Vertical partitioning ................................................................................................................................................................... 105
Horizontal partitioning (sharding) ....................................................................................................................................... 106
Hybrid partitioning..................................................................................................................................................................... 107
Partitioning a production application ................................................................................................................................ 108
Summary ........................................................................................................................................................................................ 108
Resources ....................................................................................................................................................................................... 109
Chapter 8 Unstructured blob storage .................................................................................................................................. 110
What is Blob storage? ............................................................................................................................................................... 110
Creating a storage account..................................................................................................................................................... 111
Using Blob storage in the Fix It app .................................................................................................................................... 112
Set up the Blob container ................................................................................................................................................... 112
4
剩余197页未读,继续阅读
资源评论
sygwin_net
- 粉丝: 40
- 资源: 43
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功