├── .github
└── workflows
│ ├── codeql-analysis.yml
│ ├── create-resources.yml
│ ├── destroy.yml
│ ├── infra.yml
│ ├── migrate-model.yml
│ └── train-model.yml
├── .gitignore
├── LICENSE
├── README.md
├── bicep
├── main.bicep
├── modules
│ ├── cognitives
│ │ └── form.bicep
│ ├── function
│ │ └── function.bicep
│ ├── insights
│ │ └── insights.bicep
│ ├── storage
│ │ ├── storage-function.bicep
│ │ └── storage.bicep
│ ├── vault
│ │ └── keyvault.bicep
│ └── web
│ │ └── blazor.bicep
├── utility.bicep
├── utility.parameters.json
└── web.bicep
├── diagram
└── architecture..drawio.svg
├── images
├── accept.png
├── actions.png
├── all.png
├── appent.png
├── appkeys.png
├── blazor.png
├── configuration.png
├── container.png
├── containers.png
├── copymodel.png
├── createazureresource.png
├── ent.png
├── env.png
├── environments.png
├── folder.png
├── fork.png
├── func.png
├── functions2.png
├── functionurl.png
├── infra.png
├── lfunc.png
├── migrate.png
├── migratemodel.png
├── model.png
├── modelcontainer.png
├── modelenv.png
├── newenvironment.png
├── newreposecret.png
├── newsetting.png
├── overview.png
├── reposecrets.png
├── resultmodel.png
├── run.png
├── secrets.png
├── set1.png
├── set2.png
├── settings.png
├── spdetails.png
├── test.png
├── test1.png
├── trained.png
├── trained_model.png
├── trainmodelaction.png
├── twokeys.png
└── url.png
├── model
├── Test
│ ├── empty.pdf
│ └── test1.pdf
├── ceo.pdf
├── ceo.pdf.labels.json
├── ceo.pdf.ocr.json
├── cloudarchitect.pdf
├── cloudarchitect.pdf.labels.json
├── cloudarchitect.pdf.ocr.json
├── csharpprogrammer.pdf
├── csharpprogrammer.pdf.labels.json
├── csharpprogrammer.pdf.ocr.json
├── fields.json
├── fullstack.pdf
├── fullstack.pdf.labels.json
├── fullstack.pdf.ocr.json
├── securityguard.pdf
├── securityguard.pdf.labels.json
└── securityguard.pdf.ocr.json
├── scripts
├── copyModel.ps1
├── deleteForm.ps1
├── trainModel.ps1
└── validateModel.ps1
└── src
├── .editorconfig
├── FormBlazorClient
├── App.razor
├── Components
│ ├── DocumentLayout.razor
│ ├── Environments.razor
│ ├── FileUpload.razor
│ └── Loading.razor
├── FormBlazorClient.csproj
├── Model
│ └── SelectEnvironment.cs
├── Pages
│ ├── Analyze.razor
│ ├── Error.cshtml
│ ├── Error.cshtml.cs
│ ├── Index.razor
│ ├── _Host.cshtml
│ └── _Layout.cshtml
├── Program.cs
├── Properties
│ └── launchSettings.json
├── Service
│ ├── FileServiceStorage.cs
│ ├── IFileServiceStorage.cs
│ ├── IModelService.cs
│ ├── IStateService.cs
│ ├── ModelService.cs
│ └── StateService.cs
├── Shared
│ ├── MainLayout.razor
│ ├── MainLayout.razor.css
│ ├── NavMenu.razor
│ ├── NavMenu.razor.css
│ └── SurveyPrompt.razor
├── _Imports.razor
├── appsettings.Development.json
├── appsettings.json
├── global.cs
├── libman.json
└── wwwroot
│ ├── css
│ ├── bootstrap
│ │ ├── bootstrap.min.css
│ │ └── bootstrap.min.css.map
│ ├── font-awesome
│ │ ├── css
│ │ │ ├── font-awesome.css
│ │ │ ├── font-awesome.css.map
│ │ │ └── font-awesome.min.css
│ │ └── fonts
│ │ │ ├── FontAwesome.otf
│ │ │ ├── fontawesome-webfont.eot
│ │ │ ├── fontawesome-webfont.svg
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ ├── fontawesome-webfont.woff
│ │ │ └── fontawesome-webfont.woff2
│ ├── open-iconic
│ │ ├── FONT-LICENSE
│ │ ├── ICON-LICENSE
│ │ ├── README.md
│ │ └── font
│ │ │ ├── css
│ │ │ └── open-iconic-bootstrap.min.css
│ │ │ └── fonts
│ │ │ ├── open-iconic.eot
│ │ │ ├── open-iconic.otf
│ │ │ ├── open-iconic.svg
│ │ │ ├── open-iconic.ttf
│ │ │ └── open-iconic.woff
│ └── site.css
│ ├── favicon.ico
│ └── image
│ └── ms.png
├── Shared
├── CopyModelParameter.cs
├── DeleteModelParameter.cs
├── Demo.Shared.csproj
├── DocumentInfo.cs
├── DocumentResult.cs
├── Enum.cs
├── Model.cs
└── ModelInfo.cs
├── demo.sln
└── function
├── .editorconfig
├── .gitignore
├── .vscode
├── extensions.json
├── launch.json
├── settings.json
└── tasks.json
├── AnalyzeDocument.cs
├── CopyModel.cs
├── DeleteModel.cs
├── Extension
└── Extension.cs
├── Factory
├── FormClientFactory.cs
└── IFormClientFactory.cs
├── GetModel.cs
├── Startup.cs
├── TrainModel.cs
├── ValidateModelExists.cs
├── Validator
├── CopyModelParameterValidator.cs
├── DeleteModelParameterValidator.cs
└── DocumentInfoParameterValidator.cs
├── function.csproj
├── global.cs
└── host.json
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | #
7 | # ******** NOTE ********
8 | # We have attempted to detect the languages in your repository. Please check
9 | # the `language` matrix defined below to confirm you have the correct set of
10 | # supported CodeQL languages.
11 | #
12 | name: "CodeQL"
13 |
14 | on:
15 | push:
16 | branches: [ main ]
17 | pull_request:
18 | # The branches below must be a subset of the branches above
19 | branches: [ main ]
20 | schedule:
21 | - cron: '27 7 * * 5'
22 | workflow_dispatch:
23 |
24 | jobs:
25 | analyze:
26 | name: Analyze
27 | runs-on: ubuntu-latest
28 | permissions:
29 | actions: read
30 | contents: read
31 | security-events: write
32 |
33 | strategy:
34 | fail-fast: false
35 | matrix:
36 | language: [ 'csharp' ]
37 |
38 | steps:
39 | - name: Checkout repository
40 | uses: actions/checkout@v2
41 |
42 | # Initializes the CodeQL tools for scanning.
43 | - name: Initialize CodeQL
44 | uses: github/codeql-action/init@v1
45 | with:
46 | languages: ${{ matrix.language }}
47 | # If you wish to specify custom queries, you can do so here or in a config file.
48 | # By default, queries listed here will override any specified in a config file.
49 | # Prefix the list here with "+" to use these queries and those in the config file.
50 | # queries: ./path/to/local/query, your-org/your-repo/queries@main
51 |
52 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
53 | # If this step fails, then you should remove it and run the build manually (see below)
54 | - name: Autobuild
55 | uses: github/codeql-action/autobuild@v1
56 |
57 | # ℹ️ Command-line programs to run using the OS shell.
58 | # 📚 https://git.io/JvXDl
59 |
60 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
61 | # and modify them (or add more) to build your code if your project
62 | # uses a compiled language
63 |
64 | #- run: |
65 | # make bootstrap
66 | # make release
67 |
68 | - name: Perform CodeQL Analysis
69 | uses: github/codeql-action/analyze@v1
70 |
--------------------------------------------------------------------------------
/.github/workflows/create-resources.yml:
--------------------------------------------------------------------------------
1 |
2 | #
3 | # Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
4 | #
5 | # This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
6 | # THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
7 | # INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
8 | #
9 | # We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
10 | # provided that You agree:
11 | #
12 | # (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
13 | # (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
14 | # (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
15 | # including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
16 | #
17 | # Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
18 | #
19 | # DEMO POC - "AS IS"
20 |
21 | on:
22 | workflow_call:
23 | inputs:
24 | resourceGroupName:
25 | required: true
26 | type: string
27 | location:
28 | required: true
29 | type: string
30 | environmentName:
31 | required: true
32 | type: string
33 | secrets:
34 | azure_credentials:
35 | required: true
36 | subscriptionId:
37 | required: true
38 | outputs:
39 | formRecognizerName:
40 | description: 'The name of the form recognizer'
41 | value: ${{ jobs.create-azure-resources.outputs.formRecognizerName }}
42 | storageName:
43 | description: 'The name of the storage'
44 | value: ${{ jobs.create-azure-resources.outputs.storageName }}
45 |
46 | jobs:
47 | create-azure-resources:
48 |
49 | runs-on: ubuntu-latest
50 |
51 | outputs:
52 | formRecognizerName: ${{ steps.armDeployment.outputs.formRecognizerName }}
53 | storageName: ${{ steps.armDeployment.outputs.storageName }}
54 |
55 | steps:
56 |
57 | - uses: actions/checkout@v2
58 |
59 | - name: Azure Login
60 | uses: Azure/login@v1
61 | with:
62 | creds: ${{ secrets.azure_credentials }}
63 |
64 | - name: Create Resource Group
65 | run: |
66 | az group create -n ${{ inputs.resourceGroupName }} -l ${{ inputs.location }}
67 |
68 | # Temporary step the bicep linter return an error today for the
69 | # method PATCH for CORS on storage
70 | - name: Convert to ARM template
71 | run: |
72 | bicep build ./bicep/main.bicep
73 |
74 |
75 | - name: Deploy Azure Resources
76 | id: armDeployment
77 | uses: azure/arm-deploy@v1
78 | with:
79 | subscriptionId: ${{ secrets.subscriptionId }}
80 | resourceGroupName: ${{ inputs.resourceGroupName }}
81 | template: ./bicep/main.json
82 | parameters: environmentName=${{ inputs.environmentName }}
83 |
84 | - name: logout
85 | run: |
86 | az logout
--------------------------------------------------------------------------------
/.github/workflows/destroy.yml:
--------------------------------------------------------------------------------
1 |
2 | #
3 | # Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
4 | #
5 | # This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
6 | # THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
7 | # INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
8 | #
9 | # We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
10 | # provided that You agree:
11 | #
12 | # (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
13 | # (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
14 | # (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
15 | # including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
16 | #
17 | # Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
18 | #
19 | # DEMO POC - "AS IS"
20 |
21 | name: Destroy Resources
22 |
23 | on:
24 | workflow_dispatch:
25 |
26 | env:
27 | RG-DEV: 'rg-form-recognizer-devops-dev'
28 | RG-QA: 'rg-form-recognizer-devops-qa'
29 | RG-PROD: 'rg-form-recognizer-devops-prod'
30 | FORM_TAG: 'frm-devops-demo-tag-${{ secrets.SUBSCRIPTION_ID}}'
31 |
32 | jobs:
33 |
34 | destroy-resource-group:
35 |
36 | runs-on: ubuntu-latest
37 |
38 | steps:
39 | - uses: actions/checkout@v2
40 |
41 | - name: Azure Login
42 | uses: Azure/login@v1.1
43 | with:
44 | creds: ${{ secrets.AZURE_CREDENTIALS }}
45 | enable-AzPSSession: false
46 |
47 | - name: Destroy resource group
48 | run: |
49 | if [ $(az group exists --name ${{ env.RG-DEV }}) = true ]; then
50 | az group delete -n ${{ env.RG-DEV }} --yes
51 | fi
52 | if [ $(az group exists --name ${{ env.RG-QA }}) = true ]; then
53 | az group delete -n ${{ env.RG-QA }} --yes
54 | fi
55 | if [ $(az group exists --name ${{ env.RG-PROD }}) = true ]; then
56 | az group delete -n ${{ env.RG-PROD }} --yes
57 | fi
58 |
59 | - name: Remove soft delete form Recognizer
60 | shell: pwsh
61 | run: |
62 | ./scripts/deleteForm.ps1 -subscriptionId ${{ secrets.SUBSCRIPTION_ID }}
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/.github/workflows/migrate-model.yml:
--------------------------------------------------------------------------------
1 | name: Migrate Model
2 |
3 | on:
4 | workflow_dispatch:
5 | inputs:
6 | modelId:
7 | required: true
8 | description: 'The modelId to copy from DEV to other environment'
9 | type: string
10 |
11 | jobs:
12 | validateDEV:
13 | name: Validate Model Exists
14 | environment:
15 | name: DEV
16 | runs-on: ubuntu-latest
17 |
18 | steps:
19 | - uses: actions/checkout@v2
20 |
21 | - name: Run Azure PowerShell script validate
22 | run: |
23 | $secureString = ConvertTo-SecureString ${{ secrets.FUNCTION_VALIDATE_ENDPOINT }} -asplaintext -force
24 | ./scripts/validateModel.ps1 -modelId ${{ github.event.inputs.modelId }} -endpoint $secureString
25 | shell: pwsh
26 |
27 | deploymentQA:
28 | name: Deployment in QA
29 | environment:
30 | name: QA
31 | needs: validateDEV
32 | runs-on: ubuntu-latest
33 |
34 | steps:
35 | - uses: actions/checkout@v2
36 |
37 | - name: Run Azure PowerShell script validate
38 | shell: pwsh
39 | run: |
40 | $secureString = ConvertTo-SecureString ${{ secrets.FUNCTION_COPY_MODEL_ENDPOINT}} -asplaintext -force
41 | ./scripts/copyModel.ps1 -modelId ${{ github.event.inputs.modelId }} -sourceEnvironment 0 -destinationEnvironment 1 -functionEndpoint $secureString
42 |
43 | deploymentPROD:
44 | name: Deployment in PROD
45 | environment:
46 | name: PROD
47 | needs: deploymentQA
48 | runs-on: ubuntu-latest
49 |
50 | steps:
51 | - uses: actions/checkout@v2
52 |
53 | - name: Run Azure PowerShell script validate
54 | shell: pwsh
55 | run: |
56 | $secureString = ConvertTo-SecureString ${{ secrets.FUNCTION_COPY_MODEL_ENDPOINT}} -asplaintext -force
57 | ./scripts/copyModel.ps1 -modelId ${{ github.event.inputs.modelId }} -sourceEnvironment 1 -destinationEnvironment 2 -functionEndpoint $secureString
58 |
59 |
--------------------------------------------------------------------------------
/.github/workflows/train-model.yml:
--------------------------------------------------------------------------------
1 | name: Train Model
2 |
3 | on:
4 | workflow_dispatch:
5 |
6 | jobs:
7 | train:
8 | name: Train the new model
9 | environment:
10 | name: DEV
11 | runs-on: ubuntu-latest
12 |
13 | steps:
14 | - uses: actions/checkout@v2
15 |
16 | - name: Run Azure PowerShell script validate
17 | run: |
18 | $secureString = ConvertTo-SecureString ${{ secrets.FUNCTION_TRAIN_MODEL_ENDPOINT }} -asplaintext -force
19 | ./scripts/trainModel.ps1 -functionEndpoint $secureString
20 | shell: pwsh
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Hugo Girard
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/bicep/main.bicep:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 |
21 | param environmentName string
22 |
23 | var location = resourceGroup().location
24 | var suffix = uniqueString(resourceGroup().id)
25 | var strName = '${toLower(environmentName)}${suffix}'
26 |
27 | module cognitives 'modules/cognitives/form.bicep' = {
28 | name: 'cognitives-${environmentName}'
29 | params: {
30 | location: location
31 | suffix: suffix
32 | environment: environmentName
33 | }
34 | }
35 |
36 | module storage 'modules/storage/storage.bicep' = if (toLower(environmentName) == 'dev') {
37 | name: 'storage-${environmentName}'
38 | params: {
39 | name: strName
40 | location: location
41 | environment: environmentName
42 | }
43 | }
44 |
45 | output storageName string = strName
46 | output formRecognizerName string = cognitives.outputs.formRecognizerName
47 |
--------------------------------------------------------------------------------
/bicep/modules/cognitives/form.bicep:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
4 | *
5 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
6 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
7 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
8 | *
9 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
10 | * provided that You agree:
11 | *
12 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
13 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
14 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
15 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
16 | *
17 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
18 | *
19 | * DEMO POC - "AS IS"
20 | */
21 |
22 | param location string
23 | param suffix string
24 | param environment string
25 |
26 | var frmName = 'frm-${toLower(environment)}-${suffix}'
27 |
28 | resource frmRecognizer 'Microsoft.CognitiveServices/accounts@2021-04-30' = {
29 | name: frmName
30 | location: location
31 | sku: {
32 | name: 'S0'
33 | }
34 | tags: {
35 | 'environment': environment
36 | 'description': 'frm-devops-demo-tag-${subscription().subscriptionId}'
37 | }
38 | kind: 'FormRecognizer'
39 | properties: {
40 | customSubDomainName: frmName
41 | publicNetworkAccess: 'Enabled'
42 | networkAcls: {
43 | defaultAction: 'Allow'
44 | virtualNetworkRules: [
45 |
46 | ]
47 | }
48 | }
49 | }
50 |
51 | output formRecognizerName string = frmRecognizer.name
52 |
--------------------------------------------------------------------------------
/bicep/modules/insights/insights.bicep:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 |
21 | param location string
22 | param suffix string
23 |
24 | var appInsightsName = 'appi-${suffix}'
25 |
26 | resource workspace 'Microsoft.OperationalInsights/workspaces@2021-06-01' = {
27 | name: 'log-${suffix}'
28 | location: location
29 | properties: {
30 | sku: {
31 | name: 'PerGB2018'
32 | }
33 | }
34 | }
35 |
36 | resource appInsights 'Microsoft.Insights/components@2020-02-02-preview' = {
37 | name: appInsightsName
38 | location: location
39 | kind: 'web'
40 | properties: {
41 | Application_Type: 'web'
42 | WorkspaceResourceId: workspace.id
43 | publicNetworkAccessForIngestion: 'Enabled'
44 | publicNetworkAccessForQuery: 'Enabled'
45 | }
46 | }
47 |
48 | output appInsightKey string = appInsights.properties.InstrumentationKey
49 | output appInsightCnxString string = appInsights.properties.ConnectionString
50 | output appInsightName string = appInsights.name
51 |
--------------------------------------------------------------------------------
/bicep/modules/storage/storage-function.bicep:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
4 | *
5 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
6 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
7 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
8 | *
9 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
10 | * provided that You agree:
11 | *
12 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
13 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
14 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
15 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
16 | *
17 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
18 | *
19 | * DEMO POC - "AS IS"
20 | */
21 |
22 | param suffix string
23 | param location string
24 |
25 | // var strAcccountNameFunc = 'strf${suffix}'
26 | var strFunction = 'strf${suffix}'
27 |
28 | resource storageAccountDocument 'Microsoft.Storage/storageAccounts@2021-04-01' = {
29 | name: strFunction
30 | location: location
31 | sku: {
32 | name: 'Standard_LRS'
33 | }
34 | kind: 'StorageV2'
35 | properties: {
36 | supportsHttpsTrafficOnly: true
37 | encryption: {
38 | services: {
39 | file: {
40 | keyType: 'Account'
41 | enabled: true
42 | }
43 | blob: {
44 | keyType: 'Account'
45 | enabled: true
46 | }
47 | }
48 | keySource: 'Microsoft.Storage'
49 | }
50 | accessTier: 'Hot'
51 | }
52 | }
53 |
54 | resource blobService 'Microsoft.Storage/storageAccounts/blobServices@2021-04-01' = {
55 | parent: storageAccountDocument
56 | name: 'default'
57 | properties: {
58 | cors: {
59 | corsRules: [
60 | {
61 | allowedOrigins: [
62 | '*'
63 | ]
64 | allowedMethods: [
65 | 'DELETE'
66 | 'GET'
67 | 'HEAD'
68 | 'MERGE'
69 | 'POST'
70 | 'OPTIONS'
71 | 'PUT'
72 | 'PATCH'
73 | ]
74 | exposedHeaders: [
75 | '*'
76 | ]
77 | allowedHeaders: [
78 | '*'
79 | ]
80 | maxAgeInSeconds: 200
81 | }
82 | ]
83 | }
84 | }
85 | }
86 |
87 | resource containerDocuments 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-04-01' = {
88 | parent: blobService
89 | name: 'upload'
90 | properties: {
91 | publicAccess: 'None'
92 | }
93 | }
94 |
95 | output strAccountName string = storageAccountDocument.name
96 | output strAccountId string = storageAccountDocument.id
97 | output strAccountApiVersion string = storageAccountDocument.apiVersion
98 |
--------------------------------------------------------------------------------
/bicep/modules/storage/storage.bicep:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
4 | *
5 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
6 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
7 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
8 | *
9 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
10 | * provided that You agree:
11 | *
12 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
13 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
14 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
15 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
16 | *
17 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
18 | *
19 | * DEMO POC - "AS IS"
20 | */
21 |
22 |
23 | param location string
24 | param environment string
25 | param name string
26 |
27 | resource storageAccountDocument 'Microsoft.Storage/storageAccounts@2021-04-01' = {
28 | name: name
29 | location: location
30 | sku: {
31 | name: 'Standard_LRS'
32 | }
33 | tags: {
34 | 'environment': environment
35 | }
36 | kind: 'StorageV2'
37 | properties: {
38 | supportsHttpsTrafficOnly: true
39 | encryption: {
40 | services: {
41 | file: {
42 | keyType: 'Account'
43 | enabled: true
44 | }
45 | blob: {
46 | keyType: 'Account'
47 | enabled: true
48 | }
49 | }
50 | keySource: 'Microsoft.Storage'
51 | }
52 | accessTier: 'Hot'
53 | }
54 | }
55 |
56 | resource containerDocuments 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-04-01' = {
57 | name: '${storageAccountDocument.name}/default/model'
58 | properties: {
59 | publicAccess: 'None'
60 | }
61 | }
62 |
63 | resource blobService 'Microsoft.Storage/storageAccounts/blobServices@2021-04-01' = {
64 | name: '${storageAccountDocument.name}/default'
65 | properties: {
66 | cors: {
67 | corsRules: [
68 | {
69 | allowedOrigins: [
70 | '*'
71 | ]
72 | allowedMethods: [
73 | 'DELETE'
74 | 'GET'
75 | 'HEAD'
76 | 'MERGE'
77 | 'POST'
78 | 'OPTIONS'
79 | 'PUT'
80 | 'PATCH'
81 | ]
82 | exposedHeaders: [
83 | '*'
84 | ]
85 | allowedHeaders: [
86 | '*'
87 | ]
88 | maxAgeInSeconds: 200
89 | }
90 | ]
91 | }
92 | }
93 | }
94 |
95 | output strDocumentName string = storageAccountDocument.name
96 | output strDocumentId string = storageAccountDocument.id
97 | output strDocumentApiVersion string = storageAccountDocument.apiVersion
98 |
--------------------------------------------------------------------------------
/bicep/modules/vault/keyvault.bicep:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 |
21 | param location string
22 | param suffix string
23 | param environmentName string
24 | param spIdentity string
25 |
26 | param frmRecognizerEndpoint string
27 |
28 | param frmRecognizerId string
29 | param frmRecognizerVersion string
30 |
31 | //param frmKey string
32 |
33 | param strDocumentName string
34 | param strDocumentId string
35 | param strDocumentApiVersion string
36 |
37 | var strCnxString = 'DefaultEndpointsProtocol=https;AccountName=${strDocumentName};EndpointSuffix=${environment().suffixes.storage};AccountKey=${listKeys(strDocumentId, strDocumentApiVersion).keys[0].value}'
38 | var frmKey = listKeys(frmRecognizerId,frmRecognizerVersion).key1
39 |
40 | resource keyvault 'Microsoft.KeyVault/vaults@2021-06-01-preview' = {
41 | name: 'vault-${environmentName}-${suffix}'
42 | location: location
43 | properties: {
44 | accessPolicies: [
45 | {
46 | tenantId: subscription().tenantId
47 | objectId: spIdentity
48 | permissions: {
49 | secrets: [
50 | 'get'
51 | 'list'
52 | ]
53 | }
54 | }
55 | ]
56 | sku: {
57 | family: 'A'
58 | name: 'standard'
59 | }
60 | tenantId: subscription().tenantId
61 | enableSoftDelete: false
62 | }
63 | }
64 |
65 | resource secretEndpoint 'Microsoft.KeyVault/vaults/secrets@2019-09-01' = {
66 | name: 'frmEndpoint'
67 | parent: keyvault
68 | properties: {
69 | value: frmRecognizerEndpoint
70 | }
71 | }
72 |
73 | resource secretKey 'Microsoft.KeyVault/vaults/secrets@2019-09-01' = {
74 | name: 'frmKey'
75 | parent: keyvault
76 | properties: {
77 | value: frmKey
78 | }
79 | }
80 |
81 | resource secretStorageCnxString 'Microsoft.KeyVault/vaults/secrets@2019-09-01' = {
82 | name: 'storageCnxString'
83 | parent: keyvault
84 | properties: {
85 | value: strCnxString
86 | }
87 | }
88 |
89 | output keyvaultName string = keyvault.name
90 |
--------------------------------------------------------------------------------
/bicep/modules/web/blazor.bicep:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 | param location string
21 | param suffix string
22 | param storageName string
23 | param appInsightName string
24 | param functionHostname string
25 |
26 | var appPlanName = 'plan-blazor-${suffix}'
27 | var webAppName = 'blazor-admin-${suffix}'
28 |
29 | resource appServicePlan 'Microsoft.Web/serverfarms@2021-01-15' = {
30 | name: appPlanName
31 | location: location
32 | sku: {
33 | name: 'B1'
34 | tier: 'Basic'
35 | }
36 | }
37 |
38 | resource appInsights 'Microsoft.Insights/components@2020-02-02' existing = {
39 | name: appInsightName
40 | scope: resourceGroup(resourceGroup().name)
41 | }
42 |
43 | resource str 'Microsoft.Storage/storageAccounts@2021-04-01' existing = {
44 | name: storageName
45 | scope: resourceGroup(resourceGroup().name)
46 | }
47 |
48 | resource appService 'Microsoft.Web/sites@2021-02-01' = {
49 | name: webAppName
50 | location: location
51 | properties: {
52 | serverFarmId: appServicePlan.id
53 | clientAffinityEnabled: false
54 | siteConfig: {
55 | appSettings: [
56 | {
57 | name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
58 | value: appInsights.properties.InstrumentationKey
59 | }
60 | {
61 | name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
62 | value: appInsights.properties.ConnectionString
63 | }
64 | {
65 | name: 'ApplicationInsightsAgent_EXTENSION_VERSION'
66 | value: '~2'
67 | }
68 | {
69 | name: 'UploadStorage'
70 | value: 'DefaultEndpointsProtocol=https;AccountName=${str.name};EndpointSuffix=${environment().suffixes.storage};AccountKey=${listKeys(str.id, str.apiVersion).keys[0].value}'
71 | }
72 | {
73 | name: 'Container'
74 | value: 'upload'
75 | }
76 | {
77 | name: 'FunctionBaseUrl'
78 | value: functionHostname
79 | }
80 | ]
81 | metadata: [
82 | {
83 | name: 'CURRENT_STACK'
84 | value: 'dotnetcore'
85 | }
86 | ]
87 | alwaysOn: true
88 | }
89 | }
90 | }
91 |
92 | output webName string = appService.name
93 |
--------------------------------------------------------------------------------
/bicep/utility.bicep:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
4 | *
5 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
6 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
7 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
8 | *
9 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
10 | * provided that You agree:
11 | *
12 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
13 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
14 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
15 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
16 | *
17 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
18 | *
19 | * DEMO POC - "AS IS"
20 | */
21 | param devStorageName string
22 | param devFormRecognizerName string
23 | param qaFormRecognizerName string
24 | param prodFormRecognizerName string
25 |
26 | param devResourceGroupName string
27 | param qaResourceGroupName string
28 | param prodResourceGroupName string
29 | param location string = resourceGroup().location
30 |
31 | var suffix = uniqueString(resourceGroup().id)
32 |
33 | module insight 'modules/insights/insights.bicep' = {
34 | name: 'insight'
35 | params: {
36 | location: location
37 | suffix: suffix
38 | }
39 | }
40 |
41 | module storage 'modules/storage/storage-function.bicep' = {
42 | name: 'storage'
43 | params: {
44 | location: location
45 | suffix: suffix
46 | }
47 | }
48 |
49 | module function 'modules/function/function.bicep' = {
50 | name: 'function'
51 | params: {
52 | appInsightCnxString: insight.outputs.appInsightCnxString
53 | appInsightKey: insight.outputs.appInsightKey
54 | location: location
55 | devStorageName: devStorageName
56 | devFormRecognizerName: devFormRecognizerName
57 | qaFormRecognizerName: qaFormRecognizerName
58 | prodFormRecognizerName: prodFormRecognizerName
59 | devResourceGroupName: devResourceGroupName
60 | qaResourceGroupName: qaResourceGroupName
61 | prodResourceGroupName: prodResourceGroupName
62 | strAccountName: storage.outputs.strAccountName
63 | suffix: suffix
64 | }
65 | }
66 |
67 | output functionName string = function.outputs.functionName
68 | output functionHostname string = function.outputs.functionHostname
69 | output storageName string = storage.outputs.strAccountName
70 | output appInsightName string = insight.outputs.appInsightName
71 |
--------------------------------------------------------------------------------
/bicep/utility.parameters.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "devStorageName": {
6 | "value": "__devStorageName__"
7 | },
8 | "devFormRecognizerName": {
9 | "value": "__devFormRecognizerName__"
10 | },
11 | "qaFormRecognizerName": {
12 | "value": "__qaFormRecognizerName__"
13 | },
14 | "prodFormRecognizerName": {
15 | "value": "__prodFormRecognizerName__"
16 | },
17 | "devResourceGroupName": {
18 | "value": "__devResourceGroupName__"
19 | },
20 | "qaResourceGroupName": {
21 | "value": "__qaResourceGroupName__"
22 | },
23 | "prodResourceGroupName": {
24 | "value": "__prodResourceGroupName__"
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/bicep/web.bicep:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 | param location string
21 | param strName string
22 | param appInsightName string
23 | param functionHostname string
24 |
25 | var suffix = uniqueString(resourceGroup().id)
26 |
27 | module blazor 'modules/web/blazor.bicep' = {
28 | name: 'blazor'
29 | params: {
30 | appInsightName: appInsightName
31 | location: location
32 | storageName: strName
33 | suffix: suffix
34 | functionHostname: functionHostname
35 | }
36 | }
37 |
38 | output webAppName string = blazor.outputs.webName
39 |
--------------------------------------------------------------------------------
/images/accept.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/accept.png
--------------------------------------------------------------------------------
/images/actions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/actions.png
--------------------------------------------------------------------------------
/images/all.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/all.png
--------------------------------------------------------------------------------
/images/appent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/appent.png
--------------------------------------------------------------------------------
/images/appkeys.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/appkeys.png
--------------------------------------------------------------------------------
/images/blazor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/blazor.png
--------------------------------------------------------------------------------
/images/configuration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/configuration.png
--------------------------------------------------------------------------------
/images/container.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/container.png
--------------------------------------------------------------------------------
/images/containers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/containers.png
--------------------------------------------------------------------------------
/images/copymodel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/copymodel.png
--------------------------------------------------------------------------------
/images/createazureresource.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/createazureresource.png
--------------------------------------------------------------------------------
/images/ent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/ent.png
--------------------------------------------------------------------------------
/images/env.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/env.png
--------------------------------------------------------------------------------
/images/environments.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/environments.png
--------------------------------------------------------------------------------
/images/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/folder.png
--------------------------------------------------------------------------------
/images/fork.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/fork.png
--------------------------------------------------------------------------------
/images/func.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/func.png
--------------------------------------------------------------------------------
/images/functions2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/functions2.png
--------------------------------------------------------------------------------
/images/functionurl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/functionurl.png
--------------------------------------------------------------------------------
/images/infra.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/infra.png
--------------------------------------------------------------------------------
/images/lfunc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/lfunc.png
--------------------------------------------------------------------------------
/images/migrate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/migrate.png
--------------------------------------------------------------------------------
/images/migratemodel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/migratemodel.png
--------------------------------------------------------------------------------
/images/model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/model.png
--------------------------------------------------------------------------------
/images/modelcontainer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/modelcontainer.png
--------------------------------------------------------------------------------
/images/modelenv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/modelenv.png
--------------------------------------------------------------------------------
/images/newenvironment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/newenvironment.png
--------------------------------------------------------------------------------
/images/newreposecret.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/newreposecret.png
--------------------------------------------------------------------------------
/images/newsetting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/newsetting.png
--------------------------------------------------------------------------------
/images/overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/overview.png
--------------------------------------------------------------------------------
/images/reposecrets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/reposecrets.png
--------------------------------------------------------------------------------
/images/resultmodel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/resultmodel.png
--------------------------------------------------------------------------------
/images/run.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/run.png
--------------------------------------------------------------------------------
/images/secrets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/secrets.png
--------------------------------------------------------------------------------
/images/set1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/set1.png
--------------------------------------------------------------------------------
/images/set2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/set2.png
--------------------------------------------------------------------------------
/images/settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/settings.png
--------------------------------------------------------------------------------
/images/spdetails.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/spdetails.png
--------------------------------------------------------------------------------
/images/test.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/test.png
--------------------------------------------------------------------------------
/images/test1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/test1.png
--------------------------------------------------------------------------------
/images/trained.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/trained.png
--------------------------------------------------------------------------------
/images/trained_model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/trained_model.png
--------------------------------------------------------------------------------
/images/trainmodelaction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/trainmodelaction.png
--------------------------------------------------------------------------------
/images/twokeys.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/twokeys.png
--------------------------------------------------------------------------------
/images/url.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/images/url.png
--------------------------------------------------------------------------------
/model/Test/empty.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/model/Test/empty.pdf
--------------------------------------------------------------------------------
/model/Test/test1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/model/Test/test1.pdf
--------------------------------------------------------------------------------
/model/ceo.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/model/ceo.pdf
--------------------------------------------------------------------------------
/model/cloudarchitect.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/model/cloudarchitect.pdf
--------------------------------------------------------------------------------
/model/csharpprogrammer.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/model/csharpprogrammer.pdf
--------------------------------------------------------------------------------
/model/fields.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.cognitiveservices.azure.com/formrecognizer/2021-03-01/fields.json",
3 | "fields": [
4 | {
5 | "fieldKey": "Job Application Type",
6 | "fieldType": "string",
7 | "fieldFormat": "not-specified"
8 | },
9 | {
10 | "fieldKey": "Name of Candidate",
11 | "fieldType": "string",
12 | "fieldFormat": "not-specified"
13 | },
14 | {
15 | "fieldKey": "Job Application Id",
16 | "fieldType": "string",
17 | "fieldFormat": "not-specified"
18 | },
19 | {
20 | "fieldKey": "Date of Submission",
21 | "fieldType": "string",
22 | "fieldFormat": "not-specified"
23 | },
24 | {
25 | "fieldKey": "Position Applied For",
26 | "fieldType": "string",
27 | "fieldFormat": "not-specified"
28 | },
29 | {
30 | "fieldKey": "Contact-Number",
31 | "fieldType": "string",
32 | "fieldFormat": "not-specified"
33 | },
34 | {
35 | "fieldKey": "Objective and Goals",
36 | "fieldType": "string",
37 | "fieldFormat": "not-specified"
38 | },
39 | {
40 | "fieldKey": "Other Information",
41 | "fieldType": "string",
42 | "fieldFormat": "not-specified"
43 | }
44 | ],
45 | "definitions": {}
46 | }
--------------------------------------------------------------------------------
/model/fullstack.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/model/fullstack.pdf
--------------------------------------------------------------------------------
/model/securityguard.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/model/securityguard.pdf
--------------------------------------------------------------------------------
/scripts/copyModel.ps1:
--------------------------------------------------------------------------------
1 | #
2 | # Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | #
4 | # This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | # THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | # INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | #
8 | # We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | # provided that You agree:
10 | #
11 | # (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | # (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | # (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | # including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | #
16 | # Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | #
18 | # DEMO POC - "AS IS"
19 | #
20 |
21 | param(
22 | [Parameter(Mandatory = $true)]
23 | [string]$modelId,
24 | [Parameter(Mandatory = $true)]
25 | [int]$sourceEnvironment,
26 | [Parameter(Mandatory = $true)]
27 | [int]$destinationEnvironment,
28 | [Parameter(Mandatory = $true)]
29 | [Security.SecureString]$functionEndpoint
30 | )
31 |
32 | try {
33 |
34 | $decryptedEndpoint = ConvertFrom-SecureString $functionEndpoint -AsPlainText
35 | $header = @{
36 | "Content-Type"="application/json"
37 | }
38 |
39 | $body= @{
40 | "sourceModelId"="$modelId"
41 | "sourceEnvironment"="$sourceEnvironment"
42 | "destinationEnvironment"="$destinationEnvironment"
43 | } | ConvertTo-Json
44 |
45 | $response = Invoke-WebRequest -Uri $decryptedEndpoint -Method 'Post' -Headers $header -Body $body
46 |
47 | if ($response.StatusCode -ne 200) {
48 | throw "Error, statusCode: $response.StatusCode"
49 | }
50 | }
51 | catch {
52 | throw "Something happen"
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/scripts/deleteForm.ps1:
--------------------------------------------------------------------------------
1 | #
2 | # Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | #
4 | # This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | # THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | # INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | #
8 | # We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | # provided that You agree:
10 | #
11 | # (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | # (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | # (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | # including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | #
16 | # Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | #
18 | # DEMO POC - "AS IS"
19 | #
20 |
21 | param(
22 | [Parameter(Mandatory = $true)]
23 | [string]$subscriptionId
24 | )
25 |
26 | $results=az rest --method get --header 'Accept=application/json' -u "https://management.azure.com/subscriptions/$subscriptionId/providers/Microsoft.CognitiveServices/deletedAccounts?api-version=2021-04-30"
27 | $resources = $results | ConvertFrom-Json
28 |
29 | $tag="frm-devops-demo-tag-$subscriptionId"
30 |
31 | ForEach($resource in $resources.value) {
32 | if ($resource.tags.description -eq $tag) {
33 | az resource delete --ids $resource.id
34 | }
35 | }
--------------------------------------------------------------------------------
/scripts/trainModel.ps1:
--------------------------------------------------------------------------------
1 | #
2 | # Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | #
4 | # This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | # THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | # INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | #
8 | # We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | # provided that You agree:
10 | #
11 | # (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | # (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | # (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | # including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | #
16 | # Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | #
18 | # DEMO POC - "AS IS"
19 | #
20 |
21 | param(
22 | [Parameter(Mandatory = $true)]
23 | [Security.SecureString]$functionEndpoint
24 | )
25 |
26 | try {
27 | $header = @{
28 | "Content-Type"="application/json"
29 | }
30 |
31 | $decryptedEndpoint = ConvertFrom-SecureString $functionEndpoint -AsPlainText
32 | $modelId = New-Guid
33 | $description = "Job Model for $modelId"
34 |
35 | $body= @{
36 | "modelId"="$modelId"
37 | "description"="$description"
38 | } | ConvertTo-Json
39 |
40 | $response = Invoke-WebRequest -Uri $decryptedEndpoint -Method 'Post' -Headers $header -Body $body
41 |
42 | if ($response.StatusCode -ne 200) {
43 | throw "Error, statusCode: $response.StatusCode"
44 | }
45 |
46 | return $modelId
47 | }
48 | catch {
49 | throw "Something bad happen"
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/scripts/validateModel.ps1:
--------------------------------------------------------------------------------
1 | #
2 | # Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | #
4 | # This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | # THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | # INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | #
8 | # We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | # provided that You agree:
10 | #
11 | # (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | # (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | # (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | # including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | #
16 | # Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | #
18 | # DEMO POC - "AS IS"
19 | #
20 | param(
21 | [Parameter(Mandatory = $true)]
22 | [string]$modelId,
23 | [Parameter(Mandatory = $true)]
24 | [Security.SecureString]$endpoint
25 | )
26 |
27 | try {
28 |
29 | $decryptedEndpoint = ConvertFrom-SecureString $endpoint -AsPlainText
30 | $values = $decryptedEndpoint.Split("?")
31 | $decryptedEndpoint = $values[0]
32 | $code = $values[1].Replace("code=","")
33 |
34 | $header = @{
35 | "Content-Type"="application/json"
36 | "x-functions-key"="$code"
37 | }
38 |
39 | $url = $decryptedEndpoint + "?modelId=$modelId&environment=0"
40 | $response = Invoke-WebRequest -Uri $url -Method 'Get' -Headers $header
41 |
42 | if ($response.StatusCode -ne 200) {
43 | throw "Error, statusCode: $response.StatusCode"
44 | }
45 | }
46 | catch {
47 | throw "Something happen"
48 | }
49 |
--------------------------------------------------------------------------------
/src/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | # CS8603: Possible null reference return.
4 | dotnet_diagnostic.CS8603.severity = none
5 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/App.razor:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 |
21 |
22 |
23 |
24 |
25 |
26 | Not found
27 |
28 |
Sorry, there's nothing at this address.
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Components/DocumentLayout.razor:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 |
21 | @if (DocumentResult != null)
22 | {
23 | @foreach (var documentResult in DocumentResult)
24 | {
25 |
26 |
27 | DocType: @documentResult.DocType
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
FieldName
37 |
Content
38 |
Confidence
39 |
40 |
41 |
42 | @foreach(var field in documentResult.Fields)
43 | {
44 |
45 |
@field.FieldName
46 |
@field.Content
47 |
@field.Confidence
48 |
49 | }
50 |
51 |
52 |
53 |
54 |
55 | }
56 | }
57 |
58 |
59 | @code {
60 |
61 | [Parameter]
62 | public IEnumerable DocumentResult { get; set; }
63 | }
64 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Components/Environments.razor:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | @code {
33 | private SelectEnvironment SelectEnvironment = new();
34 |
35 | [Parameter]
36 | public EventCallback OnEnvironmentChanged { get; set; }
37 |
38 | async Task OnSelectionChanged(string value)
39 | {
40 | MODEL_ENVIRONMENT onSelectedModelEnvironment;
41 | if (Enum.TryParse(value, out onSelectedModelEnvironment))
42 | {
43 | SelectEnvironment.SelectedEnvironment = value;
44 | await OnEnvironmentChanged.InvokeAsync(onSelectedModelEnvironment);
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Components/FileUpload.razor:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 | @inject IFileServiceStorage _fileServiceStorage
21 |
22 |
23 |
24 | @if (ShowError)
25 | {
26 |
27 | @ErrorMsg
28 |
29 | }
30 |
31 | @if (ShowPreview)
32 | {
33 |
34 |
35 |
36 | }
37 |
38 |
39 |
40 | @code {
41 |
42 | private bool ShowPreview = false;
43 | private bool ShowError = false;
44 | private string ErrorMsg = string.Empty;
45 | private string ImagePreview = string.Empty;
46 |
47 | private bool Loading = false;
48 |
49 | [Parameter]
50 | public EventCallback OnFileUpload { get; set; }
51 |
52 | const string DefaultStatus = "Maximum size allowed for the image is 4 MB";
53 | protected string status = DefaultStatus;
54 | const int MaxFileSize = 4 * 1024 * 1024; // 4MB
55 |
56 | protected async Task ViewImage(InputFileChangeEventArgs e)
57 | {
58 | ShowError = false;
59 | ErrorMsg = string.Empty;
60 |
61 | if (e.File.Size > MaxFileSize)
62 | {
63 | ErrorMsg = $"The file size is {e.File.Size} bytes, this is more than the allowed limit of {MaxFileSize} bytes.";
64 | ShowError = true;
65 | return;
66 | }
67 | else if (!e.File.ContentType.ToLower().Contains("pdf"))
68 | {
69 | ShowError = true;
70 | ErrorMsg = "Unsupported file, only pdf are supported";
71 | return;
72 | }
73 |
74 | try
75 | {
76 | Loading = true;
77 | string imageUrl;
78 |
79 | using (var fileStream = e.File.OpenReadStream(MaxFileSize))
80 | using (var memoryStream = new MemoryStream())
81 | {
82 | await fileStream.CopyToAsync(memoryStream);
83 | memoryStream.Position = 0;
84 | Uri filePath = await _fileServiceStorage.UploadAsync(memoryStream);
85 | memoryStream.Position = 0;
86 | var imageFileBytes = memoryStream.ToArray();
87 | ImagePreview = string.Concat("data:application/pdf;base64,", Convert.ToBase64String(memoryStream.ToArray()));
88 | imageUrl = filePath.ToString();
89 | ShowPreview = true;
90 | ShowError = false;
91 | }
92 |
93 | await OnFileUpload.InvokeAsync(imageUrl);
94 | }
95 | catch (Exception ex)
96 | {
97 | ShowPreview = false;
98 | ShowError = true;
99 | ErrorMsg = "Cannot upload the file to storage";
100 | }
101 | finally
102 | {
103 | Loading = false;
104 | }
105 |
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Components/Loading.razor:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 | @if (IsLoading)
21 | {
22 |
23 |
24 |
25 |
Processing please wait...
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | }
34 |
35 | @code {
36 | [Parameter]
37 | public bool IsLoading { get; set; }
38 | }
--------------------------------------------------------------------------------
/src/FormBlazorClient/FormBlazorClient.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | enable
7 | 8045d8ca-4c89-4cb9-a035-ba580a19ea50
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Model/SelectEnvironment.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 | namespace FormBlazorClient.Model;
21 |
22 | public class SelectEnvironment
23 | {
24 | public string SelectedEnvironment { get; set; }
25 | }
26 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Pages/Analyze.razor:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 | @page "/analyze"
21 |
22 | @inject IStateService _stateService
23 | @inject IModelService _modelService
24 |
25 |
26 |
27 |
51 | }
52 |
53 | @if (DocumentResults != null)
54 | {
55 |
56 | }
57 |
58 |
59 | @code {
60 | private string _filePath = string.Empty;
61 | private string ModelId = string.Empty;
62 | private string Environment = string.Empty;
63 | private IEnumerable DocumentResults;
64 |
65 | private bool Loading = false;
66 |
67 | protected override Task OnInitializedAsync()
68 | {
69 | ModelId = _stateService.SelectedModel.ModelId;
70 |
71 | switch (_stateService.SelectedEnvironment)
72 | {
73 | case MODEL_ENVIRONMENT.DEV:
74 | Environment = "DEV";
75 | break;
76 | case MODEL_ENVIRONMENT.QA:
77 | Environment = "QA";
78 | break;
79 | case MODEL_ENVIRONMENT.PROD:
80 | Environment = "PROD";
81 | break;
82 | }
83 |
84 | return base.OnInitializedAsync();
85 | }
86 |
87 | private void OnFileUploaded(string filePath)
88 | {
89 | _filePath = filePath;
90 | }
91 |
92 | private async Task OnAnalyzeDocumentAsync()
93 | {
94 | Loading = true;
95 | try
96 | {
97 | DocumentResults = await _modelService.AnalyzeDocumentAsync(_filePath,
98 | _stateService.SelectedModel.ModelId,
99 | _stateService.SelectedEnvironment);
100 | }
101 | catch
102 | {
103 |
104 | }
105 | finally
106 | {
107 | Loading = false;
108 | }
109 |
110 |
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Pages/Error.cshtml:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 | @page
21 | @model FormBlazorClient.Pages.ErrorModel
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | Error
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
Error.
38 |
An error occurred while processing your request.
39 |
40 | @if (Model.ShowRequestId)
41 | {
42 |
43 | Request ID:@Model.RequestId
44 |
45 | }
46 |
47 |
Development Mode
48 |
49 | Swapping to the Development environment displays detailed information about the error that occurred.
50 |
51 |
52 | The Development environment shouldn't be enabled for deployed applications.
53 | It can result in displaying sensitive information from exceptions to end users.
54 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
55 | and restarting the app.
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Pages/Error.cshtml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 | using Microsoft.AspNetCore.Mvc;
21 | using Microsoft.AspNetCore.Mvc.RazorPages;
22 | using System.Diagnostics;
23 |
24 | namespace FormBlazorClient.Pages
25 | {
26 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
27 | [IgnoreAntiforgeryToken]
28 | public class ErrorModel : PageModel
29 | {
30 | public string? RequestId { get; set; }
31 |
32 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
33 |
34 | private readonly ILogger _logger;
35 |
36 | public ErrorModel(ILogger logger)
37 | {
38 | _logger = logger;
39 | }
40 |
41 | public void OnGet()
42 | {
43 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/src/FormBlazorClient/Pages/Index.razor:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 | @page "/"
21 |
22 | @inject IModelService _modelService
23 | @inject IStateService _stateService
24 | @inject IJSRuntime _jsRuntime
25 | @inject NavigationManager _navigationManager
26 |
27 |
List of trained model in an environment
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | @if (Models != null)
38 | {
39 |
40 |
41 |
42 |
43 |
44 |
ModelId
45 |
Description
46 |
CreatedOn
47 |
48 |
49 |
50 |
51 |
52 | @foreach(var model in Models)
53 | {
54 |
55 |
@model.ModelId
56 |
@model.Description
57 |
@model.CreatedOn
58 |
59 |
62 |
63 |
64 |
67 |
68 |
69 | }
70 |
71 |
72 |
73 |
74 | }
75 |
76 |
77 | @code {
78 | private bool IsLoading = false;
79 |
80 | private IList Models;
81 | private MODEL_ENVIRONMENT SelectedEnvironment;
82 |
83 | private async Task OnEnvironmentChanged(MODEL_ENVIRONMENT environment)
84 | {
85 | IsLoading = true;
86 | SelectedEnvironment = environment;
87 | Models = await _modelService.GetModelsAsync(environment);
88 | IsLoading = false;
89 | }
90 |
91 | private async Task OnDeleteModel(ModelInfo model)
92 | {
93 | bool confirmed = await _jsRuntime.InvokeAsync("confirm", $"Are you sure you want to delete the model {model.ModelId}");
94 | if (confirmed)
95 | {
96 | IsLoading = true;
97 | bool success = await _modelService.DeleteModelAsync(model.ModelId, SelectedEnvironment);
98 |
99 | if (success)
100 | {
101 | Models.Remove(model);
102 | }
103 |
104 | IsLoading = false;
105 | }
106 | }
107 |
108 | private void OnTestModel(ModelInfo model)
109 | {
110 | _stateService.SelectedModel = model;
111 | _stateService.SelectedEnvironment = SelectedEnvironment;
112 | _navigationManager.NavigateTo("/analyze");
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Pages/_Host.cshtml:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 | @page "/"
21 | @namespace FormBlazorClient.Pages
22 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
23 | @{
24 | Layout = "_Layout";
25 | }
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Pages/_Layout.cshtml:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 | @using Microsoft.AspNetCore.Components.Web
21 | @namespace FormBlazorClient.Pages
22 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | @RenderBody()
38 |
39 |
40 |
41 | An error has occurred. This application may no longer respond until reloaded.
42 |
43 |
44 | An unhandled exception has occurred. See browser dev tools for details.
45 |
46 | Reload
47 | 🗙
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Program.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 | using Microsoft.AspNetCore.Components;
21 | using Microsoft.AspNetCore.Components.Web;
22 |
23 | var builder = WebApplication.CreateBuilder(args);
24 |
25 | // Add services to the container.
26 | builder.Services.AddRazorPages();
27 | builder.Services.AddServerSideBlazor();
28 | builder.Services.AddHttpClient();
29 | builder.Services.AddSingleton();
30 | builder.Services.AddSingleton();
31 | builder.Services.AddSingleton();
32 |
33 | var app = builder.Build();
34 |
35 | // Configure the HTTP request pipeline.
36 | if (!app.Environment.IsDevelopment())
37 | {
38 | app.UseExceptionHandler("/Error");
39 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
40 | app.UseHsts();
41 | }
42 |
43 | app.UseHttpsRedirection();
44 |
45 | app.UseStaticFiles();
46 |
47 | app.UseRouting();
48 |
49 | app.MapBlazorHub();
50 | app.MapFallbackToPage("/_Host");
51 |
52 | app.Run();
53 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:44761",
7 | "sslPort": 44367
8 | }
9 | },
10 | "profiles": {
11 | "FormBlazorClient": {
12 | "commandName": "Project",
13 | "dotnetRunMessages": true,
14 | "launchBrowser": true,
15 | "applicationUrl": "https://localhost:7203;http://localhost:5203",
16 | "environmentVariables": {
17 | "ASPNETCORE_ENVIRONMENT": "Development"
18 | }
19 | },
20 | "IIS Express": {
21 | "commandName": "IISExpress",
22 | "launchBrowser": true,
23 | "environmentVariables": {
24 | "ASPNETCORE_ENVIRONMENT": "Development"
25 | }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Service/FileServiceStorage.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 | using Azure.Storage.Blobs;
21 | using Azure.Storage;
22 | using Azure.Storage.Blobs.Models;
23 | using Azure.Storage.Blobs.Specialized;
24 | using Azure.Storage.Sas;
25 |
26 | namespace FormBlazorClient.Service;
27 |
28 | public class FileServiceStorage : IFileServiceStorage
29 | {
30 | private readonly BlobContainerClient _container;
31 |
32 | public FileServiceStorage(IConfiguration configuration)
33 | {
34 | _container = new BlobContainerClient(configuration["UploadStorage"],
35 | configuration["Container"]);
36 | }
37 |
38 | public async Task UploadAsync(Stream content)
39 | {
40 | string filename = $"{Guid.NewGuid().ToString()}.pdf";
41 |
42 | BlobClient blob = _container.GetBlobClient(filename);
43 |
44 | await blob.UploadAsync(content);
45 |
46 | // Generate a SAS token valid for 1 hour
47 | var sasBuilder = new BlobSasBuilder()
48 | {
49 | BlobContainerName = blob.GetParentBlobContainerClient().Name,
50 | BlobName = blob.Name,
51 | Resource = "b",
52 | StartsOn = DateTimeOffset.UtcNow,
53 | ExpiresOn = DateTimeOffset.UtcNow.AddHours(1)
54 | };
55 |
56 | // Specify read and write permissions for the SAS.
57 | sasBuilder.SetPermissions(BlobSasPermissions.Read);
58 |
59 | return blob.GenerateSasUri(sasBuilder);
60 |
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Service/IFileServiceStorage.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 | namespace FormBlazorClient.Service
21 | {
22 | public interface IFileServiceStorage
23 | {
24 | Task UploadAsync(Stream content);
25 | }
26 | }
--------------------------------------------------------------------------------
/src/FormBlazorClient/Service/IModelService.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 | namespace FormBlazorClient.Service
21 | {
22 | public interface IModelService
23 | {
24 | Task DeleteModelAsync(string modelId, MODEL_ENVIRONMENT environment);
25 | Task> GetModelsAsync(MODEL_ENVIRONMENT environment);
26 |
27 | Task> AnalyzeDocumentAsync(string documentUrl, string modelId, MODEL_ENVIRONMENT environment);
28 | }
29 | }
--------------------------------------------------------------------------------
/src/FormBlazorClient/Service/IStateService.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 | namespace FormBlazorClient.Service
21 | {
22 | public interface IStateService
23 | {
24 | MODEL_ENVIRONMENT SelectedEnvironment { get; set; }
25 | ModelInfo SelectedModel { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/FormBlazorClient/Service/ModelService.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 | using System.Dynamic;
21 | using System.Text.Json;
22 |
23 | namespace FormBlazorClient.Service;
24 |
25 | public class ModelService : IModelService
26 | {
27 | private readonly IHttpClientFactory _httpClientfactory;
28 | private readonly string BASE_URL;
29 | private readonly string FUNCTION_CODE;
30 |
31 | public ModelService(IHttpClientFactory httpClientfactory, IConfiguration configuration)
32 | {
33 | _httpClientfactory = httpClientfactory;
34 | BASE_URL = configuration["FunctionBaseUrl"];
35 | FUNCTION_CODE = configuration["FunctionKeyCode"];
36 | }
37 |
38 | public async Task> GetModelsAsync(MODEL_ENVIRONMENT environment)
39 | {
40 | string url = $"{BASE_URL}/GetModel?environment={environment}";
41 |
42 | HttpResponseMessage response = await SendRequestAsync(url, HttpMethod.Get);
43 |
44 | if (response.IsSuccessStatusCode)
45 | {
46 | string json = await response.Content.ReadAsStringAsync();
47 |
48 | return JsonSerializer.Deserialize>(json,new JsonSerializerOptions
49 | {
50 | PropertyNamingPolicy = JsonNamingPolicy.CamelCase
51 | });
52 |
53 | }
54 |
55 | return new List();
56 | }
57 | public async Task DeleteModelAsync(string modelId, MODEL_ENVIRONMENT environment)
58 | {
59 | string url = $"{BASE_URL}/DeleteModel";
60 |
61 | dynamic payload = new ExpandoObject();
62 | payload.modelId = modelId;
63 | payload.environment = environment;
64 |
65 | HttpResponseMessage response = await SendRequestAsync(url, HttpMethod.Delete, payload);
66 |
67 | if (response.IsSuccessStatusCode)
68 | return true;
69 |
70 | return false;
71 | }
72 |
73 | public async Task> AnalyzeDocumentAsync(string documentUrl,string modelId, MODEL_ENVIRONMENT environment)
74 | {
75 |
76 | string url = $"{BASE_URL}/AnalyzeDocument";
77 |
78 | dynamic payload = new ExpandoObject();
79 | payload.ModelId = modelId;
80 | payload.Environment = environment;
81 | payload.DocumentUrl = documentUrl;
82 |
83 | HttpResponseMessage response = await SendRequestAsync(url,HttpMethod.Post,payload);
84 |
85 | if (!response.IsSuccessStatusCode)
86 | return null;
87 |
88 | string json = await response.Content.ReadAsStringAsync();
89 |
90 | return JsonSerializer.Deserialize>(json, new JsonSerializerOptions
91 | {
92 | PropertyNamingPolicy = JsonNamingPolicy.CamelCase
93 | });
94 |
95 | }
96 |
97 | private async Task SendRequestAsync(string url, HttpMethod method)
98 | {
99 | return await SendRequestAsync(url, method, null);
100 | }
101 |
102 | private async Task SendRequestAsync(string url, HttpMethod method, dynamic? payload)
103 | {
104 | var request = new HttpRequestMessage(method, url);
105 | request.Headers.Add("x-functions-key", FUNCTION_CODE);
106 | if (payload != null)
107 | {
108 | request.Content = new StringContent(JsonSerializer.Serialize(payload, new JsonSerializerOptions
109 | {
110 | PropertyNamingPolicy = JsonNamingPolicy.CamelCase
111 | }));
112 | }
113 |
114 | var client = _httpClientfactory.CreateClient();
115 | return await client.SendAsync(request);
116 | }
117 |
118 |
119 | }
120 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Service/StateService.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 | namespace FormBlazorClient.Service;
21 |
22 | public class StateService : IStateService
23 | {
24 | public ModelInfo SelectedModel { get; set; }
25 |
26 | public MODEL_ENVIRONMENT SelectedEnvironment { get; set; }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Shared/MainLayout.razor:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 | @inherits LayoutComponentBase
21 |
22 | FormBlazorClient
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | @Body
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Shared/MainLayout.razor.css:
--------------------------------------------------------------------------------
1 | .page {
2 | position: relative;
3 | display: flex;
4 | flex-direction: column;
5 | }
6 |
7 | main {
8 | flex: 1;
9 | }
10 |
11 | .sidebar {
12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
13 | }
14 |
15 | .top-row {
16 | background-color: #f7f7f7;
17 | border-bottom: 1px solid #d6d5d5;
18 | justify-content: flex-end;
19 | height: 3.5rem;
20 | display: flex;
21 | align-items: center;
22 | }
23 |
24 | .top-row ::deep a, .top-row .btn-link {
25 | white-space: nowrap;
26 | margin-left: 1.5rem;
27 | }
28 |
29 | .top-row a:first-child {
30 | overflow: hidden;
31 | text-overflow: ellipsis;
32 | }
33 |
34 | @media (max-width: 640.98px) {
35 | .top-row:not(.auth) {
36 | display: none;
37 | }
38 |
39 | .top-row.auth {
40 | justify-content: space-between;
41 | }
42 |
43 | .top-row a, .top-row .btn-link {
44 | margin-left: 0;
45 | }
46 | }
47 |
48 | @media (min-width: 641px) {
49 | .page {
50 | flex-direction: row;
51 | }
52 |
53 | .sidebar {
54 | width: 250px;
55 | height: 100vh;
56 | position: sticky;
57 | top: 0;
58 | }
59 |
60 | .top-row {
61 | position: sticky;
62 | top: 0;
63 | z-index: 1;
64 | }
65 |
66 | .top-row, article {
67 | padding-left: 2rem !important;
68 | padding-right: 1.5rem !important;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Shared/NavMenu.razor:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 |
38 |
39 | @code {
40 | private bool collapseNavMenu = true;
41 |
42 | private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
43 |
44 | private void ToggleNavMenu()
45 | {
46 | collapseNavMenu = !collapseNavMenu;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Shared/NavMenu.razor.css:
--------------------------------------------------------------------------------
1 | .navbar-toggler {
2 | background-color: rgba(255, 255, 255, 0.1);
3 | }
4 |
5 | .top-row {
6 | height: 3.5rem;
7 | background-color: rgba(0,0,0,0.4);
8 | }
9 |
10 | .navbar-brand {
11 | font-size: 1.1rem;
12 | }
13 |
14 | .oi {
15 | width: 2rem;
16 | font-size: 1.1rem;
17 | vertical-align: text-top;
18 | top: -2px;
19 | }
20 |
21 | .nav-item {
22 | font-size: 0.9rem;
23 | padding-bottom: 0.5rem;
24 | }
25 |
26 | .nav-item:first-of-type {
27 | padding-top: 1rem;
28 | }
29 |
30 | .nav-item:last-of-type {
31 | padding-bottom: 1rem;
32 | }
33 |
34 | .nav-item ::deep a {
35 | color: #d7d7d7;
36 | border-radius: 4px;
37 | height: 3rem;
38 | display: flex;
39 | align-items: center;
40 | line-height: 3rem;
41 | }
42 |
43 | .nav-item ::deep a.active {
44 | background-color: rgba(255,255,255,0.25);
45 | color: white;
46 | }
47 |
48 | .nav-item ::deep a:hover {
49 | background-color: rgba(255,255,255,0.1);
50 | color: white;
51 | }
52 |
53 | @media (min-width: 641px) {
54 | .navbar-toggler {
55 | display: none;
56 | }
57 |
58 | .collapse {
59 | /* Never collapse the sidebar for wide screens */
60 | display: block;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/Shared/SurveyPrompt.razor:
--------------------------------------------------------------------------------
1 | @*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | *@
20 |
21 |
22 | @Title
23 |
24 |
25 | Please take our
26 | brief survey
27 |
28 | and tell us what you think.
29 |
30 |
31 | @code {
32 | // Demonstrates how a parent component can supply parameters
33 | [Parameter]
34 | public string? Title { get; set; }
35 | }
36 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using System.Net.Http
2 | @using Microsoft.AspNetCore.Authorization
3 | @using Microsoft.AspNetCore.Components.Authorization
4 | @using Microsoft.AspNetCore.Components.Forms
5 | @using Microsoft.AspNetCore.Components.Routing
6 | @using Microsoft.AspNetCore.Components.Web
7 | @using Microsoft.AspNetCore.Components.Web.Virtualization
8 | @using Microsoft.JSInterop
9 | @using FormBlazorClient
10 | @using FormBlazorClient.Shared
11 | @using FormBlazorClient.Components
--------------------------------------------------------------------------------
/src/FormBlazorClient/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "DetailedErrors": true,
3 | "Logging": {
4 | "LogLevel": {
5 | "Default": "Information",
6 | "Microsoft.AspNetCore": "Warning"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/global.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Notice: Any links, references, or attachments that contain sample scripts, code, or commands comes with the following notification.
3 | *
4 | * This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
5 | * THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6 | * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 | *
8 | * We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code,
9 | * provided that You agree:
10 | *
11 | * (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
12 | * (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
13 | * (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
14 | * including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
15 | *
16 | * Please note: None of the conditions outlined in the disclaimer above will superseded the terms and conditions contained within the Premier Customer Services Description.
17 | *
18 | * DEMO POC - "AS IS"
19 | */
20 | global using FormBlazorClient.Model;
21 | global using FormBlazorClient.Service;
22 | global using Demo.Shared.Models;
--------------------------------------------------------------------------------
/src/FormBlazorClient/libman.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0",
3 | "defaultProvider": "cdnjs",
4 | "libraries": [
5 | {
6 | "library": "font-awesome@4.7.0",
7 | "destination": "wwwroot/css/font-awesome/"
8 | }
9 | ]
10 | }
--------------------------------------------------------------------------------
/src/FormBlazorClient/wwwroot/css/font-awesome/fonts/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/src/FormBlazorClient/wwwroot/css/font-awesome/fonts/FontAwesome.otf
--------------------------------------------------------------------------------
/src/FormBlazorClient/wwwroot/css/font-awesome/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/src/FormBlazorClient/wwwroot/css/font-awesome/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/src/FormBlazorClient/wwwroot/css/font-awesome/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/src/FormBlazorClient/wwwroot/css/font-awesome/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/src/FormBlazorClient/wwwroot/css/font-awesome/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/src/FormBlazorClient/wwwroot/css/font-awesome/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/src/FormBlazorClient/wwwroot/css/font-awesome/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hugogirard/formRecognizerDevOps/c7214a41a35badc3ce920ed1bb831b9c2bc023b7/src/FormBlazorClient/wwwroot/css/font-awesome/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/src/FormBlazorClient/wwwroot/css/open-iconic/FONT-LICENSE:
--------------------------------------------------------------------------------
1 | SIL OPEN FONT LICENSE Version 1.1
2 |
3 | Copyright (c) 2014 Waybury
4 |
5 | PREAMBLE
6 | The goals of the Open Font License (OFL) are to stimulate worldwide
7 | development of collaborative font projects, to support the font creation
8 | efforts of academic and linguistic communities, and to provide a free and
9 | open framework in which fonts may be shared and improved in partnership
10 | with others.
11 |
12 | The OFL allows the licensed fonts to be used, studied, modified and
13 | redistributed freely as long as they are not sold by themselves. The
14 | fonts, including any derivative works, can be bundled, embedded,
15 | redistributed and/or sold with any software provided that any reserved
16 | names are not used by derivative works. The fonts and derivatives,
17 | however, cannot be released under any other type of license. The
18 | requirement for fonts to remain under this license does not apply
19 | to any document created using the fonts or their derivatives.
20 |
21 | DEFINITIONS
22 | "Font Software" refers to the set of files released by the Copyright
23 | Holder(s) under this license and clearly marked as such. This may
24 | include source files, build scripts and documentation.
25 |
26 | "Reserved Font Name" refers to any names specified as such after the
27 | copyright statement(s).
28 |
29 | "Original Version" refers to the collection of Font Software components as
30 | distributed by the Copyright Holder(s).
31 |
32 | "Modified Version" refers to any derivative made by adding to, deleting,
33 | or substituting -- in part or in whole -- any of the components of the
34 | Original Version, by changing formats or by porting the Font Software to a
35 | new environment.
36 |
37 | "Author" refers to any designer, engineer, programmer, technical
38 | writer or other person who contributed to the Font Software.
39 |
40 | PERMISSION & CONDITIONS
41 | Permission is hereby granted, free of charge, to any person obtaining
42 | a copy of the Font Software, to use, study, copy, merge, embed, modify,
43 | redistribute, and sell modified and unmodified copies of the Font
44 | Software, subject to the following conditions:
45 |
46 | 1) Neither the Font Software nor any of its individual components,
47 | in Original or Modified Versions, may be sold by itself.
48 |
49 | 2) Original or Modified Versions of the Font Software may be bundled,
50 | redistributed and/or sold with any software, provided that each copy
51 | contains the above copyright notice and this license. These can be
52 | included either as stand-alone text files, human-readable headers or
53 | in the appropriate machine-readable metadata fields within text or
54 | binary files as long as those fields can be easily viewed by the user.
55 |
56 | 3) No Modified Version of the Font Software may use the Reserved Font
57 | Name(s) unless explicit written permission is granted by the corresponding
58 | Copyright Holder. This restriction only applies to the primary font name as
59 | presented to the users.
60 |
61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
62 | Software shall not be used to promote, endorse or advertise any
63 | Modified Version, except to acknowledge the contribution(s) of the
64 | Copyright Holder(s) and the Author(s) or with their explicit written
65 | permission.
66 |
67 | 5) The Font Software, modified or unmodified, in part or in whole,
68 | must be distributed entirely under this license, and must not be
69 | distributed under any other license. The requirement for fonts to
70 | remain under this license does not apply to any document created
71 | using the Font Software.
72 |
73 | TERMINATION
74 | This license becomes null and void if any of the above conditions are
75 | not met.
76 |
77 | DISCLAIMER
78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
86 | OTHER DEALINGS IN THE FONT SOFTWARE.
87 |
--------------------------------------------------------------------------------
/src/FormBlazorClient/wwwroot/css/open-iconic/ICON-LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Waybury
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/src/FormBlazorClient/wwwroot/css/open-iconic/README.md:
--------------------------------------------------------------------------------
1 | [Open Iconic v1.1.1](http://useiconic.com/open)
2 | ===========
3 |
4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons)
5 |
6 |
7 |
8 | ## What's in Open Iconic?
9 |
10 | * 223 icons designed to be legible down to 8 pixels
11 | * Super-light SVG files - 61.8 for the entire set
12 | * SVG sprite—the modern replacement for icon fonts
13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats
14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats
15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px.
16 |
17 |
18 | ## Getting Started
19 |
20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections.
21 |
22 | ### General Usage
23 |
24 | #### Using Open Iconic's SVGs
25 |
26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute).
27 |
28 | ```
29 |
30 | ```
31 |
32 | #### Using Open Iconic's SVG Sprite
33 |
34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack.
35 |
36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `