售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Title Page
Copyright
Serverless computing in Azure with .NET
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Why subscribe?
Customer Feedback
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
Understanding Serverless Architecture
What is serverless?
Azure serverless
Architecture
Inherent features
Asynchronous
Stateless
Idempotent and defensive
Execution restrictions
Limited execution time
Startup latency
Advantages of serverless computing
Scalability
Pay-As-You-Go
Reduced operational costs
Speed of deployment
Independent technology stack and updates
Integration with the cloud provider
Open source
Disadvantages of serverless computing
Distributed system complexity
Potential load on downstream components
Potential for repetitive code
Different operations
Security and monitoring
Testing
Vendor control
Vendor lock-in
Multitenancy
Vendor-specific limitations
Applications
Summary
Getting Started with the Azure Environment
Microsoft Azure Cloud
Azure account
Azure subscription
Subscription constraints
Creating a subscription
Azure Management APIs
API access
The Azure Resource Manager API
Resource groups
Azure Resource Manager templates
Azure Management Portal
Azure serverless computing
Hosting Plan
Function App
Azure Function
Deploying a function
Creating an Azure serverless environment
The App name parameter
The Subscription parameter
The Resource Group parameter
The Hosting Plan parameter
The Location parameter
The Storage parameter
The Automation options link
Deploying the application
Functions Portal
Deploying Azure Functions online
Function files
The function.json file
The run.csx file
HTTP endpoint
Exploring the Functions Portal
The Test pane
Function logs
Error output
Function App settings
Application Settings
Daily Usage Quota
The runtime version
The Function App edit mode
Host keys
Slots
Proxies
The Platform features pane
App Service Editor
Dev Console
Resource Explorer
Clean up Azure resources
Deleting a function
Deleting the Function App
Deleting the resource group
Exploring further options
Summary
Setting Up the Development Environment
Configuring the development environment
Downloading and installing Visual Studio
Creating the project
Function App Configuration Files
The local.settings.json file
The host.json file
Creating the function
Running the function locally
Deploying the application to Azure
Modifying the text scoring function
Updating the function code
Republishing the function to Azure
Storing the results
Setting up the SQL PaaS database in Azure
Creating the SQL Server
Managing the SQL database from Visual Studio
Creating the DocumentTextScore table
Integrating the ScoreText function with the SQL database
Modifying the function to store results in SQL
Setting up a web dashboard for scoring results
Connecting the ASP.Net Core Web Application to the database
Installing Entity Framework dependencies
Get the SQL Azure connection string
Updating the generated database context
Dependency injection
Creating the web UI
Creating the MVC controller
Creating the MVC view
Changing the application home page
Publishing to Azure
Tying it all together
Summary
Configuring Endpoints, Triggers, Bindings, and Scheduling
Triggers and bindings
Triggers
Binding
Trigger binding
Input binding
Output binding
Advanced bindings
Endpoints
Custom routes
Allowed methods
API definition
Proxies
Securing the endpoints
Blob Storage trigger
Creating a storage account for document upload
Getting the storage connection string
Creating a Blob trigger function
Function code
Triggering the function
Updating the function to process text
Timer trigger
CRON expression
Implementing the average result function
Defining the SQL table binding
Finding an existing entity
Full Function Code
Summary
Integrations and Dependencies
Processing a Twitter feed
Creating a WebHook Trigger function
Creating the Logic App to search Twitter
Sharing code between functions
Integrating with a Service Bus queue
Email processing using Service Bus
Creating a Service Bus queue
Configuring the access permissions
Listen Access Policy for the function
Send Access Policy for the Logic App
Creating the function
Other Service Bus configuration options
Sending email messages to Service Bus Queues
Testing the Service Bus flow
.NET dependency
Adding NuGet libraries
Summary
Integrating Azure Functions with Cognitive Services API
Using Microsoft Cognitive Services APIs to analyze text
Creating a Cognitive API account
Text sentiment API usage
The text sentiment analytics API call implementation
Constructing the payload
Calculating the overall score
Using Sentiment Analysis in Azure Functions
A short text analysis example
A long text analysis example
Storing the function results
Storing tweet score results using the shared code
Creating the TweetTextScore table
Updating the ScoreTweet function
Reflecting the new results in the Web dashboard
Updating the model from database
Updating controllers and views
Summary
Debugging Your Azure Functions
Software debugging
Logging events
Logging best practices
Logging adequately
Logging with context
Logging in a readable format
Logging at the proper level
Logging during normal operation
Debugging the functions locally
Debugging functions with Visual Studio
Triggering the functions
HTTP-triggered function
Triggering functions using Functions Core tools
Blob Storage triggered function
Triggering a function using custom code
Triggering a function using functions
Triggering the Service Bus queue function locally
Handling errors
Remote debugging in the cloud
Summary
Testing Your Azure Functions
The importance of testing
Software testing
Software assessment perspectives
Code correctness
Unit testing
Integration testing
System testing
Performance
Performance testing
Load testing
Usability
Testing the functions
Unit testing
Unit testing approach
Naming convention
Unit test best practices
What to cover
Mocking frameworks
Dependency injection
Creating a test project
Creating a unit test
The ProcessQueue function - input string, and logged output
Getting more granular
Asynchronous tests
Unit test examples
Unit test examples
The EvaluateText class - API failure and method failure
Integration testing
The ScoreTweet function - updating an entity
Performance testing
Load testing
Summary
Configuring Continuous Delivery
Version Control System
Centralized VCS
Distributed VCS
Common practices
Committing best practices
Database versioning
Continuous Integration and delivery
Version control for functions
Configuring VSTS
Configuring the repository
Linking the Azure subscription to VSTS
Continuous delivery for functions
Deployment slots
Configuring the VSTS build process
Configuring the NuGet restore task
E-mail notifications
Configuring Release
Load testing with VSTS
Automating Function App deployment
Summary
Securing Your Application
Securing the application
Physical security
Host infrastructure
Networking security
Integrating functions with a private network
Networking concepts
Azure App Service
VNet integration
Hybrid connections
App Service Environment
ASE deployment modes
Public App Service Environment
Adding a Network Security Group
Adding an NVA
Private App Service Environment
Application-level security
Authorization and authentication
Anonymous mode
API key authorization
HTTP trigger
Webhook trigger functions
User-based authentication
Configuring Azure Active Directory
Third-party identity providers
Code quality
Managing keys and secrets
Data encryption at rest
Data encryption in transit
Configuring a custom domain
Configuring SSL
Configuring CORS
Administrative access
Role-based access control
Resource locks
Summary
Monitoring Your Application
Application performance management
Detect
Diagnose
Measuring and learning
Monitoring tools
Collecting logs
Creating charts
Setting up alerts
Avoiding alert fatigue
Alerting on actionable items
Functions monitoring tools
Functions Monitor tab
Application Insights
Monitoring functions with Application Insights
Setting up local configuration
Staging slot reporting
Application Insights dashboards
Live Stream
Metrics dashboards
Performance dashboard
Dashboard customization
Servers dashboard
Failures dashboard
Metrics Explorer
Custom telemetry
Analytics view
Setting up alerts
Smart Detection
Summary
Designing for High Availability, Disaster Recovery, and Scale
High Availability
Service downtime
Azure services SLAs
What is covered by the SLA
What is not covered by the SLA
Fault tolerance
Elimination of single points of failure
Transient fault handling
Setting timeouts
The Retry pattern
The Circuit Breaker pattern
Message Queuing
The Retry pattern in Azure Functions
The Retry logic in Logic Apps
Fault containment
Fault detection
Prevention of human errors
Disaster Recovery
What is a disaster?
Disaster Recovery planning in Azure
DR site type
Implementing a hot DR site
DR in Functions
Web Apps
Logic Apps
Azure Service Bus
Azure Storage
Azure SQL Database
The Text Analytics API
Scaling the application
Scaling serverless compute
Consumption plan
App Service plan
Scaling other application components
Web Apps
Azure SQL Database
Azure Service Bus
Azure Storage
Logic Apps
Text Analytics API
Load testing
Summary
Designing Cost-Effective Services
Pay for what you use
Azure Functions pricing
Consumption plan
The Consumption plan pricing based on load
App Service plan
The App Service plan pricing based on load
The overall application cost
Web Apps
Web App pricing based on load
Azure SQL Database
Azure SQL Database pricing based on load
Azure Blob Storage
Azure Blob Storage pricing based on load
Azure Logic Apps
Azure Logic App pricing based on load
Azure Service Bus
Azure Service Bus pricing based on load
The Text Analytics API
Text Analytics API pricing based on load
Network bandwidth
Application Insights
Application Insights pricing based on load
Visual Studio Team Services
Calculating the overall applications costs
Summary
C# Script-Based Functions
C# script-based functions
Using NuGet libraries
Option 1 - the #r directive
Option 2 - the project.json file
Sharing code between functions
Summary
Azure Compute On-Demand Options
Compute on-demand
Azure WebJobs
Azure Logic Apps
Azure Batch
Azure PaaS Cloud Services
Summary
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜