# Book Fast (Service Fabric)
A sample demonstrating how to implement a multitenant facility management and accommodation booking application as native Azure Service Fabric reliable services.
Here's the introductory blog [post](https://dzimchuk.net/microservices-primer-with-azure-service-fabric/).
> **Note**: An up-to-date containerized version of the sample is available [here](https://github.com/dzimchuk/book-fast-docker).
## Features
### Architecture
- 4 bounded contexts
- CQRS and DDD (with [reliable domain events](https://dzimchuk.net/reliable-domain-events/))
- Stateless and stateful services
- ASP.NET Core 2.x Web API and web frontend
### Service Fabric
- [Per environment configuration](https://dzimchuk.net/configuring-asp-net-core-applications-in-service-fabric/) integrated with ASP.NET Core infrastructure
- [ServicePartitionClient](https://dzimchuk.net/implementing-a-rest-client-for-internal-communication-in-service-fabric/) and Reverse Proxy based [service clients](https://dzimchuk.net/re-iterating-communication-options-in-service-fabric/)
- Application Insights
- EventFlow
### Security
- [Multitenant](https://dzimchuk.net/enabling-multitenant-support-in-you-azure-ad-protected-applications/) Azure AD organizational accounts
- [Azure AD B2C](https://dzimchuk.net/setting-up-your-asp-net-core-2-0-apps-and-services-for-azure-ad-b2c/) authentication for customers
- OpenID Connect and OAuth2
### Azure services
- Azure SQL databases
- Azure Storage
- Azure Service Bus
- Azure Search
### Misc
- [Swagger and AutoRest](https://dzimchuk.net/generating-clients-for-your-apis-with-autorest/)
- Redis cache
- [Circuit Breaker](https://dzimchuk.net/be-prepared-for-downstream-failures-by-implementing-the-circuit-breaker-pattern/)
![BookFast Service Fabric](BookFastServiceFabric.png)
## Configuration
BookFast.sfproj references `..\..\..\config\BookFast\Local.xml` that is used in local deployment profiles. This file is not included in the repository and you will need to provide your configuration overrides.
Here's a short description of configuration parameters:
```
<?xml version="1.0" encoding="utf-8"?>
<Application xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="fabric:/BookFast" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<Parameter Name="HttpsCertThumbprint" Value="Thumbprint of an SSL certificate installed in the local store" />
<Parameter Name="ASPNETCORE_ENVIRONMENT" Value="Standard APS.NET Core environment setting, e.g. Development" />
<Parameter Name="FacilityServiceUri" Value="http://localhost:19081/BookFast/FacilityService/" />
<Parameter Name="FilesServiceUri" Value="fabric:/BookFast/FilesService" />
<Parameter Name="SearchServiceUri" Value="fabric:/BookFast/SearchService" />
<Parameter Name="BookingServiceUri" Value="fabric:/BookFast/BookingService" />
<Parameter Name="Data:DefaultConnection:ConnectionString" Value="Connection string to a SQL database" />
<Parameter Name="Data:Azure:Storage:ConnectionString" Value="Connection string to an Azure storage account" />
<Parameter Name="Data:Azure:Storage:ImageContainer" Value="book-fast" />
<Parameter Name="ServiceBus:ConnectionString" Value="Connection string to Service Bus topic" />
<Parameter Name="ServiceBus:TopicName" Value="bookfast" />
<Parameter Name="FacilityService:ServiceBus:NotificationQueueConnection" Value="Connection string to the notification queue" />
<Parameter Name="FacilityService:ServiceBus:NotificationQueueName" Value="bookfast-facility-notifications" />
<Parameter Name="BookingService:ServiceBus:NotificationQueueConnection" Value="Connection string to the notification queue" />
<Parameter Name="BookingService:ServiceBus:NotificationQueueName" Value="bookfast-booking-notifications" />
<Parameter Name="Search:QueryKey" Value="Azure Search query key" />
<Parameter Name="Search:AdminKey" Value="Azure Search admin key" />
<Parameter Name="Search:ServiceName" Value="Azure Search service name" />
<Parameter Name="Search:IndexName" Value="book-fast" />
<Parameter Name="ApplicationInsights:InstrumentationKey" Value="Application Insights resource instrumentation key" />
<Parameter Name="Redis:Configuration" Value="Redis connection string" />
<!-- API side setting -->
<Parameter Name="Authentication:AzureAd:B2C:Audience" Value="Your Azure AD B2C API app client ID" />
<!-- API and client side settings -->
<Parameter Name="Authentication:AzureAd:B2C:Instance" Value="Your Azure AD B2C instance, e.g. https://login.microsoftonline.com/" />
<Parameter Name="Authentication:AzureAd:B2C:TenantId" Value="Your Azure AD B2C tenant, e.g. devunleashedb2c.onmicrosoft.com" />
<Parameter Name="Authentication:AzureAd:B2C:ClientId" Value="Your Azure AD B2C app client ID" />
<Parameter Name="Authentication:AzureAd:B2C:ClientSecret" Value="Your Azure AD B2C app client secret" />
<Parameter Name="Authentication:AzureAd:B2C:PostLogoutRedirectUri" Value="e.g. https://localhost:8686/" />
<Parameter Name="Authentication:AzureAd:B2C:ApiIdentifier" Value="Your Azure AD B2C API app identifer" />
<Parameter Name="Authentication:AzureAd:B2C:Policies:SignInOrSignUpPolicy" Value="B2C_1_TestSignUpAndSignInPolicy" />
<Parameter Name="Authentication:AzureAd:B2C:Policies:EditProfilePolicy" Value="B2C_1_TestProfileEditPolicy" />
<Parameter Name="Authentication:AzureAd:B2C:Policies:ResetPasswordPolicy" Value="B2C_1_TestPasswordReset" />
<Parameter Name="Authentication:AzureAd:ApiApp:Instance" Value="Your Azure AD instance, e.g. https://login.microsoftonline.com/" />
<Parameter Name="Authentication:AzureAd:ApiApp:Audience" Value="BookFast API AppId in Azure AD, e.g. https://devunleashed.onmicrosoft.com/book-fast-api" />
<Parameter Name="Authentication:AzureAd:ApiApp:ValidIssuers" Value="Comma separated list of tenant identifiers, e.g. https://sts.windows.net/490789ec-b183-4ba5-97cf-e69ec8870130/,https://sts.windows.net/f418e7eb-0dcd-40be-9b81-c58c87c57d9a/" />
<Parameter Name="Authentication:AzureAd:WebApp:ApiResource" Value="BookFast API AppId in Azure AD, e.g. https://devunleashed.onmicrosoft.com/book-fast-api" />
<Parameter Name="Authentication:AzureAd:WebApp:Instance" Value="Your Azure AD instance, e.g. https://login.microsoftonline.com/" />
<Parameter Name="Authentication:AzureAd:WebApp:ValidIssuers" Value="Comma separated list of tenant identifiers, e.g. https://sts.windows.net/490789ec-b183-4ba5-97cf-e69ec8870130/,https://sts.windows.net/f418e7eb-0dcd-40be-9b81-c58c87c57d9a/" />
<Parameter Name="Authentication:AzureAd:WebApp:ClientId" Value="Your BookFast app's client ID" />
<Parameter Name="Authentication:AzureAd:WebApp:ClientSecret" Value="Your BookFast app's client secret" />
<Parameter Name="Authentication:AzureAd:WebApp:PostLogoutRedirectUri" Value="e.g. https://localhost:8686/" />
</Parameters>
</Application>
```
Please inspect service and application manifests to understand how these parameters are used to configure services.
### Azure AD
Azure AD is used for organizational accounts of facility providers. You will need two applications in Azure AD: one for the APIs (Book Fast API app) and one for the web (BookFast app). Both applications should have multitenant support enabled. BookFast should have a delegated permission to access BookFast API app. If you're new to Azure AD the following post are going to help you out:
- [Protecting your APIs with Azure Active Directory](https://dzimchuk.net/protecting-your-apis-with-azure-active-directory/)
- [Enabling multitenant support in you Azure AD protected applications](https://dzimchuk.net/enabling-multitenant-support-in-you-azure-ad-protected-applications/)
Both apps have a user role called 'Facility Provider' that should be assigned to users to enable them to edit fa
没有合适的资源?快使用搜索试试~ 我知道了~
演示如何将多租户设施管理和住宿预订应用程序实现为本机AzureServiceFabric可靠服务的示例 -C#-JavaScri
共469个文件
cs:352个
csproj:32个
cshtml:27个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 9 浏览量
2023-03-15
19:54:09
上传
评论
收藏 467KB ZIP 举报
温馨提示
(更多详情、使用方法,请下载后细读README.md文件) "快速预订(服务结构) 演示如何将多租户设施管理和住宿预订应用程序实现为本机 Azure Service Fabric 可靠服务的示例。 这是介绍性的博客文章。 注意:此处提供了示例的最新容器化版本。 特征 建筑学 4 个有界上下文 CQRS 和 DDD(具有可靠的领域事件) 无状态和有状态服务 ASP.NET Core 2.x Web API 和 Web 前端 服务架构 与 ASP.NET Core 基础结构集成的每个环境配置 基于ServicePartitionClient和反向代理的服务客户端 应用洞察 事件流 安全 多租户Azure AD 组织帐户 客户的Azure AD B2C身份验证 OpenID 连接和 OAuth2 Azure 服务 Azure SQL 数据库 Azure 存储 Azure 服务总线 蔚蓝搜索 杂项 Swagger 和 AutoRest Redis缓存 断路器 配置 在本地部署配置文件中使用的BookFast.sfproj 引用..\\\\..\\\\..\\\\config\\\\BookFa
资源推荐
资源详情
资源评论
收起资源包目录
演示如何将多租户设施管理和住宿预订应用程序实现为本机AzureServiceFabric可靠服务的示例 -C#-JavaScri (469个子文件)
packages.config 143B
BookFastFacilityAPI.cs 66KB
BookFastBookingAPI.cs 32KB
BookFastFilesAPI.cs 23KB
BookFastFacilityAPIExtensions.cs 15KB
BookFastSearchAPI.cs 11KB
ServiceEventSource.cs 9KB
ServiceEventSource.cs 9KB
ServiceEventSource.cs 9KB
ServiceEventSource.cs 9KB
ServiceEventSource.cs 9KB
ServiceEventSource.cs 9KB
IBookFastFacilityAPI.cs 7KB
ReliableEventsDispatcher.cs 7KB
B2CAuthenticationExtensions.cs 7KB
AccommodationController.cs 6KB
BookFastBookingAPIExtensions.cs 6KB
BlobDistributedMutex.cs 6KB
BookingController.cs 5KB
IntegrationEventReceiver.cs 5KB
FacilityController.cs 5KB
20180508122310_FacilityService_003.Designer.cs 5KB
FacilityController.cs 5KB
FacilityMapper.cs 5KB
20180626184907_FacilityService_004.Designer.cs 4KB
20180427145930_FacilityService_002.Designer.cs 4KB
AccommodationController.cs 4KB
FacilityContextModelSnapshot.cs 4KB
ServiceInstanceListenerFactory.cs 4KB
PolicyConfigurationManager.cs 4KB
UpdateFacilityCommand.cs 4KB
BookFastFilesAPIExtensions.cs 4KB
CompositionModule.cs 4KB
CreateFacilityCommand.cs 4KB
SearchResultMapper.cs 4KB
BookingController.cs 4KB
BookingRepository.cs 4KB
AccommodationMapper.cs 4KB
FabricTelemetryInitializer.cs 4KB
BlobLeaseManager.cs 4KB
IBookFastBookingAPI.cs 4KB
AccountController.cs 4KB
Program.cs 4KB
UpdateAccommodationCommand.cs 4KB
20180409135830_FacilityService_001.Designer.cs 4KB
CreateAccommodationCommand.cs 4KB
FacilityQueryDataSource.cs 4KB
Facility.cs 3KB
FileAccessController.cs 3KB
20180409135830_FacilityService_001.cs 3KB
HttpExceptionHandler.cs 3KB
BookingRecord.cs 3KB
FacilityRepresentation.cs 3KB
BookingProxy.cs 3KB
AccommodationProxy.cs 3KB
CircuitBreakingBookingProxy.cs 3KB
FacilityRepository.cs 3KB
BookFastIndex.cs 3KB
OrganizationalAuthenticationExtensions.cs 3KB
IBookFastFilesAPI.cs 3KB
ServiceCollectionExtensions.cs 3KB
BookingRepresentation.cs 3KB
FileAccessService.cs 3KB
CompositionModule.cs 3KB
AccommodationRepresentation.cs 3KB
AccommodationRepository.cs 3KB
ServiceReplicaListenerFactory.cs 3KB
BookingMapper.cs 3KB
AccessTokenProvider.cs 3KB
FacilityProxy.cs 2KB
CompositionModule.cs 2KB
Accommodation.cs 2KB
20180626184907_FacilityService_004.cs 2KB
FacilityMapper.cs 2KB
RepositoryExtensions.cs 2KB
FacilityCommunicationClientFactory.cs 2KB
FilesCommunicationClientFactory.cs 2KB
CustomerAccessTokenProvider.cs 2KB
ReauthenticationRequiredFilter.cs 2KB
CompositionModule.cs 2KB
SearchIndexer.cs 2KB
FileAccessProxy.cs 2KB
AccommodationMapper.cs 2KB
FileAccessController.cs 2KB
SASTokenProvider.cs 2KB
Program.cs 2KB
Program.cs 2KB
BookAccommodationCommandHandler.cs 2KB
Program.cs 2KB
Program.cs 2KB
Program.cs 2KB
CachingFacilityDataSource.cs 2KB
UpdateAccommodationCommandHandler.cs 2KB
BookingRecordMapper.cs 2KB
ImagePathHelper.cs 2KB
SearchServiceProxy.cs 2KB
BookingQueryDataSource.cs 2KB
CompositionModule.cs 2KB
FacilityProxy.cs 2KB
FacilityDataSource.cs 2KB
共 469 条
- 1
- 2
- 3
- 4
- 5
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功