We want our Host database to store all our lookup tables as well as all user details, roles, permission, invoices, subscriptions etc but we also want each tenant to have their own database, which will use its own set of tables that are not specific to Asp Net Zero, e.g. Students, Classes etc. I think the best way to acheive this is to use multiple db context but I am not sure what the best aproach to use is? Has anyone else done anything similar to this?
We also have Two different types of Tenant, denoted by a field in abpTenants called "TenantType". Each tenant type will need different tables so I am thinking I need 3 db context, 1 for the Main ABP stuff and another one for each tenant type, I then need to be able to access 2 different dbContexts per tenant, The Main one and the second tenant specific one.
The reason for splitting off the user data is so that users do not need to specify a Tenant when logging in, they will have a unique email address that they log in with, which then tells us which tenant they are. I think i need something like this but I am not sure I understand it clearly?
https://stackoverflow.com/questions/49243891/how-to-use-multiples-databases-in-abp-core-zero
I think I have the same issue, I have a multitenant app with unique email addresses for each user. There is no way to select a tenant from the login screen, it gets the tenant id from the username/password entered (Username is synced with Email). I have got a "Login with Azure AD" button but the Azure AD they log into will depend on their email address as each tenant will have their own App registration?
I basically need microsoft to Authenticate them, then I will need to check that we have a tenant setup for them on our system and that they are in a valid Security Group to allow them to login to their tenancy with the relivant roles. I will need to look at the Client ID and Client Secret sent back as part of the login process to see if it matches up with any tenant in our DB.
But how do I know which Azure AD url to use if I dont know what the tenant is? From my research it looks as if I should create my own App Registration in our own Azure AD and set it up to 'Accounts in any organizational directory (Any Azure AD directory - Multitenant)' which will allow my requests for authentication to all be passed to the same place. My customers will then need to setup their own App Registration and I will need to store these details against each tenant in my DB so that once they have been authenticated, I can work out which tenant they belong to and check to make sure they are in the right Role/Security Group to be able to access the software?
Ok so I have now got my Pipeline working correctly, for anyone else that is interested, here is my YAML:
pool:
name: MyBuildPool - Self Hosted
demands:
- msbuild
- visualstudio
- npm
- vstest
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk 6.x'
inputs:
version: 6.x
includePreviewVersions: true
- task: NuGetToolInstaller@1
displayName: 'Use NuGet 6.x'
inputs:
versionSpec: 6.x
- task: NuGetCommand@2
displayName: 'NuGet restore MyProject.Demo'
inputs:
restoreSolution: 'aspnet-core/MyProject.Demo.Web.sln'
- task: VSBuild@1
displayName: 'Build solution MyProject.Demo.Web.Host'
inputs:
solution: 'aspnet-core/src/MyProject.Demo.Web.Host/MyProject.Demo.Web.Host.csproj'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- task: DeleteFiles@1
displayName: 'Delete files from .dist/web'
inputs:
SourceFolder: '$(Build.SourcesDirectory)/angular'
Contents: .dist/web
RemoveSourceFolder: true
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
displayName: 'Yarn Install'
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@3
displayName: 'Yarn '
inputs:
projectDirectory: angular
- task: Npm@1
displayName: 'npm run publish'
inputs:
command: custom
workingDir: angular
verbose: false
customCommand: 'run publish'
publishRegistry: useFeed
- task: CopyFiles@2
displayName: 'Copy web.config to angular root'
inputs:
SourceFolder: '$(Build.SourcesDirectory)\angular'
Contents: web.config
TargetFolder: '$(Build.SourcesDirectory)\angular\.dist\web'
OverWrite: true
- task: ArchiveFiles@2
displayName: 'Archive $(Build.SourcesDirectory)\angular\.dist\web'
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)\angular\.dist\web'
archiveFile: '$(build.artifactstagingdirectory)\AngularUI.zip'
- task: VSTest@2
displayName: 'Test Assemblies'
inputs:
testAssemblyVer2: |
**\$(BuildConfiguration)\*test*.dll
!**\obj\**
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- task: PublishSymbols@1
displayName: 'Publish symbols path'
inputs:
SearchPattern: '**\bin\**\*.pdb'
continueOnError: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: '$(Parameters.ArtifactName)'
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
displayName: 'Clean Agent Directories'
I have also setup my release according to the documentation here https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Step-by-step-publish-to-azure-angular-staticsite#publish-files-to-azure-storage and it deploys successfully but I cannot seem to access the site? Do i need to create any extra DNS records as currently I only have the API and CDN records on the DNS but not an actual link for viewing the site/login screen? Should it just be cdn.mysite.com?
So I have 2 Resource Groups setup in azure SiteMain and SiteDev. Both have the following set of resources: siteangular / siteangulardev - Storage Account with Static Site enabled siteapi / siteapidev - .net 6 App Service sitepublic / sitepublicdev - .net 6 App Service
I want Two releases in Devops, one for the Public project and one for main project (Angular and API). I would like to use variables to switch between building/releasing the Dev Branch and the Master branch to the relevant locations.
@ismcagdas, no I have not, I have had it working in the past but since I upgraded to v11 it has stopped working. It was created by a previous developer and I am not sure it was setup right. It builds locally with no issue I would just prefer to be able to publish it with a pipeline if possible.
@sedulen, that would be great if you could offer any guidance!
Hi @ismcagdas,
This only covers copying the files, it does not cover the actual process of building the code from the repository like the MVC guide does
Many Thanks
Has there been any update on this? I want to be able to create pipelines in devops to build .Net Core & Angular sites but I can only find a guide for MVC https://docs.aspnetzero.com/en/aspnet-core-mvc/latest/Setting-Up-an-Azure-Pipeline-Mvc-Core ?
ASP Net Core + Angular v11.01
I have a fully working setup running in azure, I have setup a seperate copy on a local IIS server for OFFLINE use at an exhibition we are at. I downloaded the azure databases and put them on local SQL and I can connect to them from SQL studio. It was working fine when we were in the office with internet but now we are here at the show, it has stopped working! It is throwing errors about CORS but I do not think this is the issue as it was working ok with the internet? It seems to connect to the HOST DB as it lets me select the tenant but once i press login, it has a 500 internall error which looks as if it is trying to connect to the azure database, not the local one? I have changed the settings files but is it trying to use the tenant connection strings that are saved in the Host DB, which are the azure ones so wont work? I cant seem to login as host either?
We are at the show now so any advice would be very much apreciated!
Hi
I am trying to implement nested widgets for customizable-dashboard based on the following template
https://preview.keenthemes.com/metronic8/angular/demo1/crafted/pages/profile/overview
In the template, all the content of the tabs are nested components and the routing for the tabs redirect to those files whilst the header in the page remains constant.
Now, in the context of customizable-dashboard, I am wondering which would be the best option; Either to use tab names / ids as an input for Widget filter which will then show appropriate content or create separate pages for each tabs and route to them from the base profile component.
Thanks
That is great, thank you. Do you have an Target date yet or just by the end of the month? Will you be updating the Public site template too?