├── .azure └── config.json ├── .github ├── CODE_OF_CONDUCT.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── deploy.yml ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── LICENSE.txt ├── README.md ├── azure.yaml ├── docs └── media │ ├── azure-portal.png │ ├── cicd-phases.png │ ├── deploy-started.png │ ├── deploy.png │ ├── edit-the-deploy-file.png │ ├── get-public-url.png │ ├── secrets.png │ ├── secrets2.png │ ├── store-ui.png │ ├── success.png │ └── topology.png ├── infra ├── abbreviations.json ├── app │ ├── inventory.bicep │ ├── products.bicep │ └── store.bicep ├── core │ ├── ai │ │ └── cognitiveservices.bicep │ ├── database │ │ ├── cosmos │ │ │ ├── cosmos-account.bicep │ │ │ ├── mongo │ │ │ │ ├── cosmos-mongo-account.bicep │ │ │ │ └── cosmos-mongo-db.bicep │ │ │ └── sql │ │ │ │ ├── cosmos-sql-account.bicep │ │ │ │ ├── cosmos-sql-db.bicep │ │ │ │ ├── cosmos-sql-role-assign.bicep │ │ │ │ └── cosmos-sql-role-def.bicep │ │ ├── postgresql │ │ │ └── flexibleserver.bicep │ │ └── sqlserver │ │ │ └── sqlserver.bicep │ ├── gateway │ │ └── apim.bicep │ ├── host │ │ ├── aks-agent-pool.bicep │ │ ├── aks-managed-cluster.bicep │ │ ├── aks.bicep │ │ ├── appservice-appsettings.bicep │ │ ├── appservice.bicep │ │ ├── appserviceplan.bicep │ │ ├── container-app-upsert.bicep │ │ ├── container-app.bicep │ │ ├── container-apps-environment.bicep │ │ ├── container-apps.bicep │ │ ├── container-registry.bicep │ │ ├── functions.bicep │ │ └── staticwebapp.bicep │ ├── monitor │ │ ├── applicationinsights-dashboard.bicep │ │ ├── applicationinsights.bicep │ │ ├── loganalytics.bicep │ │ └── monitoring.bicep │ ├── networking │ │ ├── cdn-endpoint.bicep │ │ ├── cdn-profile.bicep │ │ └── cdn.bicep │ ├── search │ │ └── search-services.bicep │ ├── security │ │ ├── keyvault-access.bicep │ │ ├── keyvault-secret.bicep │ │ ├── keyvault.bicep │ │ ├── registry-access.bicep │ │ ├── role.bicep │ │ └── user-assigned-identity.bicep │ └── storage │ │ └── storage-account.bicep ├── main.bicep └── main.parameters.json └── src ├── .dockerignore ├── Monitoring ├── ApplicationMapNodeNameInitializer.cs └── Monitoring.csproj ├── Store.InventoryApi ├── Dockerfile ├── Program.cs ├── Properties │ └── launchSettings.json ├── Store.InventoryApi.csproj ├── appsettings.Development.json └── appsettings.json ├── Store.ProductApi ├── Dockerfile ├── Program.cs ├── Properties │ └── launchSettings.json ├── Store.ProductApi.csproj ├── appsettings.Development.json └── appsettings.json ├── Store.sln └── Store ├── App.razor ├── Dockerfile ├── Pages ├── Error.cshtml ├── Error.cshtml.cs ├── Index.razor ├── _Host.cshtml └── _Layout.cshtml ├── Program.cs ├── Properties └── launchSettings.json ├── Shared ├── MainLayout.razor ├── MainLayout.razor.css └── SurveyPrompt.razor ├── Store.csproj ├── _Imports.razor ├── appsettings.Development.json ├── appsettings.json └── wwwroot ├── css ├── bootstrap │ ├── bootstrap.min.css │ └── bootstrap.min.css.map ├── 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 /.azure/config.json: -------------------------------------------------------------------------------- 1 | {"version":1,"defaultEnvironment":"bradyg2apps05"} -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | > Please provide us with the following information: 5 | > --------------------------------------------------------------- 6 | 7 | ### This issue is for a: (mark with an `x`) 8 | ``` 9 | - [ ] bug report -> please search issues before submitting 10 | - [ ] feature request 11 | - [ ] documentation issue or request 12 | - [ ] regression (a behavior that used to work and stopped in a new release) 13 | ``` 14 | 15 | ### Minimal steps to reproduce 16 | > 17 | 18 | ### Any log messages given by the failure 19 | > 20 | 21 | ### Expected/desired behavior 22 | > 23 | 24 | ### OS and Version? 25 | > Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) 26 | 27 | ### Versions 28 | > 29 | 30 | ### Mention any other details that might be useful 31 | 32 | > --------------------------------------------------------------- 33 | > Thanks! We'll be in touch soon. 34 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Purpose 2 | 3 | * ... 4 | 5 | ## Does this introduce a breaking change? 6 | 7 | ``` 8 | [ ] Yes 9 | [ ] No 10 | ``` 11 | 12 | ## Pull Request Type 13 | What kind of change does this Pull Request introduce? 14 | 15 | 16 | ``` 17 | [ ] Bugfix 18 | [ ] Feature 19 | [ ] Code style update (formatting, local variables) 20 | [ ] Refactoring (no functional changes, no api changes) 21 | [ ] Documentation content changes 22 | [ ] Other... Please describe: 23 | ``` 24 | 25 | ## How to Test 26 | * Get the code 27 | 28 | ``` 29 | git clone [repo-address] 30 | cd [repo-name] 31 | git checkout [branch-name] 32 | npm install 33 | ``` 34 | 35 | * Test the code 36 | 37 | ``` 38 | ``` 39 | 40 | ## What to Check 41 | Verify that the following are valid 42 | * ... 43 | 44 | ## Other Information 45 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | on: 2 | workflow_dispatch: 3 | push: 4 | branches: 5 | - deploy 6 | 7 | env: 8 | 9 | # alphanumeric string under 14 characters 10 | RESOURCE_GROUP_NAME: bradygstore02 11 | 12 | # specify your preferred region 13 | REGION: westus 14 | 15 | permissions: 16 | id-token: write 17 | contents: read 18 | 19 | jobs: 20 | build: 21 | runs-on: ubuntu-latest 22 | container: 23 | image: mcr.microsoft.com/azure-dev-cli-apps:latest 24 | env: 25 | AZURE_CREDENTIALS: ${{ secrets.AzureSPN }} 26 | AZURE_ENV_NAME: ${{ vars.RESOURCE_GROUP_NAME }} 27 | AZURE_LOCATION: ${{ vars.REGION }} 28 | AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} 29 | steps: 30 | - name: Checkout 31 | uses: actions/checkout@v3 32 | 33 | - name: Log in with Azure (Client Credentials) 34 | run: | 35 | $info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable; 36 | Write-Host "::add-mask::$($info.clientSecret)" 37 | 38 | azd auth login ` 39 | --client-id "$($info.clientId)" ` 40 | --client-secret "$($info.clientSecret)" ` 41 | --tenant-id "$($info.tenantId)" 42 | shell: pwsh 43 | env: 44 | AZURE_CREDENTIALS: ${{ secrets.AzureSPN }} 45 | 46 | - name: Provision Azure Resources 47 | run: azd provision --no-prompt 48 | env: 49 | AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }} 50 | AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} 51 | AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} 52 | 53 | - name: Deploy changes to Azure Container Apps 54 | run: azd deploy --no-prompt 55 | env: 56 | AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }} 57 | AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} 58 | AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} 59 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | .azure 352 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [project-title] Changelog 2 | 3 | 4 | # x.y.z (yyyy-mm-dd) 5 | 6 | *Features* 7 | * ... 8 | 9 | *Bug Fixes* 10 | * ... 11 | 12 | *Breaking Changes* 13 | * ... 14 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to [project-title] 2 | 3 | This project welcomes contributions and suggestions. Most contributions require you to agree to a 4 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 5 | the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. 6 | 7 | When you submit a pull request, a CLA bot will automatically determine whether you need to provide 8 | a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions 9 | provided by the bot. You will only need to do this once across all repos using our CLA. 10 | 11 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 12 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 13 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 14 | 15 | - [Code of Conduct](#coc) 16 | - [Issues and Bugs](#issue) 17 | - [Feature Requests](#feature) 18 | - [Submission Guidelines](#submit) 19 | 20 | ## Code of Conduct 21 | Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 22 | 23 | ## Found an Issue? 24 | If you find a bug in the source code or a mistake in the documentation, you can help us by 25 | [submitting an issue](#submit-issue) to the GitHub Repository. Even better, you can 26 | [submit a Pull Request](#submit-pr) with a fix. 27 | 28 | ## Want a Feature? 29 | You can *request* a new feature by [submitting an issue](#submit-issue) to the GitHub 30 | Repository. If you would like to *implement* a new feature, please submit an issue with 31 | a proposal for your work first, to be sure that we can use it. 32 | 33 | * **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr). 34 | 35 | ## Submission Guidelines 36 | 37 | ### Submitting an Issue 38 | Before you submit an issue, search the archive, maybe your question was already answered. 39 | 40 | If your issue appears to be a bug, and hasn't been reported, open a new issue. 41 | Help us to maximize the effort we can spend fixing issues and adding new 42 | features, by not reporting duplicate issues. Providing the following information will increase the 43 | chances of your issue being dealt with quickly: 44 | 45 | * **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps 46 | * **Version** - what version is affected (e.g. 0.1.2) 47 | * **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you 48 | * **Browsers and Operating System** - is this a problem with all browsers? 49 | * **Reproduce the Error** - provide a live example or a unambiguous set of steps 50 | * **Related Issues** - has a similar issue been reported before? 51 | * **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be 52 | causing the problem (line of code or commit) 53 | 54 | You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/[organization-name]/[repository-name]/issues/new]. 55 | 56 | ### Submitting a Pull Request (PR) 57 | Before you submit your Pull Request (PR) consider the following guidelines: 58 | 59 | * Search the repository (https://github.com/[organization-name]/[repository-name]/pulls) for an open or closed PR 60 | that relates to your submission. You don't want to duplicate effort. 61 | 62 | * Make your changes in a new git fork: 63 | 64 | * Commit your changes using a descriptive commit message 65 | * Push your fork to GitHub: 66 | * In GitHub, create a pull request 67 | * If we suggest changes then: 68 | * Make the required updates. 69 | * Rebase your fork and force push to your GitHub repository (this will update your Pull Request): 70 | 71 | ```shell 72 | git rebase master -i 73 | git push -f 74 | ``` 75 | 76 | That's it! Thank you for your contribution! 77 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 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 -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ASP.NET Core Front-end + 2 Back-end APIs on Azure Container Apps 2 | 3 | This repository contains a simple scenario built to demonstrate how ASP.NET Core 6.0 can be used to build a cloud-native application hosted in Azure Container Apps. The repository consists of the following projects and folders: 4 | 5 | * Store - A Blazor server project representing the frontend of an online store. The store's UI shows a list of all the products in the store, and their associated inventory status. 6 | * Products API - A simple API that generates fake product names using the open-source NuGet package [Bogus](https://github.com/bchavez/Bogus). 7 | * Inventory API - A simple API that provides a random number for a given product ID string. The values of each string/integer pair are stored in memory cache so they are consistent between API calls. 8 | * Azure folder - contains Azure Bicep files used for creating and configuring all the Azure resources. 9 | * GitHub Actions workflow file used to deploy the app using CI/CD. 10 | 11 | ## What you'll learn 12 | 13 | This exercise will introduce you to a variety of concepts, with links to supporting documentation throughout the tutorial. 14 | 15 | * [Azure Container Apps](https://docs.microsoft.com/azure/container-apps/overview) 16 | * [GitHub Actions](https://github.com/features/actions) 17 | * [Azure Container Registry](https://docs.microsoft.com/azure/container-registry/) 18 | * [Azure Bicep](https://docs.microsoft.com/azure/azure-resource-manager/bicep/overview?tabs=**bicep**) 19 | 20 | ## Prerequisites 21 | 22 | You'll need an Azure subscription and a very small set of tools and skills to get started: 23 | 24 | 1. An Azure subscription. Sign up [for free](https://azure.microsoft.com/free/). 25 | 2. A GitHub account, with access to GitHub Actions. 26 | 3. Either the [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli) installed locally, or, access to [GitHub Codespaces](https://github.com/features/codespaces), which would enable you to do develop in your browser. 27 | 28 | ## Topology diagram 29 | 30 | The resultant application is an Azure Container Environment-hosted set of containers - the `products` API, the `inventory` API, and the `store` Blazor Server front-end. 31 | 32 | ![Application topology](docs/media/topology.png) 33 | 34 | Internet traffic should not be able to directly access either of the back-end APIs as each of these containers is marked as "internal ingress only" during the deployment phase. Internet traffic hitting the `store...azurecontainerapps.io` URL should be proxied to the `frontend` container, which in turn makes outbound calls to both the `products` and `inventory` APIs within the Azure Container Apps Environment. 35 | 36 | ## Setup 37 | 38 | By the end of this section you'll have a 3-node app running in Azure. This setup process consists of two steps, and should take you around 15 minutes. 39 | 40 | 1. Use the Azure CLI to create an Azure Service Principal, then store that principal's JSON output to a GitHub secret so the GitHub Actions CI/CD process can log into your Azure subscription and deploy the code. 41 | 2. Edit the ` deploy.yml` workflow file and push the changes into a new `deploy` branch, triggering GitHub Actions to build the .NET projects into containers and push those containers into a new Azure Container Apps Environment. 42 | 43 | ## Authenticate to Azure and configure the repository with a secret 44 | 45 | 1. Fork this repository to your own GitHub organization. 46 | 2. Create an Azure Service Principal using the Azure CLI. 47 | 48 | ```bash 49 | $subscriptionId=$(az account show --query id --output tsv) 50 | az ad sp create-for-rbac --sdk-auth --name WebAndApiSample --role owner --scopes /subscriptions/$subscriptionId 51 | ``` 52 | 53 | 3. Copy the JSON written to the screen to your clipboard. 54 | 55 | ```json 56 | { 57 | "clientId": "", 58 | "clientSecret": "", 59 | "subscriptionId": "", 60 | "tenantId": "", 61 | "activeDirectoryEndpointUrl": "https://login.microsoftonline.com/", 62 | "resourceManagerEndpointUrl": "https://brazilus.management.azure.com", 63 | "activeDirectoryGraphResourceId": "https://graph.windows.net/", 64 | "sqlManagementEndpointUrl": "https://management.core.windows.net:8443/", 65 | "galleryEndpointUrl": "https://gallery.azure.com", 66 | "managementEndpointUrl": "https://management.core.windows.net" 67 | } 68 | ``` 69 | 70 | 4. Create a new GitHub secret in your fork of this repository named `AzureSPN`. Paste the JSON returned from the Azure CLI into this new secret. Once you've done this you'll see the secret in your fork of the repository. 71 | 72 | ![The AzureSPN secret in GitHub](docs/media/secrets.png) 73 | 74 | 5. Create a second GitHub secret in your fork of this repository named `AZURE_SUBSCRIPTION_ID`. Provide the specific Azure subscription you want to impact as the value for this secret. Ocne finished, the two secrets' names will show on the page. 75 | 76 | ![The AzureSPN and subscription id secrets in GitHub](docs/media/secrets2.png) 77 | 78 | > Note: Never save the JSON to disk, for it will enable anyone who obtains this JSON code to create or edit resources in your Azure subscription. 79 | 80 | ## Deploy the code using GitHub Actions 81 | 82 | The easiest way to deploy the code is to make a commit directly to the `deploy` branch. Do this by navigating to the `deploy.yml` file in your browser and clicking the `Edit` button. 83 | 84 | ![Edit the deployment workflow file.](docs/media/edit-the-deploy-file.png) 85 | 86 | Provide a custom resource group name for the app, and then commit the change to a new branch named `deploy`. 87 | 88 | ![Create the deploy branch.](docs/media/deploy.png) 89 | 90 | Once you click the `Propose changes` button, you'll be in "create a pull request" mode. Don't worry about creating the pull request yet, just click on the `Actions` tab, and you'll see that the deployment CI/CD process has already started. 91 | 92 | ![Build started.](docs/media/deploy-started.png) 93 | 94 | When you click into the workflow, you'll see that there are 3 phases the CI/CD will run through: 95 | 96 | 1. provision - the Azure resources will be created that eventually house your app. 97 | 2. build - the various .NET projects are build into containers and published into the Azure Container Registry instance created during provision. 98 | 3. deploy - once `build` completes, the images are in ACR, so the Azure Container Apps are updated to host the newly-published container images. 99 | 100 | ![Deployment phases.](docs/media/cicd-phases.png) 101 | 102 | After a few minutes, all three steps in the workflow will be completed, and each box in the workflow diagram will reflect success. If anything fails, you can click into the individual process step to see the detailed log output. 103 | 104 | > Note: if you do see any failures or issues, please submit an Issue so we can update the sample. Likewise, if you have ideas that could make it better, feel free to submit a pull request. 105 | 106 | ![Deployment success.](docs/media/success.png) 107 | 108 | With the projects deployed to Azure, you can now test the app to make sure it works. 109 | 110 | ## Try the app in Azure 111 | 112 | The `deploy` CI/CD process creates a series of resources in your Azure subscription. These are used primarily for hosting the project code, but there's also a few additional resources that aid with monitoring and observing how the app is running in the deployed environment. 113 | | Resource | Resource Type | Purpose | 114 | | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 115 | | storeai | Application Insights | This provides telemetry and diagnostic information for when I want to monitor how the app is performing or for when things need troubleshooting. | 116 | | store | An Azure Container App that houses the code for the front end. | The store app is the store's frontend app, running a Blazor Server project that reaches out to the backend APIs | 117 | | products | An Azure Container App that houses the code for a minimal API. | This API is a Swagger UI-enabled API that hands back product names and IDs to callers. | 118 | | inventory | An Azure Container App that houses the code for a minimal API. | This API is a Swagger UI-enabled API that hands back quantities for product IDs. A client would need to call the `products` API first to get the product ID list, then use those product IDs as parameters to the `inventory` API to get the quantity of any particular item in inventory. | 119 | | storeenv | An Azure Container Apps Environment | This environment serves as the networking meta-container for all of the instances of all of the container apps comprising the app. | 120 | | storeacr | An Azure Container Registry | This is the container registry into which the CI/CD process publishes my application containers when I commit code to the `deploy` branch. From this registry, the containers are pulled and loaded into Azure Container Apps. | 121 | | storelogs | Log Analytics Workspace | This is where I can perform custom [Kusto](https://docs.microsoft.com/azure/data-explorer/kusto/query/) queries against the application telemetry, and time-sliced views of how the app is performing and scaling over time in the environment. | 122 | 123 | The resources are shown here in the Azure portal: 124 | 125 | ![Resources in the portal](docs/media/azure-portal.png) 126 | 127 | Click on the `store` container app to open it up in the Azure portal. In the `Overview` tab you'll see a URL. 128 | 129 | ![View the store's public URL.](docs/media/get-public-url.png) 130 | 131 | Clicking that URL will open the app's frontend up in the browser. 132 | 133 | ![The product list, once the app is running.](docs/media/store-ui.png) 134 | 135 | You'll see that the first request will take slightly longer than subsequent requests. On the first request to the page, the APIs are called on the server side. The code uses `IMemoryCache` to store the results of the API calls in memory. So, subsequent calls will use the cached payload rather than make live requests each time. 136 | -------------------------------------------------------------------------------- /azure.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json 2 | 3 | name: dotnet-frontend-to-multiple-api-backends 4 | metadata: 5 | template: dotnet-frontend-to-multiple-api-backends@2.0.0 6 | services: 7 | inventory: 8 | project: src/Store.InventoryApi 9 | dist: build 10 | language: csharp 11 | host: containerapp 12 | module: app/inventory 13 | docker: 14 | path: ./Dockerfile 15 | context: ../ 16 | products: 17 | project: src/Store.ProductApi 18 | dist: build 19 | language: csharp 20 | host: containerapp 21 | module: app/products 22 | docker: 23 | path: ./Dockerfile 24 | context: ../ 25 | store: 26 | project: src/Store 27 | dist: build 28 | language: csharp 29 | host: containerapp 30 | module: app/store 31 | docker: 32 | path: ./Dockerfile 33 | context: ../ -------------------------------------------------------------------------------- /docs/media/azure-portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/docs/media/azure-portal.png -------------------------------------------------------------------------------- /docs/media/cicd-phases.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/docs/media/cicd-phases.png -------------------------------------------------------------------------------- /docs/media/deploy-started.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/docs/media/deploy-started.png -------------------------------------------------------------------------------- /docs/media/deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/docs/media/deploy.png -------------------------------------------------------------------------------- /docs/media/edit-the-deploy-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/docs/media/edit-the-deploy-file.png -------------------------------------------------------------------------------- /docs/media/get-public-url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/docs/media/get-public-url.png -------------------------------------------------------------------------------- /docs/media/secrets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/docs/media/secrets.png -------------------------------------------------------------------------------- /docs/media/secrets2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/docs/media/secrets2.png -------------------------------------------------------------------------------- /docs/media/store-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/docs/media/store-ui.png -------------------------------------------------------------------------------- /docs/media/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/docs/media/success.png -------------------------------------------------------------------------------- /docs/media/topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/docs/media/topology.png -------------------------------------------------------------------------------- /infra/abbreviations.json: -------------------------------------------------------------------------------- 1 | { 2 | "analysisServicesServers": "as", 3 | "apiManagementService": "apim-", 4 | "appConfigurationConfigurationStores": "appcs-", 5 | "appManagedEnvironments": "cae-", 6 | "appContainerApps": "ca-", 7 | "authorizationPolicyDefinitions": "policy-", 8 | "automationAutomationAccounts": "aa-", 9 | "blueprintBlueprints": "bp-", 10 | "blueprintBlueprintsArtifacts": "bpa-", 11 | "cacheRedis": "redis-", 12 | "cdnProfiles": "cdnp-", 13 | "cdnProfilesEndpoints": "cdne-", 14 | "cognitiveServicesAccounts": "cog-", 15 | "cognitiveServicesFormRecognizer": "cog-fr-", 16 | "cognitiveServicesTextAnalytics": "cog-ta-", 17 | "computeAvailabilitySets": "avail-", 18 | "computeCloudServices": "cld-", 19 | "computeDiskEncryptionSets": "des", 20 | "computeDisks": "disk", 21 | "computeDisksOs": "osdisk", 22 | "computeGalleries": "gal", 23 | "computeSnapshots": "snap-", 24 | "computeVirtualMachines": "vm", 25 | "computeVirtualMachineScaleSets": "vmss-", 26 | "containerInstanceContainerGroups": "ci", 27 | "containerRegistryRegistries": "cr", 28 | "containerServiceManagedClusters": "aks-", 29 | "databricksWorkspaces": "dbw-", 30 | "dataFactoryFactories": "adf-", 31 | "dataLakeAnalyticsAccounts": "dla", 32 | "dataLakeStoreAccounts": "dls", 33 | "dataMigrationServices": "dms-", 34 | "dBforMySQLServers": "mysql-", 35 | "dBforPostgreSQLServers": "psql-", 36 | "devicesIotHubs": "iot-", 37 | "devicesProvisioningServices": "provs-", 38 | "devicesProvisioningServicesCertificates": "pcert-", 39 | "documentDBDatabaseAccounts": "cosmos-", 40 | "eventGridDomains": "evgd-", 41 | "eventGridDomainsTopics": "evgt-", 42 | "eventGridEventSubscriptions": "evgs-", 43 | "eventHubNamespaces": "evhns-", 44 | "eventHubNamespacesEventHubs": "evh-", 45 | "hdInsightClustersHadoop": "hadoop-", 46 | "hdInsightClustersHbase": "hbase-", 47 | "hdInsightClustersKafka": "kafka-", 48 | "hdInsightClustersMl": "mls-", 49 | "hdInsightClustersSpark": "spark-", 50 | "hdInsightClustersStorm": "storm-", 51 | "hybridComputeMachines": "arcs-", 52 | "insightsActionGroups": "ag-", 53 | "insightsComponents": "appi-", 54 | "keyVaultVaults": "kv-", 55 | "kubernetesConnectedClusters": "arck", 56 | "kustoClusters": "dec", 57 | "kustoClustersDatabases": "dedb", 58 | "logicIntegrationAccounts": "ia-", 59 | "logicWorkflows": "logic-", 60 | "machineLearningServicesWorkspaces": "mlw-", 61 | "managedIdentityUserAssignedIdentities": "id-", 62 | "managementManagementGroups": "mg-", 63 | "migrateAssessmentProjects": "migr-", 64 | "networkApplicationGateways": "agw-", 65 | "networkApplicationSecurityGroups": "asg-", 66 | "networkAzureFirewalls": "afw-", 67 | "networkBastionHosts": "bas-", 68 | "networkConnections": "con-", 69 | "networkDnsZones": "dnsz-", 70 | "networkExpressRouteCircuits": "erc-", 71 | "networkFirewallPolicies": "afwp-", 72 | "networkFirewallPoliciesWebApplication": "waf", 73 | "networkFirewallPoliciesRuleGroups": "wafrg", 74 | "networkFrontDoors": "fd-", 75 | "networkFrontdoorWebApplicationFirewallPolicies": "fdfp-", 76 | "networkLoadBalancersExternal": "lbe-", 77 | "networkLoadBalancersInternal": "lbi-", 78 | "networkLoadBalancersInboundNatRules": "rule-", 79 | "networkLocalNetworkGateways": "lgw-", 80 | "networkNatGateways": "ng-", 81 | "networkNetworkInterfaces": "nic-", 82 | "networkNetworkSecurityGroups": "nsg-", 83 | "networkNetworkSecurityGroupsSecurityRules": "nsgsr-", 84 | "networkNetworkWatchers": "nw-", 85 | "networkPrivateDnsZones": "pdnsz-", 86 | "networkPrivateLinkServices": "pl-", 87 | "networkPublicIPAddresses": "pip-", 88 | "networkPublicIPPrefixes": "ippre-", 89 | "networkRouteFilters": "rf-", 90 | "networkRouteTables": "rt-", 91 | "networkRouteTablesRoutes": "udr-", 92 | "networkTrafficManagerProfiles": "traf-", 93 | "networkVirtualNetworkGateways": "vgw-", 94 | "networkVirtualNetworks": "vnet-", 95 | "networkVirtualNetworksSubnets": "snet-", 96 | "networkVirtualNetworksVirtualNetworkPeerings": "peer-", 97 | "networkVirtualWans": "vwan-", 98 | "networkVpnGateways": "vpng-", 99 | "networkVpnGatewaysVpnConnections": "vcn-", 100 | "networkVpnGatewaysVpnSites": "vst-", 101 | "notificationHubsNamespaces": "ntfns-", 102 | "notificationHubsNamespacesNotificationHubs": "ntf-", 103 | "operationalInsightsWorkspaces": "log-", 104 | "portalDashboards": "dash-", 105 | "powerBIDedicatedCapacities": "pbi-", 106 | "purviewAccounts": "pview-", 107 | "recoveryServicesVaults": "rsv-", 108 | "resourcesResourceGroups": "rg-", 109 | "searchSearchServices": "srch-", 110 | "serviceBusNamespaces": "sb-", 111 | "serviceBusNamespacesQueues": "sbq-", 112 | "serviceBusNamespacesTopics": "sbt-", 113 | "serviceEndPointPolicies": "se-", 114 | "serviceFabricClusters": "sf-", 115 | "signalRServiceSignalR": "sigr", 116 | "sqlManagedInstances": "sqlmi-", 117 | "sqlServers": "sql-", 118 | "sqlServersDataWarehouse": "sqldw-", 119 | "sqlServersDatabases": "sqldb-", 120 | "sqlServersDatabasesStretch": "sqlstrdb-", 121 | "storageStorageAccounts": "st", 122 | "storageStorageAccountsVm": "stvm", 123 | "storSimpleManagers": "ssimp", 124 | "streamAnalyticsCluster": "asa-", 125 | "synapseWorkspaces": "syn", 126 | "synapseWorkspacesAnalyticsWorkspaces": "synw", 127 | "synapseWorkspacesSqlPoolsDedicated": "syndp", 128 | "synapseWorkspacesSqlPoolsSpark": "synsp", 129 | "timeSeriesInsightsEnvironments": "tsi-", 130 | "webServerFarms": "plan-", 131 | "webSitesAppService": "app-", 132 | "webSitesAppServiceEnvironment": "ase-", 133 | "webSitesFunctions": "func-", 134 | "webStaticSites": "stapp-" 135 | } -------------------------------------------------------------------------------- /infra/app/inventory.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | param identityName string 5 | param containerAppsEnvironmentName string 6 | param containerRegistryName string 7 | param exists bool 8 | param aiConnectionString string 9 | param serviceName string = 'inventory' 10 | 11 | resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { 12 | name: identityName 13 | location: location 14 | } 15 | 16 | module app '../core/host/container-app-upsert.bicep' = { 17 | name: '${serviceName}-container-app' 18 | params: { 19 | name: name 20 | location: location 21 | tags: union(tags, { 'azd-service-name': serviceName }) 22 | identityType: 'UserAssigned' 23 | identityName: identityName 24 | exists: exists 25 | containerAppsEnvironmentName: containerAppsEnvironmentName 26 | containerRegistryName: containerRegistryName 27 | external: false 28 | ingressEnabled: true 29 | env: [ 30 | { 31 | name: 'ASPNETCORE_ENVIRONMENT' 32 | value: 'Development' 33 | } 34 | { 35 | name: 'APPLICATIONINSIGHTS_CONNECTION_STRING' 36 | value: aiConnectionString 37 | } 38 | { 39 | name: 'ASPNETCORE_LOGGING__CONSOLE__DISABLECOLORS' 40 | value: 'true' 41 | } 42 | ] 43 | targetPort: 80 44 | } 45 | } 46 | 47 | output SERVICE_INVENTORY_IDENTITY_PRINCIPAL_ID string = identity.properties.principalId 48 | output SERVICE_INVENTORY_NAME string = app.outputs.name 49 | output SERVICE_INVENTORY_URI string = app.outputs.uri 50 | output SERVICE_INVENTORY_IMAGE_NAME string = app.outputs.imageName 51 | -------------------------------------------------------------------------------- /infra/app/products.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | param identityName string 5 | param containerAppsEnvironmentName string 6 | param containerRegistryName string 7 | param exists bool 8 | param aiConnectionString string 9 | param serviceName string = 'products' 10 | 11 | resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { 12 | name: identityName 13 | location: location 14 | } 15 | 16 | module app '../core/host/container-app-upsert.bicep' = { 17 | name: '${serviceName}-container-app' 18 | params: { 19 | name: name 20 | location: location 21 | tags: union(tags, { 'azd-service-name': serviceName }) 22 | identityType: 'UserAssigned' 23 | identityName: identityName 24 | exists: exists 25 | containerAppsEnvironmentName: containerAppsEnvironmentName 26 | containerRegistryName: containerRegistryName 27 | external: false 28 | ingressEnabled: true 29 | env: [ 30 | { 31 | name: 'ASPNETCORE_ENVIRONMENT' 32 | value: 'Development' 33 | } 34 | { 35 | name: 'APPLICATIONINSIGHTS_CONNECTION_STRING' 36 | value: aiConnectionString 37 | } 38 | { 39 | name: 'ASPNETCORE_LOGGING__CONSOLE__DISABLECOLORS' 40 | value: 'true' 41 | } 42 | ] 43 | targetPort: 80 44 | } 45 | } 46 | 47 | output SERVICE_PRODUCTS_IDENTITY_PRINCIPAL_ID string = identity.properties.principalId 48 | output SERVICE_PRODUCTS_NAME string = app.outputs.name 49 | output SERVICE_PRODUCTS_URI string = app.outputs.uri 50 | output SERVICE_PRODUCTS_IMAGE_NAME string = app.outputs.imageName 51 | -------------------------------------------------------------------------------- /infra/app/store.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | param identityName string 5 | param containerAppsEnvironmentName string 6 | param containerRegistryName string 7 | param exists bool 8 | param aiConnectionString string 9 | param serviceName string = 'store' 10 | param inventoryServiceName string = 'inventory' 11 | param productsServiceName string = 'products' 12 | 13 | resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { 14 | name: identityName 15 | location: location 16 | } 17 | 18 | module app '../core/host/container-app-upsert.bicep' = { 19 | name: '${serviceName}-container-app' 20 | params: { 21 | name: name 22 | location: location 23 | tags: union(tags, { 'azd-service-name': serviceName }) 24 | identityType: 'UserAssigned' 25 | identityName: identityName 26 | exists: exists 27 | containerAppsEnvironmentName: containerAppsEnvironmentName 28 | containerRegistryName: containerRegistryName 29 | containerMaxReplicas: 1 30 | containerMinReplicas: 1 31 | env: [ 32 | { 33 | name: 'ASPNETCORE_ENVIRONMENT' 34 | value: 'Development' 35 | } 36 | { 37 | name: 'APPLICATIONINSIGHTS_CONNECTION_STRING' 38 | value: aiConnectionString 39 | } 40 | { 41 | name: 'ASPNETCORE_LOGGING__CONSOLE__DISABLECOLORS' 42 | value: 'true' 43 | } 44 | { 45 | name: 'InventoryApi' 46 | value: 'http://${inventoryServiceName}' 47 | } 48 | { 49 | name: 'ProductsApi' 50 | value: 'http://${productsServiceName}' 51 | } 52 | ] 53 | targetPort: 80 54 | } 55 | } 56 | 57 | output SERVICE_STORE_IDENTITY_PRINCIPAL_ID string = identity.properties.principalId 58 | output SERVICE_STORE_NAME string = app.outputs.name 59 | output SERVICE_STORE_URI string = app.outputs.uri 60 | output SERVICE_STORE_IMAGE_NAME string = app.outputs.imageName 61 | -------------------------------------------------------------------------------- /infra/core/ai/cognitiveservices.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | @description('The custom subdomain name used to access the API. Defaults to the value of the name parameter.') 5 | param customSubDomainName string = name 6 | param deployments array = [] 7 | param kind string = 'OpenAI' 8 | param publicNetworkAccess string = 'Enabled' 9 | param sku object = { 10 | name: 'S0' 11 | } 12 | 13 | resource account 'Microsoft.CognitiveServices/accounts@2022-10-01' = { 14 | name: name 15 | location: location 16 | tags: tags 17 | kind: kind 18 | properties: { 19 | customSubDomainName: customSubDomainName 20 | publicNetworkAccess: publicNetworkAccess 21 | } 22 | sku: sku 23 | } 24 | 25 | @batchSize(1) 26 | resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2022-10-01' = [for deployment in deployments: { 27 | parent: account 28 | name: deployment.name 29 | properties: { 30 | model: deployment.model 31 | raiPolicyName: contains(deployment, 'raiPolicyName') ? deployment.raiPolicyName : null 32 | scaleSettings: deployment.scaleSettings 33 | } 34 | }] 35 | 36 | output endpoint string = account.properties.endpoint 37 | output id string = account.id 38 | output name string = account.name 39 | -------------------------------------------------------------------------------- /infra/core/database/cosmos/cosmos-account.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param connectionStringKey string = 'AZURE-COSMOS-CONNECTION-STRING' 6 | param keyVaultName string 7 | 8 | @allowed([ 'GlobalDocumentDB', 'MongoDB', 'Parse' ]) 9 | param kind string 10 | 11 | resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' = { 12 | name: name 13 | kind: kind 14 | location: location 15 | tags: tags 16 | properties: { 17 | consistencyPolicy: { defaultConsistencyLevel: 'Session' } 18 | locations: [ 19 | { 20 | locationName: location 21 | failoverPriority: 0 22 | isZoneRedundant: false 23 | } 24 | ] 25 | databaseAccountOfferType: 'Standard' 26 | enableAutomaticFailover: false 27 | enableMultipleWriteLocations: false 28 | apiProperties: (kind == 'MongoDB') ? { serverVersion: '4.0' } : {} 29 | capabilities: [ { name: 'EnableServerless' } ] 30 | } 31 | } 32 | 33 | resource cosmosConnectionString 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = { 34 | parent: keyVault 35 | name: connectionStringKey 36 | properties: { 37 | value: cosmos.listConnectionStrings().connectionStrings[0].connectionString 38 | } 39 | } 40 | 41 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { 42 | name: keyVaultName 43 | } 44 | 45 | output connectionStringKey string = connectionStringKey 46 | output endpoint string = cosmos.properties.documentEndpoint 47 | output id string = cosmos.id 48 | output name string = cosmos.name 49 | -------------------------------------------------------------------------------- /infra/core/database/cosmos/mongo/cosmos-mongo-account.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param keyVaultName string 6 | param connectionStringKey string = 'AZURE-COSMOS-CONNECTION-STRING' 7 | 8 | module cosmos '../../cosmos/cosmos-account.bicep' = { 9 | name: 'cosmos-account' 10 | params: { 11 | name: name 12 | location: location 13 | connectionStringKey: connectionStringKey 14 | keyVaultName: keyVaultName 15 | kind: 'MongoDB' 16 | tags: tags 17 | } 18 | } 19 | 20 | output connectionStringKey string = cosmos.outputs.connectionStringKey 21 | output endpoint string = cosmos.outputs.endpoint 22 | output id string = cosmos.outputs.id 23 | -------------------------------------------------------------------------------- /infra/core/database/cosmos/mongo/cosmos-mongo-db.bicep: -------------------------------------------------------------------------------- 1 | param accountName string 2 | param databaseName string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param collections array = [] 7 | param connectionStringKey string = 'AZURE-COSMOS-CONNECTION-STRING' 8 | param keyVaultName string 9 | 10 | module cosmos 'cosmos-mongo-account.bicep' = { 11 | name: 'cosmos-mongo-account' 12 | params: { 13 | name: accountName 14 | location: location 15 | keyVaultName: keyVaultName 16 | tags: tags 17 | connectionStringKey: connectionStringKey 18 | } 19 | } 20 | 21 | resource database 'Microsoft.DocumentDB/databaseAccounts/mongodbDatabases@2022-08-15' = { 22 | name: '${accountName}/${databaseName}' 23 | tags: tags 24 | properties: { 25 | resource: { id: databaseName } 26 | } 27 | 28 | resource list 'collections' = [for collection in collections: { 29 | name: collection.name 30 | properties: { 31 | resource: { 32 | id: collection.id 33 | shardKey: { _id: collection.shardKey } 34 | indexes: [ { key: { keys: [ collection.indexKey ] } } ] 35 | } 36 | } 37 | }] 38 | 39 | dependsOn: [ 40 | cosmos 41 | ] 42 | } 43 | 44 | output connectionStringKey string = connectionStringKey 45 | output databaseName string = databaseName 46 | output endpoint string = cosmos.outputs.endpoint 47 | -------------------------------------------------------------------------------- /infra/core/database/cosmos/sql/cosmos-sql-account.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param keyVaultName string 6 | 7 | module cosmos '../../cosmos/cosmos-account.bicep' = { 8 | name: 'cosmos-account' 9 | params: { 10 | name: name 11 | location: location 12 | tags: tags 13 | keyVaultName: keyVaultName 14 | kind: 'GlobalDocumentDB' 15 | } 16 | } 17 | 18 | output connectionStringKey string = cosmos.outputs.connectionStringKey 19 | output endpoint string = cosmos.outputs.endpoint 20 | output id string = cosmos.outputs.id 21 | output name string = cosmos.outputs.name 22 | -------------------------------------------------------------------------------- /infra/core/database/cosmos/sql/cosmos-sql-db.bicep: -------------------------------------------------------------------------------- 1 | param accountName string 2 | param databaseName string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param containers array = [] 7 | param keyVaultName string 8 | param principalIds array = [] 9 | 10 | module cosmos 'cosmos-sql-account.bicep' = { 11 | name: 'cosmos-sql-account' 12 | params: { 13 | name: accountName 14 | location: location 15 | tags: tags 16 | keyVaultName: keyVaultName 17 | } 18 | } 19 | 20 | resource database 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2022-05-15' = { 21 | name: '${accountName}/${databaseName}' 22 | properties: { 23 | resource: { id: databaseName } 24 | } 25 | 26 | resource list 'containers' = [for container in containers: { 27 | name: container.name 28 | properties: { 29 | resource: { 30 | id: container.id 31 | partitionKey: { paths: [ container.partitionKey ] } 32 | } 33 | options: {} 34 | } 35 | }] 36 | 37 | dependsOn: [ 38 | cosmos 39 | ] 40 | } 41 | 42 | module roleDefintion 'cosmos-sql-role-def.bicep' = { 43 | name: 'cosmos-sql-role-definition' 44 | params: { 45 | accountName: accountName 46 | } 47 | dependsOn: [ 48 | cosmos 49 | database 50 | ] 51 | } 52 | 53 | // We need batchSize(1) here because sql role assignments have to be done sequentially 54 | @batchSize(1) 55 | module userRole 'cosmos-sql-role-assign.bicep' = [for principalId in principalIds: if (!empty(principalId)) { 56 | name: 'cosmos-sql-user-role-${uniqueString(principalId)}' 57 | params: { 58 | accountName: accountName 59 | roleDefinitionId: roleDefintion.outputs.id 60 | principalId: principalId 61 | } 62 | dependsOn: [ 63 | cosmos 64 | database 65 | ] 66 | }] 67 | 68 | output accountId string = cosmos.outputs.id 69 | output accountName string = cosmos.outputs.name 70 | output connectionStringKey string = cosmos.outputs.connectionStringKey 71 | output databaseName string = databaseName 72 | output endpoint string = cosmos.outputs.endpoint 73 | output roleDefinitionId string = roleDefintion.outputs.id 74 | -------------------------------------------------------------------------------- /infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicep: -------------------------------------------------------------------------------- 1 | param accountName string 2 | 3 | param roleDefinitionId string 4 | param principalId string = '' 5 | 6 | resource role 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { 7 | parent: cosmos 8 | name: guid(roleDefinitionId, principalId, cosmos.id) 9 | properties: { 10 | principalId: principalId 11 | roleDefinitionId: roleDefinitionId 12 | scope: cosmos.id 13 | } 14 | } 15 | 16 | resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { 17 | name: accountName 18 | } 19 | -------------------------------------------------------------------------------- /infra/core/database/cosmos/sql/cosmos-sql-role-def.bicep: -------------------------------------------------------------------------------- 1 | param accountName string 2 | 3 | resource roleDefinition 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions@2022-08-15' = { 4 | parent: cosmos 5 | name: guid(cosmos.id, accountName, 'sql-role') 6 | properties: { 7 | assignableScopes: [ 8 | cosmos.id 9 | ] 10 | permissions: [ 11 | { 12 | dataActions: [ 13 | 'Microsoft.DocumentDB/databaseAccounts/readMetadata' 14 | 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/*' 15 | 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/*' 16 | ] 17 | notDataActions: [] 18 | } 19 | ] 20 | roleName: 'Reader Writer' 21 | type: 'CustomRole' 22 | } 23 | } 24 | 25 | resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { 26 | name: accountName 27 | } 28 | 29 | output id string = roleDefinition.id 30 | -------------------------------------------------------------------------------- /infra/core/database/postgresql/flexibleserver.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param sku object 6 | param storage object 7 | param administratorLogin string 8 | @secure() 9 | param administratorLoginPassword string 10 | param databaseNames array = [] 11 | param allowAzureIPsFirewall bool = false 12 | param allowAllIPsFirewall bool = false 13 | param allowedSingleIPs array = [] 14 | 15 | // PostgreSQL version 16 | param version string 17 | 18 | // Latest official version 2022-12-01 does not have Bicep types available 19 | resource postgresServer 'Microsoft.DBforPostgreSQL/flexibleServers@2022-12-01' = { 20 | location: location 21 | tags: tags 22 | name: name 23 | sku: sku 24 | properties: { 25 | version: version 26 | administratorLogin: administratorLogin 27 | administratorLoginPassword: administratorLoginPassword 28 | storage: storage 29 | highAvailability: { 30 | mode: 'Disabled' 31 | } 32 | } 33 | 34 | resource database 'databases' = [for name in databaseNames: { 35 | name: name 36 | }] 37 | 38 | resource firewall_all 'firewallRules' = if (allowAllIPsFirewall) { 39 | name: 'allow-all-IPs' 40 | properties: { 41 | startIpAddress: '0.0.0.0' 42 | endIpAddress: '255.255.255.255' 43 | } 44 | } 45 | 46 | resource firewall_azure 'firewallRules' = if (allowAzureIPsFirewall) { 47 | name: 'allow-all-azure-internal-IPs' 48 | properties: { 49 | startIpAddress: '0.0.0.0' 50 | endIpAddress: '0.0.0.0' 51 | } 52 | } 53 | 54 | resource firewall_single 'firewallRules' = [for ip in allowedSingleIPs: { 55 | name: 'allow-single-${replace(ip, '.', '')}' 56 | properties: { 57 | startIpAddress: ip 58 | endIpAddress: ip 59 | } 60 | }] 61 | 62 | } 63 | 64 | output POSTGRES_DOMAIN_NAME string = postgresServer.properties.fullyQualifiedDomainName 65 | -------------------------------------------------------------------------------- /infra/core/database/sqlserver/sqlserver.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param appUser string = 'appUser' 6 | param databaseName string 7 | param keyVaultName string 8 | param sqlAdmin string = 'sqlAdmin' 9 | param connectionStringKey string = 'AZURE-SQL-CONNECTION-STRING' 10 | 11 | @secure() 12 | param sqlAdminPassword string 13 | @secure() 14 | param appUserPassword string 15 | 16 | resource sqlServer 'Microsoft.Sql/servers@2022-05-01-preview' = { 17 | name: name 18 | location: location 19 | tags: tags 20 | properties: { 21 | version: '12.0' 22 | minimalTlsVersion: '1.2' 23 | publicNetworkAccess: 'Enabled' 24 | administratorLogin: sqlAdmin 25 | administratorLoginPassword: sqlAdminPassword 26 | } 27 | 28 | resource database 'databases' = { 29 | name: databaseName 30 | location: location 31 | } 32 | 33 | resource firewall 'firewallRules' = { 34 | name: 'Azure Services' 35 | properties: { 36 | // Allow all clients 37 | // Note: range [0.0.0.0-0.0.0.0] means "allow all Azure-hosted clients only". 38 | // This is not sufficient, because we also want to allow direct access from developer machine, for debugging purposes. 39 | startIpAddress: '0.0.0.1' 40 | endIpAddress: '255.255.255.254' 41 | } 42 | } 43 | } 44 | 45 | resource sqlDeploymentScript 'Microsoft.Resources/deploymentScripts@2020-10-01' = { 46 | name: '${name}-deployment-script' 47 | location: location 48 | kind: 'AzureCLI' 49 | properties: { 50 | azCliVersion: '2.37.0' 51 | retentionInterval: 'PT1H' // Retain the script resource for 1 hour after it ends running 52 | timeout: 'PT5M' // Five minutes 53 | cleanupPreference: 'OnSuccess' 54 | environmentVariables: [ 55 | { 56 | name: 'APPUSERNAME' 57 | value: appUser 58 | } 59 | { 60 | name: 'APPUSERPASSWORD' 61 | secureValue: appUserPassword 62 | } 63 | { 64 | name: 'DBNAME' 65 | value: databaseName 66 | } 67 | { 68 | name: 'DBSERVER' 69 | value: sqlServer.properties.fullyQualifiedDomainName 70 | } 71 | { 72 | name: 'SQLCMDPASSWORD' 73 | secureValue: sqlAdminPassword 74 | } 75 | { 76 | name: 'SQLADMIN' 77 | value: sqlAdmin 78 | } 79 | ] 80 | 81 | scriptContent: ''' 82 | wget https://github.com/microsoft/go-sqlcmd/releases/download/v0.8.1/sqlcmd-v0.8.1-linux-x64.tar.bz2 83 | tar x -f sqlcmd-v0.8.1-linux-x64.tar.bz2 -C . 84 | 85 | cat < ./initDb.sql 86 | drop user ${APPUSERNAME} 87 | go 88 | create user ${APPUSERNAME} with password = '${APPUSERPASSWORD}' 89 | go 90 | alter role db_owner add member ${APPUSERNAME} 91 | go 92 | SCRIPT_END 93 | 94 | ./sqlcmd -S ${DBSERVER} -d ${DBNAME} -U ${SQLADMIN} -i ./initDb.sql 95 | ''' 96 | } 97 | } 98 | 99 | resource sqlAdminPasswordSecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = { 100 | parent: keyVault 101 | name: 'sqlAdminPassword' 102 | properties: { 103 | value: sqlAdminPassword 104 | } 105 | } 106 | 107 | resource appUserPasswordSecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = { 108 | parent: keyVault 109 | name: 'appUserPassword' 110 | properties: { 111 | value: appUserPassword 112 | } 113 | } 114 | 115 | resource sqlAzureConnectionStringSercret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = { 116 | parent: keyVault 117 | name: connectionStringKey 118 | properties: { 119 | value: '${connectionString}; Password=${appUserPassword}' 120 | } 121 | } 122 | 123 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { 124 | name: keyVaultName 125 | } 126 | 127 | var connectionString = 'Server=${sqlServer.properties.fullyQualifiedDomainName}; Database=${sqlServer::database.name}; User=${appUser}' 128 | output connectionStringKey string = connectionStringKey 129 | output databaseName string = sqlServer::database.name 130 | -------------------------------------------------------------------------------- /infra/core/gateway/apim.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | @description('The email address of the owner of the service') 6 | @minLength(1) 7 | param publisherEmail string = 'noreply@microsoft.com' 8 | 9 | @description('The name of the owner of the service') 10 | @minLength(1) 11 | param publisherName string = 'n/a' 12 | 13 | @description('The pricing tier of this API Management service') 14 | @allowed([ 15 | 'Consumption' 16 | 'Developer' 17 | 'Standard' 18 | 'Premium' 19 | ]) 20 | param sku string = 'Consumption' 21 | 22 | @description('The instance size of this API Management service.') 23 | @allowed([ 0, 1, 2 ]) 24 | param skuCount int = 0 25 | 26 | @description('Azure Application Insights Name') 27 | param applicationInsightsName string 28 | 29 | resource apimService 'Microsoft.ApiManagement/service@2021-08-01' = { 30 | name: name 31 | location: location 32 | tags: union(tags, { 'azd-service-name': name }) 33 | sku: { 34 | name: sku 35 | capacity: (sku == 'Consumption') ? 0 : ((sku == 'Developer') ? 1 : skuCount) 36 | } 37 | properties: { 38 | publisherEmail: publisherEmail 39 | publisherName: publisherName 40 | // Custom properties are not supported for Consumption SKU 41 | customProperties: sku == 'Consumption' ? {} : { 42 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA': 'false' 43 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA': 'false' 44 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_GCM_SHA256': 'false' 45 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_256_CBC_SHA256': 'false' 46 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256': 'false' 47 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_256_CBC_SHA': 'false' 48 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA': 'false' 49 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168': 'false' 50 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10': 'false' 51 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11': 'false' 52 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30': 'false' 53 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10': 'false' 54 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11': 'false' 55 | 'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30': 'false' 56 | } 57 | } 58 | } 59 | 60 | resource apimLogger 'Microsoft.ApiManagement/service/loggers@2021-12-01-preview' = if (!empty(applicationInsightsName)) { 61 | name: 'app-insights-logger' 62 | parent: apimService 63 | properties: { 64 | credentials: { 65 | instrumentationKey: applicationInsights.properties.InstrumentationKey 66 | } 67 | description: 'Logger to Azure Application Insights' 68 | isBuffered: false 69 | loggerType: 'applicationInsights' 70 | resourceId: applicationInsights.id 71 | } 72 | } 73 | 74 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = if (!empty(applicationInsightsName)) { 75 | name: applicationInsightsName 76 | } 77 | 78 | output apimServiceName string = apimService.name 79 | -------------------------------------------------------------------------------- /infra/core/host/aks-agent-pool.bicep: -------------------------------------------------------------------------------- 1 | param clusterName string 2 | 3 | @description('The agent pool name') 4 | param name string 5 | 6 | @description('The agent pool configuration') 7 | param config object 8 | 9 | resource aksCluster 'Microsoft.ContainerService/managedClusters@2023-03-02-preview' existing = { 10 | name: clusterName 11 | } 12 | 13 | resource nodePool 'Microsoft.ContainerService/managedClusters/agentPools@2023-03-02-preview' = { 14 | parent: aksCluster 15 | name: name 16 | properties: config 17 | } 18 | -------------------------------------------------------------------------------- /infra/core/host/aks-managed-cluster.bicep: -------------------------------------------------------------------------------- 1 | @description('The name for the AKS managed cluster') 2 | param name string 3 | 4 | @description('The name of the resource group for the managed resources of the AKS cluster') 5 | param nodeResourceGroupName string = '' 6 | 7 | @description('The Azure region/location for the AKS resources') 8 | param location string = resourceGroup().location 9 | 10 | @description('Custom tags to apply to the AKS resources') 11 | param tags object = {} 12 | 13 | @description('Kubernetes Version') 14 | param kubernetesVersion string = '1.25.5' 15 | 16 | @description('Whether RBAC is enabled for local accounts') 17 | param enableRbac bool = true 18 | 19 | // Add-ons 20 | @description('Whether web app routing (preview) add-on is enabled') 21 | param webAppRoutingAddon bool = true 22 | 23 | // AAD Integration 24 | @description('Enable Azure Active Directory integration') 25 | param enableAad bool = false 26 | 27 | @description('Enable RBAC using AAD') 28 | param enableAzureRbac bool = false 29 | 30 | @description('The Tenant ID associated to the Azure Active Directory') 31 | param aadTenantId string = '' 32 | 33 | @description('The load balancer SKU to use for ingress into the AKS cluster') 34 | @allowed([ 'basic', 'standard' ]) 35 | param loadBalancerSku string = 'standard' 36 | 37 | @description('Network plugin used for building the Kubernetes network.') 38 | @allowed([ 'azure', 'kubenet', 'none' ]) 39 | param networkPlugin string = 'azure' 40 | 41 | @description('Network policy used for building the Kubernetes network.') 42 | @allowed([ 'azure', 'calico' ]) 43 | param networkPolicy string = 'azure' 44 | 45 | @description('If set to true, getting static credentials will be disabled for this cluster.') 46 | param disableLocalAccounts bool = false 47 | 48 | @description('The managed cluster SKU.') 49 | @allowed([ 'Free', 'Paid', 'Standard' ]) 50 | param sku string = 'Free' 51 | 52 | @description('Configuration of AKS add-ons') 53 | param addOns object = {} 54 | 55 | @description('The log analytics workspace id used for logging & monitoring') 56 | param workspaceId string = '' 57 | 58 | @description('The node pool configuration for the System agent pool') 59 | param systemPoolConfig object 60 | 61 | @description('The DNS prefix to associate with the AKS cluster') 62 | param dnsPrefix string = '' 63 | 64 | resource aks 'Microsoft.ContainerService/managedClusters@2023-03-02-preview' = { 65 | name: name 66 | location: location 67 | tags: tags 68 | identity: { 69 | type: 'SystemAssigned' 70 | } 71 | sku: { 72 | name: 'Base' 73 | tier: sku 74 | } 75 | properties: { 76 | nodeResourceGroup: !empty(nodeResourceGroupName) ? nodeResourceGroupName : 'rg-mc-${name}' 77 | kubernetesVersion: kubernetesVersion 78 | dnsPrefix: empty(dnsPrefix) ? '${name}-dns' : dnsPrefix 79 | enableRBAC: enableRbac 80 | aadProfile: enableAad ? { 81 | managed: true 82 | enableAzureRBAC: enableAzureRbac 83 | tenantID: aadTenantId 84 | } : null 85 | agentPoolProfiles: [ 86 | systemPoolConfig 87 | ] 88 | networkProfile: { 89 | loadBalancerSku: loadBalancerSku 90 | networkPlugin: networkPlugin 91 | networkPolicy: networkPolicy 92 | } 93 | disableLocalAccounts: disableLocalAccounts && enableAad 94 | addonProfiles: addOns 95 | ingressProfile: { 96 | webAppRouting: { 97 | enabled: webAppRoutingAddon 98 | } 99 | } 100 | } 101 | } 102 | 103 | var aksDiagCategories = [ 104 | 'cluster-autoscaler' 105 | 'kube-controller-manager' 106 | 'kube-audit-admin' 107 | 'guard' 108 | ] 109 | 110 | // TODO: Update diagnostics to be its own module 111 | // Blocking issue: https://github.com/Azure/bicep/issues/622 112 | // Unable to pass in a `resource` scope or unable to use string interpolation in resource types 113 | resource diagnostics 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (!empty(workspaceId)) { 114 | name: 'aks-diagnostics' 115 | scope: aks 116 | properties: { 117 | workspaceId: workspaceId 118 | logs: [for category in aksDiagCategories: { 119 | category: category 120 | enabled: true 121 | }] 122 | metrics: [ 123 | { 124 | category: 'AllMetrics' 125 | enabled: true 126 | } 127 | ] 128 | } 129 | } 130 | 131 | @description('The resource name of the AKS cluster') 132 | output clusterName string = aks.name 133 | 134 | @description('The AKS cluster identity') 135 | output clusterIdentity object = { 136 | clientId: aks.properties.identityProfile.kubeletidentity.clientId 137 | objectId: aks.properties.identityProfile.kubeletidentity.objectId 138 | resourceId: aks.properties.identityProfile.kubeletidentity.resourceId 139 | } 140 | -------------------------------------------------------------------------------- /infra/core/host/aks.bicep: -------------------------------------------------------------------------------- 1 | @description('The name for the AKS managed cluster') 2 | param name string 3 | 4 | @description('The name for the Azure container registry (ACR)') 5 | param containerRegistryName string 6 | 7 | @description('The name of the connected log analytics workspace') 8 | param logAnalyticsName string = '' 9 | 10 | @description('The name of the keyvault to grant access') 11 | param keyVaultName string 12 | 13 | @description('The Azure region/location for the AKS resources') 14 | param location string = resourceGroup().location 15 | 16 | @description('Custom tags to apply to the AKS resources') 17 | param tags object = {} 18 | 19 | @description('AKS add-ons configuration') 20 | param addOns object = { 21 | azurePolicy: { 22 | enabled: true 23 | config: { 24 | version: 'v2' 25 | } 26 | } 27 | keyVault: { 28 | enabled: true 29 | config: { 30 | enableSecretRotation: 'true' 31 | rotationPollInterval: '2m' 32 | } 33 | } 34 | openServiceMesh: { 35 | enabled: false 36 | config: {} 37 | } 38 | omsAgent: { 39 | enabled: true 40 | config: {} 41 | } 42 | applicationGateway: { 43 | enabled: false 44 | config: {} 45 | } 46 | } 47 | 48 | @allowed([ 49 | 'CostOptimised' 50 | 'Standard' 51 | 'HighSpec' 52 | 'Custom' 53 | ]) 54 | @description('The System Pool Preset sizing') 55 | param systemPoolType string = 'CostOptimised' 56 | 57 | @allowed([ 58 | '' 59 | 'CostOptimised' 60 | 'Standard' 61 | 'HighSpec' 62 | 'Custom' 63 | ]) 64 | @description('The User Pool Preset sizing') 65 | param agentPoolType string = '' 66 | 67 | // Configure system / user agent pools 68 | @description('Custom configuration of system node pool') 69 | param systemPoolConfig object = {} 70 | @description('Custom configuration of user node pool') 71 | param agentPoolConfig object = {} 72 | 73 | // Configure AKS add-ons 74 | var omsAgentConfig = (!empty(logAnalyticsName) && !empty(addOns.omsAgent) && addOns.omsAgent.enabled) ? union( 75 | addOns.omsAgent, 76 | { 77 | config: { 78 | logAnalyticsWorkspaceResourceID: logAnalytics.id 79 | } 80 | } 81 | ) : {} 82 | 83 | var addOnsConfig = union( 84 | (!empty(addOns.azurePolicy) && addOns.azurePolicy.enabled) ? { azurepolicy: addOns.azurePolicy } : {}, 85 | (!empty(addOns.keyVault) && addOns.keyVault.enabled) ? { azureKeyvaultSecretsProvider: addOns.keyVault } : {}, 86 | (!empty(addOns.openServiceMesh) && addOns.openServiceMesh.enabled) ? { openServiceMesh: addOns.openServiceMesh } : {}, 87 | (!empty(addOns.omsAgent) && addOns.omsAgent.enabled) ? { omsagent: omsAgentConfig } : {}, 88 | (!empty(addOns.applicationGateway) && addOns.applicationGateway.enabled) ? { ingressApplicationGateway: addOns.applicationGateway } : {} 89 | ) 90 | 91 | // Link to existing log analytics workspace when available 92 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' existing = if (!empty(logAnalyticsName)) { 93 | name: logAnalyticsName 94 | } 95 | 96 | var systemPoolSpec = !empty(systemPoolConfig) ? systemPoolConfig : nodePoolPresets[systemPoolType] 97 | 98 | // Create the primary AKS cluster resources and system node pool 99 | module managedCluster 'aks-managed-cluster.bicep' = { 100 | name: 'managed-cluster' 101 | params: { 102 | name: name 103 | location: location 104 | tags: tags 105 | systemPoolConfig: union( 106 | { name: 'npsystem', mode: 'System' }, 107 | nodePoolBase, 108 | systemPoolSpec 109 | ) 110 | addOns: addOnsConfig 111 | workspaceId: !empty(logAnalyticsName) ? logAnalytics.id : '' 112 | } 113 | } 114 | 115 | var hasAgentPool = !empty(agentPoolConfig) || !empty(agentPoolType) 116 | var agentPoolSpec = hasAgentPool && !empty(agentPoolConfig) ? agentPoolConfig : empty(agentPoolType) ? {} : nodePoolPresets[agentPoolType] 117 | 118 | // Create additional user agent pool when specified 119 | module agentPool 'aks-agent-pool.bicep' = if (hasAgentPool) { 120 | name: 'aks-node-pool' 121 | params: { 122 | clusterName: managedCluster.outputs.clusterName 123 | name: 'npuserpool' 124 | config: union({ name: 'npuser', mode: 'User' }, nodePoolBase, agentPoolSpec) 125 | } 126 | } 127 | 128 | // Creates container registry (ACR) 129 | module containerRegistry 'container-registry.bicep' = { 130 | name: 'container-registry' 131 | params: { 132 | name: containerRegistryName 133 | location: location 134 | tags: tags 135 | workspaceId: !empty(logAnalyticsName) ? logAnalytics.id : '' 136 | } 137 | } 138 | 139 | // Grant ACR Pull access from cluster managed identity to container registry 140 | module containerRegistryAccess '../security/registry-access.bicep' = { 141 | name: 'cluster-container-registry-access' 142 | params: { 143 | containerRegistryName: containerRegistry.outputs.name 144 | principalId: managedCluster.outputs.clusterIdentity.objectId 145 | } 146 | } 147 | 148 | // Give the AKS Cluster access to KeyVault 149 | module clusterKeyVaultAccess '../security/keyvault-access.bicep' = { 150 | name: 'cluster-keyvault-access' 151 | params: { 152 | keyVaultName: keyVaultName 153 | principalId: managedCluster.outputs.clusterIdentity.objectId 154 | } 155 | } 156 | 157 | // Helpers for node pool configuration 158 | var nodePoolBase = { 159 | osType: 'Linux' 160 | maxPods: 30 161 | type: 'VirtualMachineScaleSets' 162 | upgradeSettings: { 163 | maxSurge: '33%' 164 | } 165 | } 166 | 167 | var nodePoolPresets = { 168 | CostOptimised: { 169 | vmSize: 'Standard_B4ms' 170 | count: 1 171 | minCount: 1 172 | maxCount: 3 173 | enableAutoScaling: true 174 | availabilityZones: [] 175 | } 176 | Standard: { 177 | vmSize: 'Standard_DS2_v2' 178 | count: 3 179 | minCount: 3 180 | maxCount: 5 181 | enableAutoScaling: true 182 | availabilityZones: [ 183 | '1' 184 | '2' 185 | '3' 186 | ] 187 | } 188 | HighSpec: { 189 | vmSize: 'Standard_D4s_v3' 190 | count: 3 191 | minCount: 3 192 | maxCount: 5 193 | enableAutoScaling: true 194 | availabilityZones: [ 195 | '1' 196 | '2' 197 | '3' 198 | ] 199 | } 200 | } 201 | 202 | // Module outputs 203 | @description('The resource name of the AKS cluster') 204 | output clusterName string = managedCluster.outputs.clusterName 205 | 206 | @description('The AKS cluster identity') 207 | output clusterIdentity object = managedCluster.outputs.clusterIdentity 208 | 209 | @description('The resource name of the ACR') 210 | output containerRegistryName string = containerRegistry.outputs.name 211 | 212 | @description('The login server for the container registry') 213 | output containerRegistryLoginServer string = containerRegistry.outputs.loginServer 214 | -------------------------------------------------------------------------------- /infra/core/host/appservice-appsettings.bicep: -------------------------------------------------------------------------------- 1 | @description('The name of the app service resource within the current resource group scope') 2 | param name string 3 | 4 | @description('The app settings to be applied to the app service') 5 | param appSettings object 6 | 7 | resource appService 'Microsoft.Web/sites@2022-03-01' existing = { 8 | name: name 9 | } 10 | 11 | resource settings 'Microsoft.Web/sites/config@2022-03-01' = { 12 | name: 'appsettings' 13 | parent: appService 14 | properties: appSettings 15 | } 16 | -------------------------------------------------------------------------------- /infra/core/host/appservice.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | // Reference Properties 6 | param applicationInsightsName string = '' 7 | param appServicePlanId string 8 | param keyVaultName string = '' 9 | param managedIdentity bool = !empty(keyVaultName) 10 | 11 | // Runtime Properties 12 | @allowed([ 13 | 'dotnet', 'dotnetcore', 'dotnet-isolated', 'node', 'python', 'java', 'powershell', 'custom' 14 | ]) 15 | param runtimeName string 16 | param runtimeNameAndVersion string = '${runtimeName}|${runtimeVersion}' 17 | param runtimeVersion string 18 | 19 | // Microsoft.Web/sites Properties 20 | param kind string = 'app,linux' 21 | 22 | // Microsoft.Web/sites/config 23 | param allowedOrigins array = [] 24 | param alwaysOn bool = true 25 | param appCommandLine string = '' 26 | param appSettings object = {} 27 | param clientAffinityEnabled bool = false 28 | param enableOryxBuild bool = contains(kind, 'linux') 29 | param functionAppScaleLimit int = -1 30 | param linuxFxVersion string = runtimeNameAndVersion 31 | param minimumElasticInstanceCount int = -1 32 | param numberOfWorkers int = -1 33 | param scmDoBuildDuringDeployment bool = false 34 | param use32BitWorkerProcess bool = false 35 | param ftpsState string = 'FtpsOnly' 36 | param healthCheckPath string = '' 37 | 38 | resource appService 'Microsoft.Web/sites@2022-03-01' = { 39 | name: name 40 | location: location 41 | tags: tags 42 | kind: kind 43 | properties: { 44 | serverFarmId: appServicePlanId 45 | siteConfig: { 46 | linuxFxVersion: linuxFxVersion 47 | alwaysOn: alwaysOn 48 | ftpsState: ftpsState 49 | minTlsVersion: '1.2' 50 | appCommandLine: appCommandLine 51 | numberOfWorkers: numberOfWorkers != -1 ? numberOfWorkers : null 52 | minimumElasticInstanceCount: minimumElasticInstanceCount != -1 ? minimumElasticInstanceCount : null 53 | use32BitWorkerProcess: use32BitWorkerProcess 54 | functionAppScaleLimit: functionAppScaleLimit != -1 ? functionAppScaleLimit : null 55 | healthCheckPath: healthCheckPath 56 | cors: { 57 | allowedOrigins: union([ 'https://portal.azure.com', 'https://ms.portal.azure.com' ], allowedOrigins) 58 | } 59 | } 60 | clientAffinityEnabled: clientAffinityEnabled 61 | httpsOnly: true 62 | } 63 | 64 | identity: { type: managedIdentity ? 'SystemAssigned' : 'None' } 65 | 66 | resource configLogs 'config' = { 67 | name: 'logs' 68 | properties: { 69 | applicationLogs: { fileSystem: { level: 'Verbose' } } 70 | detailedErrorMessages: { enabled: true } 71 | failedRequestsTracing: { enabled: true } 72 | httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } } 73 | } 74 | } 75 | 76 | resource basicPublishingCredentialsPoliciesFtp 'basicPublishingCredentialsPolicies' = { 77 | name: 'ftp' 78 | location: location 79 | properties: { 80 | allow: false 81 | } 82 | } 83 | 84 | resource basicPublishingCredentialsPoliciesScm 'basicPublishingCredentialsPolicies' = { 85 | name: 'scm' 86 | location: location 87 | properties: { 88 | allow: false 89 | } 90 | } 91 | } 92 | 93 | module config 'appservice-appsettings.bicep' = if (!empty(appSettings)) { 94 | name: '${name}-appSettings' 95 | params: { 96 | name: appService.name 97 | appSettings: union(appSettings, 98 | { 99 | SCM_DO_BUILD_DURING_DEPLOYMENT: string(scmDoBuildDuringDeployment) 100 | ENABLE_ORYX_BUILD: string(enableOryxBuild) 101 | }, 102 | !empty(applicationInsightsName) ? { APPLICATIONINSIGHTS_CONNECTION_STRING: applicationInsights.properties.ConnectionString } : {}, 103 | !empty(keyVaultName) ? { AZURE_KEY_VAULT_ENDPOINT: keyVault.properties.vaultUri } : {}) 104 | } 105 | } 106 | 107 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = if (!(empty(keyVaultName))) { 108 | name: keyVaultName 109 | } 110 | 111 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = if (!empty(applicationInsightsName)) { 112 | name: applicationInsightsName 113 | } 114 | 115 | output identityPrincipalId string = managedIdentity ? appService.identity.principalId : '' 116 | output name string = appService.name 117 | output uri string = 'https://${appService.properties.defaultHostName}' 118 | -------------------------------------------------------------------------------- /infra/core/host/appserviceplan.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param kind string = '' 6 | param reserved bool = true 7 | param sku object 8 | 9 | resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = { 10 | name: name 11 | location: location 12 | tags: tags 13 | sku: sku 14 | kind: kind 15 | properties: { 16 | reserved: reserved 17 | } 18 | } 19 | 20 | output id string = appServicePlan.id 21 | output name string = appServicePlan.name 22 | -------------------------------------------------------------------------------- /infra/core/host/container-app-upsert.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | @description('The environment name for the container apps') 6 | param containerAppsEnvironmentName string 7 | 8 | @description('The number of CPU cores allocated to a single container instance, e.g., 0.5') 9 | param containerCpuCoreCount string = '0.5' 10 | 11 | @description('The maximum number of replicas to run. Must be at least 1.') 12 | @minValue(1) 13 | param containerMaxReplicas int = 10 14 | 15 | @description('The amount of memory allocated to a single container instance, e.g., 1Gi') 16 | param containerMemory string = '1.0Gi' 17 | 18 | @description('The minimum number of replicas to run. Must be at least 1.') 19 | @minValue(1) 20 | param containerMinReplicas int = 1 21 | 22 | @description('The name of the container') 23 | param containerName string = 'main' 24 | 25 | @description('The name of the container registry') 26 | param containerRegistryName string = '' 27 | 28 | @allowed([ 'http', 'grpc' ]) 29 | @description('The protocol used by Dapr to connect to the app, e.g., HTTP or gRPC') 30 | param daprAppProtocol string = 'http' 31 | 32 | @description('Enable or disable Dapr for the container app') 33 | param daprEnabled bool = false 34 | 35 | @description('The Dapr app ID') 36 | param daprAppId string = containerName 37 | 38 | @description('Specifies if the resource already exists') 39 | param exists bool = false 40 | 41 | @description('Specifies if Ingress is enabled for the container app') 42 | param ingressEnabled bool = true 43 | 44 | @description('The type of identity for the resource') 45 | @allowed([ 'None', 'SystemAssigned', 'UserAssigned' ]) 46 | param identityType string = 'None' 47 | 48 | @description('The name of the user-assigned identity') 49 | param identityName string = '' 50 | 51 | @description('The name of the container image') 52 | param imageName string = '' 53 | 54 | @description('The secrets required for the container') 55 | param secrets array = [] 56 | 57 | @description('The environment variables for the container') 58 | param env array = [] 59 | 60 | @description('Specifies if the resource ingress is exposed externally') 61 | param external bool = true 62 | 63 | @description('The service binds associated with the container') 64 | param serviceBinds array = [] 65 | 66 | @description('The target port for the container') 67 | param targetPort int = 80 68 | 69 | resource existingApp 'Microsoft.App/containerApps@2023-04-01-preview' existing = if (exists) { 70 | name: name 71 | } 72 | 73 | module app 'container-app.bicep' = { 74 | name: '${deployment().name}-update' 75 | params: { 76 | name: name 77 | location: location 78 | tags: tags 79 | identityType: identityType 80 | identityName: identityName 81 | ingressEnabled: ingressEnabled 82 | containerName: containerName 83 | containerAppsEnvironmentName: containerAppsEnvironmentName 84 | containerRegistryName: containerRegistryName 85 | containerCpuCoreCount: containerCpuCoreCount 86 | containerMemory: containerMemory 87 | containerMinReplicas: containerMinReplicas 88 | containerMaxReplicas: containerMaxReplicas 89 | daprEnabled: daprEnabled 90 | daprAppId: daprAppId 91 | daprAppProtocol: daprAppProtocol 92 | secrets: secrets 93 | external: external 94 | env: env 95 | imageName: !empty(imageName) ? imageName : exists ? existingApp.properties.template.containers[0].image : '' 96 | targetPort: targetPort 97 | serviceBinds: serviceBinds 98 | } 99 | } 100 | 101 | output defaultDomain string = app.outputs.defaultDomain 102 | output imageName string = app.outputs.imageName 103 | output name string = app.outputs.name 104 | output uri string = app.outputs.uri 105 | -------------------------------------------------------------------------------- /infra/core/host/container-app.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | @description('Allowed origins') 6 | param allowedOrigins array = [] 7 | 8 | @description('Name of the environment for container apps') 9 | param containerAppsEnvironmentName string 10 | 11 | @description('CPU cores allocated to a single container instance, e.g., 0.5') 12 | param containerCpuCoreCount string = '0.5' 13 | 14 | @description('The maximum number of replicas to run. Must be at least 1.') 15 | @minValue(1) 16 | param containerMaxReplicas int = 10 17 | 18 | @description('Memory allocated to a single container instance, e.g., 1Gi') 19 | param containerMemory string = '1.0Gi' 20 | 21 | @description('The minimum number of replicas to run. Must be at least 1.') 22 | param containerMinReplicas int = 1 23 | 24 | @description('The name of the container') 25 | param containerName string = 'main' 26 | 27 | @description('The name of the container registry') 28 | param containerRegistryName string = '' 29 | 30 | @description('The protocol used by Dapr to connect to the app, e.g., http or grpc') 31 | @allowed([ 'http', 'grpc' ]) 32 | param daprAppProtocol string = 'http' 33 | 34 | @description('The Dapr app ID') 35 | param daprAppId string = containerName 36 | 37 | @description('Enable Dapr') 38 | param daprEnabled bool = false 39 | 40 | @description('The environment variables for the container') 41 | param env array = [] 42 | 43 | @description('Specifies if the resource ingress is exposed externally') 44 | param external bool = true 45 | 46 | @description('The name of the user-assigned identity') 47 | param identityName string = '' 48 | 49 | @description('The type of identity for the resource') 50 | @allowed([ 'None', 'SystemAssigned', 'UserAssigned' ]) 51 | param identityType string = 'None' 52 | 53 | @description('The name of the container image') 54 | param imageName string = '' 55 | 56 | @description('Specifies if Ingress is enabled for the container app') 57 | param ingressEnabled bool = true 58 | 59 | param revisionMode string = 'Single' 60 | 61 | @description('The secrets required for the container') 62 | param secrets array = [] 63 | 64 | @description('The service binds associated with the container') 65 | param serviceBinds array = [] 66 | 67 | @description('The name of the container apps add-on to use. e.g. redis') 68 | param serviceType string = '' 69 | 70 | @description('The target port for the container') 71 | param targetPort int = 80 72 | 73 | resource userIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' existing = if (!empty(identityName)) { 74 | name: identityName 75 | } 76 | 77 | // Private registry support requires both an ACR name and a User Assigned managed identity 78 | var usePrivateRegistry = !empty(identityName) && !empty(containerRegistryName) 79 | 80 | // Automatically set to `UserAssigned` when an `identityName` has been set 81 | var normalizedIdentityType = !empty(identityName) ? 'UserAssigned' : identityType 82 | 83 | module containerRegistryAccess '../security/registry-access.bicep' = if (usePrivateRegistry) { 84 | name: '${deployment().name}-registry-access' 85 | params: { 86 | containerRegistryName: containerRegistryName 87 | principalId: usePrivateRegistry ? userIdentity.properties.principalId : '' 88 | } 89 | } 90 | 91 | resource app 'Microsoft.App/containerApps@2023-04-01-preview' = { 92 | name: name 93 | location: location 94 | tags: tags 95 | // It is critical that the identity is granted ACR pull access before the app is created 96 | // otherwise the container app will throw a provision error 97 | // This also forces us to use an user assigned managed identity since there would no way to 98 | // provide the system assigned identity with the ACR pull access before the app is created 99 | dependsOn: usePrivateRegistry ? [ containerRegistryAccess ] : [] 100 | identity: { 101 | type: normalizedIdentityType 102 | userAssignedIdentities: !empty(identityName) && normalizedIdentityType == 'UserAssigned' ? { '${userIdentity.id}': {} } : null 103 | } 104 | properties: { 105 | managedEnvironmentId: containerAppsEnvironment.id 106 | configuration: { 107 | activeRevisionsMode: revisionMode 108 | ingress: ingressEnabled ? { 109 | external: external 110 | targetPort: targetPort 111 | transport: 'auto' 112 | corsPolicy: { 113 | allowedOrigins: union([ 'https://portal.azure.com', 'https://ms.portal.azure.com' ], allowedOrigins) 114 | } 115 | } : null 116 | dapr: daprEnabled ? { 117 | enabled: true 118 | appId: daprAppId 119 | appProtocol: daprAppProtocol 120 | appPort: ingressEnabled ? targetPort : 0 121 | } : { enabled: false } 122 | secrets: secrets 123 | service: !empty(serviceType) ? { type: serviceType } : null 124 | registries: usePrivateRegistry ? [ 125 | { 126 | server: '${containerRegistryName}.azurecr.io' 127 | identity: userIdentity.id 128 | } 129 | ] : [] 130 | } 131 | template: { 132 | serviceBinds: !empty(serviceBinds) ? serviceBinds : null 133 | containers: [ 134 | { 135 | image: !empty(imageName) ? imageName : 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' 136 | name: containerName 137 | env: env 138 | resources: { 139 | cpu: json(containerCpuCoreCount) 140 | memory: containerMemory 141 | } 142 | } 143 | ] 144 | scale: { 145 | minReplicas: containerMinReplicas 146 | maxReplicas: containerMaxReplicas 147 | } 148 | } 149 | } 150 | } 151 | 152 | resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2023-04-01-preview' existing = { 153 | name: containerAppsEnvironmentName 154 | } 155 | 156 | output defaultDomain string = containerAppsEnvironment.properties.defaultDomain 157 | output identityPrincipalId string = normalizedIdentityType == 'None' ? '' : (empty(identityName) ? app.identity.principalId : userIdentity.properties.principalId) 158 | output imageName string = imageName 159 | output name string = app.name 160 | output serviceBind object = !empty(serviceType) ? { serviceId: app.id, name: name } : {} 161 | output uri string = ingressEnabled ? 'https://${app.properties.configuration.ingress.fqdn}' : '' 162 | -------------------------------------------------------------------------------- /infra/core/host/container-apps-environment.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | @description('Name of the Application Insights resource') 6 | param applicationInsightsName string = '' 7 | 8 | @description('Specifies if Dapr is enabled') 9 | param daprEnabled bool = false 10 | 11 | @description('Name of the Log Analytics workspace') 12 | param logAnalyticsWorkspaceName string 13 | 14 | resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2023-04-01-preview' = { 15 | name: name 16 | location: location 17 | tags: tags 18 | properties: { 19 | appLogsConfiguration: { 20 | destination: 'log-analytics' 21 | logAnalyticsConfiguration: { 22 | customerId: logAnalyticsWorkspace.properties.customerId 23 | sharedKey: logAnalyticsWorkspace.listKeys().primarySharedKey 24 | } 25 | } 26 | daprAIInstrumentationKey: daprEnabled && !empty(applicationInsightsName) ? applicationInsights.properties.InstrumentationKey : '' 27 | } 28 | } 29 | 30 | resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = { 31 | name: logAnalyticsWorkspaceName 32 | } 33 | 34 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = if (daprEnabled && !empty(applicationInsightsName)) { 35 | name: applicationInsightsName 36 | } 37 | 38 | output defaultDomain string = containerAppsEnvironment.properties.defaultDomain 39 | output id string = containerAppsEnvironment.id 40 | output name string = containerAppsEnvironment.name 41 | -------------------------------------------------------------------------------- /infra/core/host/container-apps.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param containerAppsEnvironmentName string 6 | param containerRegistryName string 7 | param containerRegistryResourceGroupName string = '' 8 | param logAnalyticsWorkspaceName string 9 | param applicationInsightsName string = '' 10 | 11 | module containerAppsEnvironment 'container-apps-environment.bicep' = { 12 | name: '${name}-container-apps-environment' 13 | params: { 14 | name: containerAppsEnvironmentName 15 | location: location 16 | tags: tags 17 | logAnalyticsWorkspaceName: logAnalyticsWorkspaceName 18 | applicationInsightsName: applicationInsightsName 19 | } 20 | } 21 | 22 | module containerRegistry 'container-registry.bicep' = { 23 | name: '${name}-container-registry' 24 | scope: !empty(containerRegistryResourceGroupName) ? resourceGroup(containerRegistryResourceGroupName) : resourceGroup() 25 | params: { 26 | name: containerRegistryName 27 | location: location 28 | tags: tags 29 | } 30 | } 31 | 32 | output defaultDomain string = containerAppsEnvironment.outputs.defaultDomain 33 | output environmentName string = containerAppsEnvironment.outputs.name 34 | output environmentId string = containerAppsEnvironment.outputs.id 35 | 36 | output registryLoginServer string = containerRegistry.outputs.loginServer 37 | output registryName string = containerRegistry.outputs.name 38 | -------------------------------------------------------------------------------- /infra/core/host/container-registry.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | @description('Indicates whether admin user is enabled') 6 | param adminUserEnabled bool = false 7 | 8 | @description('Indicates whether anonymous pull is enabled') 9 | param anonymousPullEnabled bool = false 10 | 11 | @description('Indicates whether data endpoint is enabled') 12 | param dataEndpointEnabled bool = false 13 | 14 | @description('Encryption settings') 15 | param encryption object = { 16 | status: 'disabled' 17 | } 18 | 19 | @description('Options for bypassing network rules') 20 | param networkRuleBypassOptions string = 'AzureServices' 21 | 22 | @description('Public network access setting') 23 | param publicNetworkAccess string = 'Enabled' 24 | 25 | @description('SKU settings') 26 | param sku object = { 27 | name: 'Basic' 28 | } 29 | 30 | @description('Zone redundancy setting') 31 | param zoneRedundancy string = 'Disabled' 32 | 33 | @description('The log analytics workspace ID used for logging and monitoring') 34 | param workspaceId string = '' 35 | 36 | // 2022-02-01-preview needed for anonymousPullEnabled 37 | resource containerRegistry 'Microsoft.ContainerRegistry/registries@2022-02-01-preview' = { 38 | name: name 39 | location: location 40 | tags: tags 41 | sku: sku 42 | properties: { 43 | adminUserEnabled: adminUserEnabled 44 | anonymousPullEnabled: anonymousPullEnabled 45 | dataEndpointEnabled: dataEndpointEnabled 46 | encryption: encryption 47 | networkRuleBypassOptions: networkRuleBypassOptions 48 | publicNetworkAccess: publicNetworkAccess 49 | zoneRedundancy: zoneRedundancy 50 | } 51 | } 52 | 53 | // TODO: Update diagnostics to be its own module 54 | // Blocking issue: https://github.com/Azure/bicep/issues/622 55 | // Unable to pass in a `resource` scope or unable to use string interpolation in resource types 56 | resource diagnostics 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (!empty(workspaceId)) { 57 | name: 'registry-diagnostics' 58 | scope: containerRegistry 59 | properties: { 60 | workspaceId: workspaceId 61 | logs: [ 62 | { 63 | category: 'ContainerRegistryRepositoryEvents' 64 | enabled: true 65 | } 66 | { 67 | category: 'ContainerRegistryLoginEvents' 68 | enabled: true 69 | } 70 | ] 71 | metrics: [ 72 | { 73 | category: 'AllMetrics' 74 | enabled: true 75 | timeGrain: 'PT1M' 76 | } 77 | ] 78 | } 79 | } 80 | 81 | output loginServer string = containerRegistry.properties.loginServer 82 | output name string = containerRegistry.name 83 | -------------------------------------------------------------------------------- /infra/core/host/functions.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | // Reference Properties 6 | param applicationInsightsName string = '' 7 | param appServicePlanId string 8 | param keyVaultName string = '' 9 | param managedIdentity bool = !empty(keyVaultName) 10 | param storageAccountName string 11 | 12 | // Runtime Properties 13 | @allowed([ 14 | 'dotnet', 'dotnetcore', 'dotnet-isolated', 'node', 'python', 'java', 'powershell', 'custom' 15 | ]) 16 | param runtimeName string 17 | param runtimeNameAndVersion string = '${runtimeName}|${runtimeVersion}' 18 | param runtimeVersion string 19 | 20 | // Function Settings 21 | @allowed([ 22 | '~4', '~3', '~2', '~1' 23 | ]) 24 | param extensionVersion string = '~4' 25 | 26 | // Microsoft.Web/sites Properties 27 | param kind string = 'functionapp,linux' 28 | 29 | // Microsoft.Web/sites/config 30 | param allowedOrigins array = [] 31 | param alwaysOn bool = true 32 | param appCommandLine string = '' 33 | param appSettings object = {} 34 | param clientAffinityEnabled bool = false 35 | param enableOryxBuild bool = contains(kind, 'linux') 36 | param functionAppScaleLimit int = -1 37 | param linuxFxVersion string = runtimeNameAndVersion 38 | param minimumElasticInstanceCount int = -1 39 | param numberOfWorkers int = -1 40 | param scmDoBuildDuringDeployment bool = true 41 | param use32BitWorkerProcess bool = false 42 | 43 | module functions 'appservice.bicep' = { 44 | name: '${name}-functions' 45 | params: { 46 | name: name 47 | location: location 48 | tags: tags 49 | allowedOrigins: allowedOrigins 50 | alwaysOn: alwaysOn 51 | appCommandLine: appCommandLine 52 | applicationInsightsName: applicationInsightsName 53 | appServicePlanId: appServicePlanId 54 | appSettings: union(appSettings, { 55 | AzureWebJobsStorage: 'DefaultEndpointsProtocol=https;AccountName=${storage.name};AccountKey=${storage.listKeys().keys[0].value};EndpointSuffix=${environment().suffixes.storage}' 56 | FUNCTIONS_EXTENSION_VERSION: extensionVersion 57 | FUNCTIONS_WORKER_RUNTIME: runtimeName 58 | }) 59 | clientAffinityEnabled: clientAffinityEnabled 60 | enableOryxBuild: enableOryxBuild 61 | functionAppScaleLimit: functionAppScaleLimit 62 | keyVaultName: keyVaultName 63 | kind: kind 64 | linuxFxVersion: linuxFxVersion 65 | managedIdentity: managedIdentity 66 | minimumElasticInstanceCount: minimumElasticInstanceCount 67 | numberOfWorkers: numberOfWorkers 68 | runtimeName: runtimeName 69 | runtimeVersion: runtimeVersion 70 | runtimeNameAndVersion: runtimeNameAndVersion 71 | scmDoBuildDuringDeployment: scmDoBuildDuringDeployment 72 | use32BitWorkerProcess: use32BitWorkerProcess 73 | } 74 | } 75 | 76 | resource storage 'Microsoft.Storage/storageAccounts@2021-09-01' existing = { 77 | name: storageAccountName 78 | } 79 | 80 | output identityPrincipalId string = managedIdentity ? functions.outputs.identityPrincipalId : '' 81 | output name string = functions.outputs.name 82 | output uri string = functions.outputs.uri 83 | -------------------------------------------------------------------------------- /infra/core/host/staticwebapp.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param sku object = { 6 | name: 'Free' 7 | tier: 'Free' 8 | } 9 | 10 | resource web 'Microsoft.Web/staticSites@2022-03-01' = { 11 | name: name 12 | location: location 13 | tags: tags 14 | sku: sku 15 | properties: { 16 | provider: 'Custom' 17 | } 18 | } 19 | 20 | output name string = web.name 21 | output uri string = 'https://${web.properties.defaultHostname}' 22 | -------------------------------------------------------------------------------- /infra/core/monitor/applicationinsights-dashboard.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param applicationInsightsName string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | // 2020-09-01-preview because that is the latest valid version 7 | resource applicationInsightsDashboard 'Microsoft.Portal/dashboards@2020-09-01-preview' = { 8 | name: name 9 | location: location 10 | tags: tags 11 | properties: { 12 | lenses: [ 13 | { 14 | order: 0 15 | parts: [ 16 | { 17 | position: { 18 | x: 0 19 | y: 0 20 | colSpan: 2 21 | rowSpan: 1 22 | } 23 | metadata: { 24 | inputs: [ 25 | { 26 | name: 'id' 27 | value: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 28 | } 29 | { 30 | name: 'Version' 31 | value: '1.0' 32 | } 33 | ] 34 | #disable-next-line BCP036 35 | type: 'Extension/AppInsightsExtension/PartType/AspNetOverviewPinnedPart' 36 | asset: { 37 | idInputName: 'id' 38 | type: 'ApplicationInsights' 39 | } 40 | defaultMenuItemId: 'overview' 41 | } 42 | } 43 | { 44 | position: { 45 | x: 2 46 | y: 0 47 | colSpan: 1 48 | rowSpan: 1 49 | } 50 | metadata: { 51 | inputs: [ 52 | { 53 | name: 'ComponentId' 54 | value: { 55 | Name: applicationInsights.name 56 | SubscriptionId: subscription().subscriptionId 57 | ResourceGroup: resourceGroup().name 58 | } 59 | } 60 | { 61 | name: 'Version' 62 | value: '1.0' 63 | } 64 | ] 65 | #disable-next-line BCP036 66 | type: 'Extension/AppInsightsExtension/PartType/ProactiveDetectionAsyncPart' 67 | asset: { 68 | idInputName: 'ComponentId' 69 | type: 'ApplicationInsights' 70 | } 71 | defaultMenuItemId: 'ProactiveDetection' 72 | } 73 | } 74 | { 75 | position: { 76 | x: 3 77 | y: 0 78 | colSpan: 1 79 | rowSpan: 1 80 | } 81 | metadata: { 82 | inputs: [ 83 | { 84 | name: 'ComponentId' 85 | value: { 86 | Name: applicationInsights.name 87 | SubscriptionId: subscription().subscriptionId 88 | ResourceGroup: resourceGroup().name 89 | } 90 | } 91 | { 92 | name: 'ResourceId' 93 | value: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 94 | } 95 | ] 96 | #disable-next-line BCP036 97 | type: 'Extension/AppInsightsExtension/PartType/QuickPulseButtonSmallPart' 98 | asset: { 99 | idInputName: 'ComponentId' 100 | type: 'ApplicationInsights' 101 | } 102 | } 103 | } 104 | { 105 | position: { 106 | x: 4 107 | y: 0 108 | colSpan: 1 109 | rowSpan: 1 110 | } 111 | metadata: { 112 | inputs: [ 113 | { 114 | name: 'ComponentId' 115 | value: { 116 | Name: applicationInsights.name 117 | SubscriptionId: subscription().subscriptionId 118 | ResourceGroup: resourceGroup().name 119 | } 120 | } 121 | { 122 | name: 'TimeContext' 123 | value: { 124 | durationMs: 86400000 125 | endTime: null 126 | createdTime: '2018-05-04T01:20:33.345Z' 127 | isInitialTime: true 128 | grain: 1 129 | useDashboardTimeRange: false 130 | } 131 | } 132 | { 133 | name: 'Version' 134 | value: '1.0' 135 | } 136 | ] 137 | #disable-next-line BCP036 138 | type: 'Extension/AppInsightsExtension/PartType/AvailabilityNavButtonPart' 139 | asset: { 140 | idInputName: 'ComponentId' 141 | type: 'ApplicationInsights' 142 | } 143 | } 144 | } 145 | { 146 | position: { 147 | x: 5 148 | y: 0 149 | colSpan: 1 150 | rowSpan: 1 151 | } 152 | metadata: { 153 | inputs: [ 154 | { 155 | name: 'ComponentId' 156 | value: { 157 | Name: applicationInsights.name 158 | SubscriptionId: subscription().subscriptionId 159 | ResourceGroup: resourceGroup().name 160 | } 161 | } 162 | { 163 | name: 'TimeContext' 164 | value: { 165 | durationMs: 86400000 166 | endTime: null 167 | createdTime: '2018-05-08T18:47:35.237Z' 168 | isInitialTime: true 169 | grain: 1 170 | useDashboardTimeRange: false 171 | } 172 | } 173 | { 174 | name: 'ConfigurationId' 175 | value: '78ce933e-e864-4b05-a27b-71fd55a6afad' 176 | } 177 | ] 178 | #disable-next-line BCP036 179 | type: 'Extension/AppInsightsExtension/PartType/AppMapButtonPart' 180 | asset: { 181 | idInputName: 'ComponentId' 182 | type: 'ApplicationInsights' 183 | } 184 | } 185 | } 186 | { 187 | position: { 188 | x: 0 189 | y: 1 190 | colSpan: 3 191 | rowSpan: 1 192 | } 193 | metadata: { 194 | inputs: [] 195 | type: 'Extension/HubsExtension/PartType/MarkdownPart' 196 | settings: { 197 | content: { 198 | settings: { 199 | content: '# Usage' 200 | title: '' 201 | subtitle: '' 202 | } 203 | } 204 | } 205 | } 206 | } 207 | { 208 | position: { 209 | x: 3 210 | y: 1 211 | colSpan: 1 212 | rowSpan: 1 213 | } 214 | metadata: { 215 | inputs: [ 216 | { 217 | name: 'ComponentId' 218 | value: { 219 | Name: applicationInsights.name 220 | SubscriptionId: subscription().subscriptionId 221 | ResourceGroup: resourceGroup().name 222 | } 223 | } 224 | { 225 | name: 'TimeContext' 226 | value: { 227 | durationMs: 86400000 228 | endTime: null 229 | createdTime: '2018-05-04T01:22:35.782Z' 230 | isInitialTime: true 231 | grain: 1 232 | useDashboardTimeRange: false 233 | } 234 | } 235 | ] 236 | #disable-next-line BCP036 237 | type: 'Extension/AppInsightsExtension/PartType/UsageUsersOverviewPart' 238 | asset: { 239 | idInputName: 'ComponentId' 240 | type: 'ApplicationInsights' 241 | } 242 | } 243 | } 244 | { 245 | position: { 246 | x: 4 247 | y: 1 248 | colSpan: 3 249 | rowSpan: 1 250 | } 251 | metadata: { 252 | inputs: [] 253 | type: 'Extension/HubsExtension/PartType/MarkdownPart' 254 | settings: { 255 | content: { 256 | settings: { 257 | content: '# Reliability' 258 | title: '' 259 | subtitle: '' 260 | } 261 | } 262 | } 263 | } 264 | } 265 | { 266 | position: { 267 | x: 7 268 | y: 1 269 | colSpan: 1 270 | rowSpan: 1 271 | } 272 | metadata: { 273 | inputs: [ 274 | { 275 | name: 'ResourceId' 276 | value: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 277 | } 278 | { 279 | name: 'DataModel' 280 | value: { 281 | version: '1.0.0' 282 | timeContext: { 283 | durationMs: 86400000 284 | createdTime: '2018-05-04T23:42:40.072Z' 285 | isInitialTime: false 286 | grain: 1 287 | useDashboardTimeRange: false 288 | } 289 | } 290 | isOptional: true 291 | } 292 | { 293 | name: 'ConfigurationId' 294 | value: '8a02f7bf-ac0f-40e1-afe9-f0e72cfee77f' 295 | isOptional: true 296 | } 297 | ] 298 | #disable-next-line BCP036 299 | type: 'Extension/AppInsightsExtension/PartType/CuratedBladeFailuresPinnedPart' 300 | isAdapter: true 301 | asset: { 302 | idInputName: 'ResourceId' 303 | type: 'ApplicationInsights' 304 | } 305 | defaultMenuItemId: 'failures' 306 | } 307 | } 308 | { 309 | position: { 310 | x: 8 311 | y: 1 312 | colSpan: 3 313 | rowSpan: 1 314 | } 315 | metadata: { 316 | inputs: [] 317 | type: 'Extension/HubsExtension/PartType/MarkdownPart' 318 | settings: { 319 | content: { 320 | settings: { 321 | content: '# Responsiveness\r\n' 322 | title: '' 323 | subtitle: '' 324 | } 325 | } 326 | } 327 | } 328 | } 329 | { 330 | position: { 331 | x: 11 332 | y: 1 333 | colSpan: 1 334 | rowSpan: 1 335 | } 336 | metadata: { 337 | inputs: [ 338 | { 339 | name: 'ResourceId' 340 | value: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 341 | } 342 | { 343 | name: 'DataModel' 344 | value: { 345 | version: '1.0.0' 346 | timeContext: { 347 | durationMs: 86400000 348 | createdTime: '2018-05-04T23:43:37.804Z' 349 | isInitialTime: false 350 | grain: 1 351 | useDashboardTimeRange: false 352 | } 353 | } 354 | isOptional: true 355 | } 356 | { 357 | name: 'ConfigurationId' 358 | value: '2a8ede4f-2bee-4b9c-aed9-2db0e8a01865' 359 | isOptional: true 360 | } 361 | ] 362 | #disable-next-line BCP036 363 | type: 'Extension/AppInsightsExtension/PartType/CuratedBladePerformancePinnedPart' 364 | isAdapter: true 365 | asset: { 366 | idInputName: 'ResourceId' 367 | type: 'ApplicationInsights' 368 | } 369 | defaultMenuItemId: 'performance' 370 | } 371 | } 372 | { 373 | position: { 374 | x: 12 375 | y: 1 376 | colSpan: 3 377 | rowSpan: 1 378 | } 379 | metadata: { 380 | inputs: [] 381 | type: 'Extension/HubsExtension/PartType/MarkdownPart' 382 | settings: { 383 | content: { 384 | settings: { 385 | content: '# Browser' 386 | title: '' 387 | subtitle: '' 388 | } 389 | } 390 | } 391 | } 392 | } 393 | { 394 | position: { 395 | x: 15 396 | y: 1 397 | colSpan: 1 398 | rowSpan: 1 399 | } 400 | metadata: { 401 | inputs: [ 402 | { 403 | name: 'ComponentId' 404 | value: { 405 | Name: applicationInsights.name 406 | SubscriptionId: subscription().subscriptionId 407 | ResourceGroup: resourceGroup().name 408 | } 409 | } 410 | { 411 | name: 'MetricsExplorerJsonDefinitionId' 412 | value: 'BrowserPerformanceTimelineMetrics' 413 | } 414 | { 415 | name: 'TimeContext' 416 | value: { 417 | durationMs: 86400000 418 | createdTime: '2018-05-08T12:16:27.534Z' 419 | isInitialTime: false 420 | grain: 1 421 | useDashboardTimeRange: false 422 | } 423 | } 424 | { 425 | name: 'CurrentFilter' 426 | value: { 427 | eventTypes: [ 428 | 4 429 | 1 430 | 3 431 | 5 432 | 2 433 | 6 434 | 13 435 | ] 436 | typeFacets: {} 437 | isPermissive: false 438 | } 439 | } 440 | { 441 | name: 'id' 442 | value: { 443 | Name: applicationInsights.name 444 | SubscriptionId: subscription().subscriptionId 445 | ResourceGroup: resourceGroup().name 446 | } 447 | } 448 | { 449 | name: 'Version' 450 | value: '1.0' 451 | } 452 | ] 453 | #disable-next-line BCP036 454 | type: 'Extension/AppInsightsExtension/PartType/MetricsExplorerBladePinnedPart' 455 | asset: { 456 | idInputName: 'ComponentId' 457 | type: 'ApplicationInsights' 458 | } 459 | defaultMenuItemId: 'browser' 460 | } 461 | } 462 | { 463 | position: { 464 | x: 0 465 | y: 2 466 | colSpan: 4 467 | rowSpan: 3 468 | } 469 | metadata: { 470 | inputs: [ 471 | { 472 | name: 'options' 473 | value: { 474 | chart: { 475 | metrics: [ 476 | { 477 | resourceMetadata: { 478 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 479 | } 480 | name: 'sessions/count' 481 | aggregationType: 5 482 | namespace: 'microsoft.insights/components/kusto' 483 | metricVisualization: { 484 | displayName: 'Sessions' 485 | color: '#47BDF5' 486 | } 487 | } 488 | { 489 | resourceMetadata: { 490 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 491 | } 492 | name: 'users/count' 493 | aggregationType: 5 494 | namespace: 'microsoft.insights/components/kusto' 495 | metricVisualization: { 496 | displayName: 'Users' 497 | color: '#7E58FF' 498 | } 499 | } 500 | ] 501 | title: 'Unique sessions and users' 502 | visualization: { 503 | chartType: 2 504 | legendVisualization: { 505 | isVisible: true 506 | position: 2 507 | hideSubtitle: false 508 | } 509 | axisVisualization: { 510 | x: { 511 | isVisible: true 512 | axisType: 2 513 | } 514 | y: { 515 | isVisible: true 516 | axisType: 1 517 | } 518 | } 519 | } 520 | openBladeOnClick: { 521 | openBlade: true 522 | destinationBlade: { 523 | extensionName: 'HubsExtension' 524 | bladeName: 'ResourceMenuBlade' 525 | parameters: { 526 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 527 | menuid: 'segmentationUsers' 528 | } 529 | } 530 | } 531 | } 532 | } 533 | } 534 | { 535 | name: 'sharedTimeRange' 536 | isOptional: true 537 | } 538 | ] 539 | #disable-next-line BCP036 540 | type: 'Extension/HubsExtension/PartType/MonitorChartPart' 541 | settings: {} 542 | } 543 | } 544 | { 545 | position: { 546 | x: 4 547 | y: 2 548 | colSpan: 4 549 | rowSpan: 3 550 | } 551 | metadata: { 552 | inputs: [ 553 | { 554 | name: 'options' 555 | value: { 556 | chart: { 557 | metrics: [ 558 | { 559 | resourceMetadata: { 560 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 561 | } 562 | name: 'requests/failed' 563 | aggregationType: 7 564 | namespace: 'microsoft.insights/components' 565 | metricVisualization: { 566 | displayName: 'Failed requests' 567 | color: '#EC008C' 568 | } 569 | } 570 | ] 571 | title: 'Failed requests' 572 | visualization: { 573 | chartType: 3 574 | legendVisualization: { 575 | isVisible: true 576 | position: 2 577 | hideSubtitle: false 578 | } 579 | axisVisualization: { 580 | x: { 581 | isVisible: true 582 | axisType: 2 583 | } 584 | y: { 585 | isVisible: true 586 | axisType: 1 587 | } 588 | } 589 | } 590 | openBladeOnClick: { 591 | openBlade: true 592 | destinationBlade: { 593 | extensionName: 'HubsExtension' 594 | bladeName: 'ResourceMenuBlade' 595 | parameters: { 596 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 597 | menuid: 'failures' 598 | } 599 | } 600 | } 601 | } 602 | } 603 | } 604 | { 605 | name: 'sharedTimeRange' 606 | isOptional: true 607 | } 608 | ] 609 | #disable-next-line BCP036 610 | type: 'Extension/HubsExtension/PartType/MonitorChartPart' 611 | settings: {} 612 | } 613 | } 614 | { 615 | position: { 616 | x: 8 617 | y: 2 618 | colSpan: 4 619 | rowSpan: 3 620 | } 621 | metadata: { 622 | inputs: [ 623 | { 624 | name: 'options' 625 | value: { 626 | chart: { 627 | metrics: [ 628 | { 629 | resourceMetadata: { 630 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 631 | } 632 | name: 'requests/duration' 633 | aggregationType: 4 634 | namespace: 'microsoft.insights/components' 635 | metricVisualization: { 636 | displayName: 'Server response time' 637 | color: '#00BCF2' 638 | } 639 | } 640 | ] 641 | title: 'Server response time' 642 | visualization: { 643 | chartType: 2 644 | legendVisualization: { 645 | isVisible: true 646 | position: 2 647 | hideSubtitle: false 648 | } 649 | axisVisualization: { 650 | x: { 651 | isVisible: true 652 | axisType: 2 653 | } 654 | y: { 655 | isVisible: true 656 | axisType: 1 657 | } 658 | } 659 | } 660 | openBladeOnClick: { 661 | openBlade: true 662 | destinationBlade: { 663 | extensionName: 'HubsExtension' 664 | bladeName: 'ResourceMenuBlade' 665 | parameters: { 666 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 667 | menuid: 'performance' 668 | } 669 | } 670 | } 671 | } 672 | } 673 | } 674 | { 675 | name: 'sharedTimeRange' 676 | isOptional: true 677 | } 678 | ] 679 | #disable-next-line BCP036 680 | type: 'Extension/HubsExtension/PartType/MonitorChartPart' 681 | settings: {} 682 | } 683 | } 684 | { 685 | position: { 686 | x: 12 687 | y: 2 688 | colSpan: 4 689 | rowSpan: 3 690 | } 691 | metadata: { 692 | inputs: [ 693 | { 694 | name: 'options' 695 | value: { 696 | chart: { 697 | metrics: [ 698 | { 699 | resourceMetadata: { 700 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 701 | } 702 | name: 'browserTimings/networkDuration' 703 | aggregationType: 4 704 | namespace: 'microsoft.insights/components' 705 | metricVisualization: { 706 | displayName: 'Page load network connect time' 707 | color: '#7E58FF' 708 | } 709 | } 710 | { 711 | resourceMetadata: { 712 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 713 | } 714 | name: 'browserTimings/processingDuration' 715 | aggregationType: 4 716 | namespace: 'microsoft.insights/components' 717 | metricVisualization: { 718 | displayName: 'Client processing time' 719 | color: '#44F1C8' 720 | } 721 | } 722 | { 723 | resourceMetadata: { 724 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 725 | } 726 | name: 'browserTimings/sendDuration' 727 | aggregationType: 4 728 | namespace: 'microsoft.insights/components' 729 | metricVisualization: { 730 | displayName: 'Send request time' 731 | color: '#EB9371' 732 | } 733 | } 734 | { 735 | resourceMetadata: { 736 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 737 | } 738 | name: 'browserTimings/receiveDuration' 739 | aggregationType: 4 740 | namespace: 'microsoft.insights/components' 741 | metricVisualization: { 742 | displayName: 'Receiving response time' 743 | color: '#0672F1' 744 | } 745 | } 746 | ] 747 | title: 'Average page load time breakdown' 748 | visualization: { 749 | chartType: 3 750 | legendVisualization: { 751 | isVisible: true 752 | position: 2 753 | hideSubtitle: false 754 | } 755 | axisVisualization: { 756 | x: { 757 | isVisible: true 758 | axisType: 2 759 | } 760 | y: { 761 | isVisible: true 762 | axisType: 1 763 | } 764 | } 765 | } 766 | } 767 | } 768 | } 769 | { 770 | name: 'sharedTimeRange' 771 | isOptional: true 772 | } 773 | ] 774 | #disable-next-line BCP036 775 | type: 'Extension/HubsExtension/PartType/MonitorChartPart' 776 | settings: {} 777 | } 778 | } 779 | { 780 | position: { 781 | x: 0 782 | y: 5 783 | colSpan: 4 784 | rowSpan: 3 785 | } 786 | metadata: { 787 | inputs: [ 788 | { 789 | name: 'options' 790 | value: { 791 | chart: { 792 | metrics: [ 793 | { 794 | resourceMetadata: { 795 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 796 | } 797 | name: 'availabilityResults/availabilityPercentage' 798 | aggregationType: 4 799 | namespace: 'microsoft.insights/components' 800 | metricVisualization: { 801 | displayName: 'Availability' 802 | color: '#47BDF5' 803 | } 804 | } 805 | ] 806 | title: 'Average availability' 807 | visualization: { 808 | chartType: 3 809 | legendVisualization: { 810 | isVisible: true 811 | position: 2 812 | hideSubtitle: false 813 | } 814 | axisVisualization: { 815 | x: { 816 | isVisible: true 817 | axisType: 2 818 | } 819 | y: { 820 | isVisible: true 821 | axisType: 1 822 | } 823 | } 824 | } 825 | openBladeOnClick: { 826 | openBlade: true 827 | destinationBlade: { 828 | extensionName: 'HubsExtension' 829 | bladeName: 'ResourceMenuBlade' 830 | parameters: { 831 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 832 | menuid: 'availability' 833 | } 834 | } 835 | } 836 | } 837 | } 838 | } 839 | { 840 | name: 'sharedTimeRange' 841 | isOptional: true 842 | } 843 | ] 844 | #disable-next-line BCP036 845 | type: 'Extension/HubsExtension/PartType/MonitorChartPart' 846 | settings: {} 847 | } 848 | } 849 | { 850 | position: { 851 | x: 4 852 | y: 5 853 | colSpan: 4 854 | rowSpan: 3 855 | } 856 | metadata: { 857 | inputs: [ 858 | { 859 | name: 'options' 860 | value: { 861 | chart: { 862 | metrics: [ 863 | { 864 | resourceMetadata: { 865 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 866 | } 867 | name: 'exceptions/server' 868 | aggregationType: 7 869 | namespace: 'microsoft.insights/components' 870 | metricVisualization: { 871 | displayName: 'Server exceptions' 872 | color: '#47BDF5' 873 | } 874 | } 875 | { 876 | resourceMetadata: { 877 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 878 | } 879 | name: 'dependencies/failed' 880 | aggregationType: 7 881 | namespace: 'microsoft.insights/components' 882 | metricVisualization: { 883 | displayName: 'Dependency failures' 884 | color: '#7E58FF' 885 | } 886 | } 887 | ] 888 | title: 'Server exceptions and Dependency failures' 889 | visualization: { 890 | chartType: 2 891 | legendVisualization: { 892 | isVisible: true 893 | position: 2 894 | hideSubtitle: false 895 | } 896 | axisVisualization: { 897 | x: { 898 | isVisible: true 899 | axisType: 2 900 | } 901 | y: { 902 | isVisible: true 903 | axisType: 1 904 | } 905 | } 906 | } 907 | } 908 | } 909 | } 910 | { 911 | name: 'sharedTimeRange' 912 | isOptional: true 913 | } 914 | ] 915 | #disable-next-line BCP036 916 | type: 'Extension/HubsExtension/PartType/MonitorChartPart' 917 | settings: {} 918 | } 919 | } 920 | { 921 | position: { 922 | x: 8 923 | y: 5 924 | colSpan: 4 925 | rowSpan: 3 926 | } 927 | metadata: { 928 | inputs: [ 929 | { 930 | name: 'options' 931 | value: { 932 | chart: { 933 | metrics: [ 934 | { 935 | resourceMetadata: { 936 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 937 | } 938 | name: 'performanceCounters/processorCpuPercentage' 939 | aggregationType: 4 940 | namespace: 'microsoft.insights/components' 941 | metricVisualization: { 942 | displayName: 'Processor time' 943 | color: '#47BDF5' 944 | } 945 | } 946 | { 947 | resourceMetadata: { 948 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 949 | } 950 | name: 'performanceCounters/processCpuPercentage' 951 | aggregationType: 4 952 | namespace: 'microsoft.insights/components' 953 | metricVisualization: { 954 | displayName: 'Process CPU' 955 | color: '#7E58FF' 956 | } 957 | } 958 | ] 959 | title: 'Average processor and process CPU utilization' 960 | visualization: { 961 | chartType: 2 962 | legendVisualization: { 963 | isVisible: true 964 | position: 2 965 | hideSubtitle: false 966 | } 967 | axisVisualization: { 968 | x: { 969 | isVisible: true 970 | axisType: 2 971 | } 972 | y: { 973 | isVisible: true 974 | axisType: 1 975 | } 976 | } 977 | } 978 | } 979 | } 980 | } 981 | { 982 | name: 'sharedTimeRange' 983 | isOptional: true 984 | } 985 | ] 986 | #disable-next-line BCP036 987 | type: 'Extension/HubsExtension/PartType/MonitorChartPart' 988 | settings: {} 989 | } 990 | } 991 | { 992 | position: { 993 | x: 12 994 | y: 5 995 | colSpan: 4 996 | rowSpan: 3 997 | } 998 | metadata: { 999 | inputs: [ 1000 | { 1001 | name: 'options' 1002 | value: { 1003 | chart: { 1004 | metrics: [ 1005 | { 1006 | resourceMetadata: { 1007 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 1008 | } 1009 | name: 'exceptions/browser' 1010 | aggregationType: 7 1011 | namespace: 'microsoft.insights/components' 1012 | metricVisualization: { 1013 | displayName: 'Browser exceptions' 1014 | color: '#47BDF5' 1015 | } 1016 | } 1017 | ] 1018 | title: 'Browser exceptions' 1019 | visualization: { 1020 | chartType: 2 1021 | legendVisualization: { 1022 | isVisible: true 1023 | position: 2 1024 | hideSubtitle: false 1025 | } 1026 | axisVisualization: { 1027 | x: { 1028 | isVisible: true 1029 | axisType: 2 1030 | } 1031 | y: { 1032 | isVisible: true 1033 | axisType: 1 1034 | } 1035 | } 1036 | } 1037 | } 1038 | } 1039 | } 1040 | { 1041 | name: 'sharedTimeRange' 1042 | isOptional: true 1043 | } 1044 | ] 1045 | #disable-next-line BCP036 1046 | type: 'Extension/HubsExtension/PartType/MonitorChartPart' 1047 | settings: {} 1048 | } 1049 | } 1050 | { 1051 | position: { 1052 | x: 0 1053 | y: 8 1054 | colSpan: 4 1055 | rowSpan: 3 1056 | } 1057 | metadata: { 1058 | inputs: [ 1059 | { 1060 | name: 'options' 1061 | value: { 1062 | chart: { 1063 | metrics: [ 1064 | { 1065 | resourceMetadata: { 1066 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 1067 | } 1068 | name: 'availabilityResults/count' 1069 | aggregationType: 7 1070 | namespace: 'microsoft.insights/components' 1071 | metricVisualization: { 1072 | displayName: 'Availability test results count' 1073 | color: '#47BDF5' 1074 | } 1075 | } 1076 | ] 1077 | title: 'Availability test results count' 1078 | visualization: { 1079 | chartType: 2 1080 | legendVisualization: { 1081 | isVisible: true 1082 | position: 2 1083 | hideSubtitle: false 1084 | } 1085 | axisVisualization: { 1086 | x: { 1087 | isVisible: true 1088 | axisType: 2 1089 | } 1090 | y: { 1091 | isVisible: true 1092 | axisType: 1 1093 | } 1094 | } 1095 | } 1096 | } 1097 | } 1098 | } 1099 | { 1100 | name: 'sharedTimeRange' 1101 | isOptional: true 1102 | } 1103 | ] 1104 | #disable-next-line BCP036 1105 | type: 'Extension/HubsExtension/PartType/MonitorChartPart' 1106 | settings: {} 1107 | } 1108 | } 1109 | { 1110 | position: { 1111 | x: 4 1112 | y: 8 1113 | colSpan: 4 1114 | rowSpan: 3 1115 | } 1116 | metadata: { 1117 | inputs: [ 1118 | { 1119 | name: 'options' 1120 | value: { 1121 | chart: { 1122 | metrics: [ 1123 | { 1124 | resourceMetadata: { 1125 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 1126 | } 1127 | name: 'performanceCounters/processIOBytesPerSecond' 1128 | aggregationType: 4 1129 | namespace: 'microsoft.insights/components' 1130 | metricVisualization: { 1131 | displayName: 'Process IO rate' 1132 | color: '#47BDF5' 1133 | } 1134 | } 1135 | ] 1136 | title: 'Average process I/O rate' 1137 | visualization: { 1138 | chartType: 2 1139 | legendVisualization: { 1140 | isVisible: true 1141 | position: 2 1142 | hideSubtitle: false 1143 | } 1144 | axisVisualization: { 1145 | x: { 1146 | isVisible: true 1147 | axisType: 2 1148 | } 1149 | y: { 1150 | isVisible: true 1151 | axisType: 1 1152 | } 1153 | } 1154 | } 1155 | } 1156 | } 1157 | } 1158 | { 1159 | name: 'sharedTimeRange' 1160 | isOptional: true 1161 | } 1162 | ] 1163 | #disable-next-line BCP036 1164 | type: 'Extension/HubsExtension/PartType/MonitorChartPart' 1165 | settings: {} 1166 | } 1167 | } 1168 | { 1169 | position: { 1170 | x: 8 1171 | y: 8 1172 | colSpan: 4 1173 | rowSpan: 3 1174 | } 1175 | metadata: { 1176 | inputs: [ 1177 | { 1178 | name: 'options' 1179 | value: { 1180 | chart: { 1181 | metrics: [ 1182 | { 1183 | resourceMetadata: { 1184 | id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' 1185 | } 1186 | name: 'performanceCounters/memoryAvailableBytes' 1187 | aggregationType: 4 1188 | namespace: 'microsoft.insights/components' 1189 | metricVisualization: { 1190 | displayName: 'Available memory' 1191 | color: '#47BDF5' 1192 | } 1193 | } 1194 | ] 1195 | title: 'Average available memory' 1196 | visualization: { 1197 | chartType: 2 1198 | legendVisualization: { 1199 | isVisible: true 1200 | position: 2 1201 | hideSubtitle: false 1202 | } 1203 | axisVisualization: { 1204 | x: { 1205 | isVisible: true 1206 | axisType: 2 1207 | } 1208 | y: { 1209 | isVisible: true 1210 | axisType: 1 1211 | } 1212 | } 1213 | } 1214 | } 1215 | } 1216 | } 1217 | { 1218 | name: 'sharedTimeRange' 1219 | isOptional: true 1220 | } 1221 | ] 1222 | #disable-next-line BCP036 1223 | type: 'Extension/HubsExtension/PartType/MonitorChartPart' 1224 | settings: {} 1225 | } 1226 | } 1227 | ] 1228 | } 1229 | ] 1230 | } 1231 | } 1232 | 1233 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { 1234 | name: applicationInsightsName 1235 | } 1236 | -------------------------------------------------------------------------------- /infra/core/monitor/applicationinsights.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param dashboardName string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | param includeDashboard bool = true 6 | param logAnalyticsWorkspaceId string 7 | 8 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = { 9 | name: name 10 | location: location 11 | tags: tags 12 | kind: 'web' 13 | properties: { 14 | Application_Type: 'web' 15 | WorkspaceResourceId: logAnalyticsWorkspaceId 16 | } 17 | } 18 | 19 | module applicationInsightsDashboard 'applicationinsights-dashboard.bicep' = if (includeDashboard) { 20 | name: 'application-insights-dashboard' 21 | params: { 22 | name: dashboardName 23 | location: location 24 | applicationInsightsName: applicationInsights.name 25 | } 26 | } 27 | 28 | output connectionString string = applicationInsights.properties.ConnectionString 29 | output instrumentationKey string = applicationInsights.properties.InstrumentationKey 30 | output name string = applicationInsights.name 31 | -------------------------------------------------------------------------------- /infra/core/monitor/loganalytics.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { 6 | name: name 7 | location: location 8 | tags: tags 9 | properties: any({ 10 | retentionInDays: 30 11 | features: { 12 | searchVersion: 1 13 | } 14 | sku: { 15 | name: 'PerGB2018' 16 | } 17 | }) 18 | } 19 | 20 | output id string = logAnalytics.id 21 | output name string = logAnalytics.name 22 | -------------------------------------------------------------------------------- /infra/core/monitor/monitoring.bicep: -------------------------------------------------------------------------------- 1 | param logAnalyticsName string 2 | param applicationInsightsName string 3 | param applicationInsightsDashboardName string 4 | param location string = resourceGroup().location 5 | param tags object = {} 6 | param includeDashboard bool = true 7 | 8 | module logAnalytics 'loganalytics.bicep' = { 9 | name: 'loganalytics' 10 | params: { 11 | name: logAnalyticsName 12 | location: location 13 | tags: tags 14 | } 15 | } 16 | 17 | module applicationInsights 'applicationinsights.bicep' = { 18 | name: 'applicationinsights' 19 | params: { 20 | name: applicationInsightsName 21 | location: location 22 | tags: tags 23 | dashboardName: applicationInsightsDashboardName 24 | includeDashboard: includeDashboard 25 | logAnalyticsWorkspaceId: logAnalytics.outputs.id 26 | } 27 | } 28 | 29 | output applicationInsightsConnectionString string = applicationInsights.outputs.connectionString 30 | output applicationInsightsInstrumentationKey string = applicationInsights.outputs.instrumentationKey 31 | output applicationInsightsName string = applicationInsights.outputs.name 32 | output logAnalyticsWorkspaceId string = logAnalytics.outputs.id 33 | output logAnalyticsWorkspaceName string = logAnalytics.outputs.name 34 | -------------------------------------------------------------------------------- /infra/core/networking/cdn-endpoint.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | @description('The name of the CDN profile resource') 6 | @minLength(1) 7 | param cdnProfileName string 8 | 9 | @description('Delivery policy rules') 10 | param deliveryPolicyRules array = [] 11 | 12 | @description('The origin URL for the endpoint') 13 | @minLength(1) 14 | param originUrl string 15 | 16 | resource endpoint 'Microsoft.Cdn/profiles/endpoints@2022-05-01-preview' = { 17 | parent: cdnProfile 18 | name: name 19 | location: location 20 | tags: tags 21 | properties: { 22 | originHostHeader: originUrl 23 | isHttpAllowed: false 24 | isHttpsAllowed: true 25 | queryStringCachingBehavior: 'UseQueryString' 26 | optimizationType: 'GeneralWebDelivery' 27 | origins: [ 28 | { 29 | name: replace(originUrl, '.', '-') 30 | properties: { 31 | hostName: originUrl 32 | originHostHeader: originUrl 33 | priority: 1 34 | weight: 1000 35 | enabled: true 36 | } 37 | } 38 | ] 39 | deliveryPolicy: { 40 | rules: deliveryPolicyRules 41 | } 42 | } 43 | } 44 | 45 | resource cdnProfile 'Microsoft.Cdn/profiles@2022-05-01-preview' existing = { 46 | name: cdnProfileName 47 | } 48 | 49 | output id string = endpoint.id 50 | output name string = endpoint.name 51 | output uri string = 'https://${endpoint.properties.hostName}' 52 | -------------------------------------------------------------------------------- /infra/core/networking/cdn-profile.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | @description('The pricing tier of this CDN profile') 6 | @allowed([ 7 | 'Custom_Verizon' 8 | 'Premium_AzureFrontDoor' 9 | 'Premium_Verizon' 10 | 'StandardPlus_955BandWidth_ChinaCdn' 11 | 'StandardPlus_AvgBandWidth_ChinaCdn' 12 | 'StandardPlus_ChinaCdn' 13 | 'Standard_955BandWidth_ChinaCdn' 14 | 'Standard_Akamai' 15 | 'Standard_AvgBandWidth_ChinaCdn' 16 | 'Standard_AzureFrontDoor' 17 | 'Standard_ChinaCdn' 18 | 'Standard_Microsoft' 19 | 'Standard_Verizon' 20 | ]) 21 | param sku string = 'Standard_Microsoft' 22 | 23 | resource profile 'Microsoft.Cdn/profiles@2022-05-01-preview' = { 24 | name: name 25 | location: location 26 | tags: tags 27 | sku: { 28 | name: sku 29 | } 30 | } 31 | 32 | output id string = profile.id 33 | output name string = profile.name 34 | -------------------------------------------------------------------------------- /infra/core/networking/cdn.bicep: -------------------------------------------------------------------------------- 1 | // Module to create a CDN profile with a single endpoint 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | @description('Name of the CDN endpoint resource') 6 | param cdnEndpointName string 7 | 8 | @description('Name of the CDN profile resource') 9 | param cdnProfileName string 10 | 11 | @description('Delivery policy rules') 12 | param deliveryPolicyRules array = [] 13 | 14 | @description('Origin URL for the CDN endpoint') 15 | param originUrl string 16 | 17 | module cdnProfile 'cdn-profile.bicep' = { 18 | name: 'cdn-profile' 19 | params: { 20 | name: cdnProfileName 21 | location: location 22 | tags: tags 23 | } 24 | } 25 | 26 | module cdnEndpoint 'cdn-endpoint.bicep' = { 27 | name: 'cdn-endpoint' 28 | params: { 29 | name: cdnEndpointName 30 | location: location 31 | tags: tags 32 | cdnProfileName: cdnProfile.outputs.name 33 | originUrl: originUrl 34 | deliveryPolicyRules: deliveryPolicyRules 35 | } 36 | } 37 | 38 | output endpointName string = cdnEndpoint.outputs.name 39 | output endpointId string = cdnEndpoint.outputs.id 40 | output profileName string = cdnProfile.outputs.name 41 | output profileId string = cdnProfile.outputs.id 42 | output uri string = cdnEndpoint.outputs.uri 43 | -------------------------------------------------------------------------------- /infra/core/search/search-services.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param sku object = { 6 | name: 'standard' 7 | } 8 | 9 | param authOptions object = {} 10 | param disableLocalAuth bool = false 11 | param disabledDataExfiltrationOptions array = [] 12 | param encryptionWithCmk object = { 13 | enforcement: 'Unspecified' 14 | } 15 | @allowed([ 16 | 'default' 17 | 'highDensity' 18 | ]) 19 | param hostingMode string = 'default' 20 | param networkRuleSet object = { 21 | bypass: 'None' 22 | ipRules: [] 23 | } 24 | param partitionCount int = 1 25 | @allowed([ 26 | 'enabled' 27 | 'disabled' 28 | ]) 29 | param publicNetworkAccess string = 'enabled' 30 | param replicaCount int = 1 31 | @allowed([ 32 | 'disabled' 33 | 'free' 34 | 'standard' 35 | ]) 36 | param semanticSearch string = 'disabled' 37 | 38 | resource search 'Microsoft.Search/searchServices@2021-04-01-preview' = { 39 | name: name 40 | location: location 41 | tags: tags 42 | identity: { 43 | type: 'SystemAssigned' 44 | } 45 | properties: { 46 | authOptions: authOptions 47 | disableLocalAuth: disableLocalAuth 48 | disabledDataExfiltrationOptions: disabledDataExfiltrationOptions 49 | encryptionWithCmk: encryptionWithCmk 50 | hostingMode: hostingMode 51 | networkRuleSet: networkRuleSet 52 | partitionCount: partitionCount 53 | publicNetworkAccess: publicNetworkAccess 54 | replicaCount: replicaCount 55 | semanticSearch: semanticSearch 56 | } 57 | sku: sku 58 | } 59 | 60 | output id string = search.id 61 | output endpoint string = 'https://${name}.search.windows.net/' 62 | output name string = search.name 63 | -------------------------------------------------------------------------------- /infra/core/security/keyvault-access.bicep: -------------------------------------------------------------------------------- 1 | param name string = 'add' 2 | 3 | param keyVaultName string 4 | param permissions object = { secrets: [ 'get', 'list' ] } 5 | param principalId string 6 | 7 | resource keyVaultAccessPolicies 'Microsoft.KeyVault/vaults/accessPolicies@2022-07-01' = { 8 | parent: keyVault 9 | name: name 10 | properties: { 11 | accessPolicies: [ { 12 | objectId: principalId 13 | tenantId: subscription().tenantId 14 | permissions: permissions 15 | } ] 16 | } 17 | } 18 | 19 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { 20 | name: keyVaultName 21 | } 22 | -------------------------------------------------------------------------------- /infra/core/security/keyvault-secret.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param tags object = {} 3 | param keyVaultName string 4 | param contentType string = 'string' 5 | @description('The value of the secret. Provide only derived values like blob storage access, but do not hard code any secrets in your templates') 6 | @secure() 7 | param secretValue string 8 | 9 | param enabled bool = true 10 | param exp int = 0 11 | param nbf int = 0 12 | 13 | resource keyVaultSecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = { 14 | name: name 15 | tags: tags 16 | parent: keyVault 17 | properties: { 18 | attributes: { 19 | enabled: enabled 20 | exp: exp 21 | nbf: nbf 22 | } 23 | contentType: contentType 24 | value: secretValue 25 | } 26 | } 27 | 28 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { 29 | name: keyVaultName 30 | } 31 | -------------------------------------------------------------------------------- /infra/core/security/keyvault.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param principalId string = '' 6 | 7 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = { 8 | name: name 9 | location: location 10 | tags: tags 11 | properties: { 12 | tenantId: subscription().tenantId 13 | sku: { family: 'A', name: 'standard' } 14 | accessPolicies: !empty(principalId) ? [ 15 | { 16 | objectId: principalId 17 | permissions: { secrets: [ 'get', 'list' ] } 18 | tenantId: subscription().tenantId 19 | } 20 | ] : [] 21 | } 22 | } 23 | 24 | output endpoint string = keyVault.properties.vaultUri 25 | output name string = keyVault.name 26 | -------------------------------------------------------------------------------- /infra/core/security/registry-access.bicep: -------------------------------------------------------------------------------- 1 | param containerRegistryName string 2 | param principalId string 3 | 4 | var acrPullRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d') 5 | 6 | resource aksAcrPull 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 7 | scope: containerRegistry // Use when specifying a scope that is different than the deployment scope 8 | name: guid(subscription().id, resourceGroup().id, principalId, acrPullRole) 9 | properties: { 10 | roleDefinitionId: acrPullRole 11 | principalType: 'ServicePrincipal' 12 | principalId: principalId 13 | } 14 | } 15 | 16 | resource containerRegistry 'Microsoft.ContainerRegistry/registries@2022-02-01-preview' existing = { 17 | name: containerRegistryName 18 | } 19 | -------------------------------------------------------------------------------- /infra/core/security/role.bicep: -------------------------------------------------------------------------------- 1 | param principalId string 2 | 3 | @allowed([ 4 | 'Device' 5 | 'ForeignGroup' 6 | 'Group' 7 | 'ServicePrincipal' 8 | 'User' 9 | ]) 10 | param principalType string = 'ServicePrincipal' 11 | param roleDefinitionId string 12 | 13 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 14 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 15 | properties: { 16 | principalId: principalId 17 | principalType: principalType 18 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /infra/core/security/user-assigned-identity.bicep: -------------------------------------------------------------------------------- 1 | param identityName string 2 | param location string = resourceGroup().location 3 | 4 | resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { 5 | name: identityName 6 | location: location 7 | } 8 | 9 | output identityName string = identity.name 10 | -------------------------------------------------------------------------------- /infra/core/storage/storage-account.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | @allowed([ 6 | 'Cool' 7 | 'Hot' 8 | 'Premium' ]) 9 | param accessTier string = 'Hot' 10 | param allowBlobPublicAccess bool = true 11 | param allowCrossTenantReplication bool = true 12 | param allowSharedKeyAccess bool = true 13 | param containers array = [] 14 | param defaultToOAuthAuthentication bool = false 15 | param deleteRetentionPolicy object = {} 16 | @allowed([ 'AzureDnsZone', 'Standard' ]) 17 | param dnsEndpointType string = 'Standard' 18 | param kind string = 'StorageV2' 19 | param minimumTlsVersion string = 'TLS1_2' 20 | param networkAcls object = { 21 | bypass: 'AzureServices' 22 | defaultAction: 'Allow' 23 | } 24 | @allowed([ 'Enabled', 'Disabled' ]) 25 | param publicNetworkAccess string = 'Enabled' 26 | param sku object = { name: 'Standard_LRS' } 27 | 28 | resource storage 'Microsoft.Storage/storageAccounts@2022-05-01' = { 29 | name: name 30 | location: location 31 | tags: tags 32 | kind: kind 33 | sku: sku 34 | properties: { 35 | accessTier: accessTier 36 | allowBlobPublicAccess: allowBlobPublicAccess 37 | allowCrossTenantReplication: allowCrossTenantReplication 38 | allowSharedKeyAccess: allowSharedKeyAccess 39 | defaultToOAuthAuthentication: defaultToOAuthAuthentication 40 | dnsEndpointType: dnsEndpointType 41 | minimumTlsVersion: minimumTlsVersion 42 | networkAcls: networkAcls 43 | publicNetworkAccess: publicNetworkAccess 44 | } 45 | 46 | resource blobServices 'blobServices' = if (!empty(containers)) { 47 | name: 'default' 48 | properties: { 49 | deleteRetentionPolicy: deleteRetentionPolicy 50 | } 51 | resource container 'containers' = [for container in containers: { 52 | name: container.name 53 | properties: { 54 | publicAccess: contains(container, 'publicAccess') ? container.publicAccess : 'None' 55 | } 56 | }] 57 | } 58 | } 59 | 60 | output name string = storage.name 61 | output primaryEndpoints object = storage.properties.primaryEndpoints 62 | -------------------------------------------------------------------------------- /infra/main.bicep: -------------------------------------------------------------------------------- 1 | targetScope = 'subscription' 2 | 3 | @minLength(1) 4 | @maxLength(64) 5 | @description('Name of the environment that can be used as part of naming resource convention') 6 | param environmentName string 7 | 8 | @minLength(1) 9 | @description('Primary location for all resources') 10 | param location string 11 | 12 | @description('Specifies if the store app exists') 13 | param storeAppExists bool = false 14 | 15 | @description('Specifies if the inventory app exists') 16 | param inventoryAppExists bool = false 17 | 18 | @description('Specifies if the products app exists') 19 | param productsAppExists bool = false 20 | 21 | var tags = { 'azd-env-name': environmentName } 22 | var abbrs = loadJsonContent('./abbreviations.json') 23 | var resourceToken = toLower(uniqueString(subscription().id, environmentName, location)) 24 | 25 | resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { 26 | name: environmentName 27 | location: location 28 | tags: tags 29 | } 30 | 31 | // Container apps host (including container registry) 32 | module containerApps 'core/host/container-apps.bicep' = { 33 | name: 'container-apps' 34 | scope: resourceGroup 35 | params: { 36 | name: 'app' 37 | containerAppsEnvironmentName: '${abbrs.appManagedEnvironments}${resourceToken}' 38 | containerRegistryName: '${abbrs.containerRegistryRegistries}${resourceToken}' 39 | location: location 40 | logAnalyticsWorkspaceName: monitoring.outputs.logAnalyticsWorkspaceName 41 | } 42 | } 43 | 44 | // Monitor application with Azure Monitor 45 | module monitoring 'core/monitor/monitoring.bicep' = { 46 | name: 'monitoring' 47 | scope: resourceGroup 48 | params: { 49 | location: location 50 | tags: tags 51 | logAnalyticsName: '${abbrs.operationalInsightsWorkspaces}${resourceToken}' 52 | applicationInsightsName: '${abbrs.insightsComponents}${resourceToken}' 53 | applicationInsightsDashboardName: '${abbrs.portalDashboards}${resourceToken}' 54 | } 55 | } 56 | 57 | // identities 58 | module storeIdentity 'core/security/user-assigned-identity.bicep' = { 59 | scope: resourceGroup 60 | name: 'storeIdentity' 61 | params: { 62 | identityName: '${abbrs.managedIdentityUserAssignedIdentities}store-${resourceToken}' 63 | location: location 64 | } 65 | } 66 | module inventoryIdentity 'core/security/user-assigned-identity.bicep' = { 67 | scope: resourceGroup 68 | name: 'inventoryIdentity' 69 | params: { 70 | identityName: '${abbrs.managedIdentityUserAssignedIdentities}inventory-${resourceToken}' 71 | location: location 72 | } 73 | } 74 | module productsIdentity 'core/security/user-assigned-identity.bicep' = { 75 | scope: resourceGroup 76 | name: 'productsIdentity' 77 | params: { 78 | identityName: '${abbrs.managedIdentityUserAssignedIdentities}products-${resourceToken}' 79 | location: location 80 | } 81 | } 82 | 83 | // store front-end 84 | module store 'app/store.bicep' = { 85 | name: 'store' 86 | scope: resourceGroup 87 | params: { 88 | name: 'store' 89 | location: location 90 | tags: tags 91 | exists: storeAppExists 92 | containerAppsEnvironmentName: containerApps.outputs.environmentName 93 | containerRegistryName: containerApps.outputs.registryName 94 | identityName: storeIdentity.outputs.identityName 95 | aiConnectionString: monitoring.outputs.applicationInsightsConnectionString 96 | inventoryServiceName: inventory.outputs.SERVICE_INVENTORY_NAME 97 | productsServiceName: products.outputs.SERVICE_PRODUCTS_NAME 98 | } 99 | } 100 | 101 | // inventory api 102 | module inventory 'app/inventory.bicep' = { 103 | name: 'inventory' 104 | scope: resourceGroup 105 | params: { 106 | name: 'inventory' 107 | location: location 108 | tags: tags 109 | exists: inventoryAppExists 110 | containerAppsEnvironmentName: containerApps.outputs.environmentName 111 | containerRegistryName: containerApps.outputs.registryName 112 | identityName: inventoryIdentity.outputs.identityName 113 | aiConnectionString: monitoring.outputs.applicationInsightsConnectionString 114 | } 115 | } 116 | 117 | // products api 118 | module products 'app/products.bicep' = { 119 | name: 'products' 120 | scope: resourceGroup 121 | params: { 122 | name: 'products' 123 | location: location 124 | tags: tags 125 | exists: productsAppExists 126 | containerAppsEnvironmentName: containerApps.outputs.environmentName 127 | containerRegistryName: containerApps.outputs.registryName 128 | identityName: productsIdentity.outputs.identityName 129 | aiConnectionString: monitoring.outputs.applicationInsightsConnectionString 130 | } 131 | } 132 | 133 | output AZURE_CONTAINER_REGISTRY_ENDPOINT string = containerApps.outputs.registryLoginServer 134 | output AZURE_CONTAINER_REGISTRY_NAME string = containerApps.outputs.registryName 135 | output ACA_ENVIRONMENT_NAME string = containerApps.outputs.environmentName 136 | -------------------------------------------------------------------------------- /infra/main.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 | "environmentName": { 6 | "value": "${AZURE_ENV_NAME}" 7 | }, 8 | "location": { 9 | "value": "${AZURE_LOCATION}" 10 | }, 11 | "storeAppExists": { 12 | "value": "${SERVICE_STORE_RESOURCE_EXISTS=false}" 13 | }, 14 | "inventoryAppExists": { 15 | "value": "${SERVICE_INVENTORY_RESOURCE_EXISTS=false}" 16 | }, 17 | "productsAppExists": { 18 | "value": "${SERVICE_PRODUCTS_RESOURCE_EXISTS=false}" 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /src/Monitoring/ApplicationMapNodeNameInitializer.cs: -------------------------------------------------------------------------------- 1 | namespace Monitoring 2 | { 3 | using Microsoft.ApplicationInsights.Channel; 4 | using Microsoft.ApplicationInsights.Extensibility; 5 | using Microsoft.Extensions.Configuration; 6 | 7 | public class ApplicationMapNodeNameInitializer : ITelemetryInitializer 8 | { 9 | public ApplicationMapNodeNameInitializer(IConfiguration configuration) 10 | { 11 | Name = configuration["ApplicationMapNodeName"]; 12 | } 13 | 14 | public string Name { get; set; } 15 | 16 | public void Initialize(ITelemetry telemetry) 17 | { 18 | telemetry.Context.Cloud.RoleName = Name; 19 | } 20 | } 21 | } 22 | 23 | namespace Microsoft.Extensions.DependencyInjection 24 | { 25 | using Microsoft.ApplicationInsights.Extensibility; 26 | using Monitoring; 27 | 28 | public static class ServiceCollectionExtensions 29 | { 30 | public static void AddApplicationMonitoring(this IServiceCollection services) 31 | { 32 | services.AddApplicationInsightsTelemetry(); 33 | services.AddSingleton(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Monitoring/Monitoring.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Store.InventoryApi/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build 8 | WORKDIR /src 9 | COPY ["Store.InventoryApi/Store.InventoryApi.csproj", "Store.InventoryApi/"] 10 | COPY ["Monitoring/Monitoring.csproj", "Monitoring/"] 11 | RUN dotnet restore "Store.InventoryApi/Store.InventoryApi.csproj" 12 | COPY . . 13 | WORKDIR "/src/Store.InventoryApi" 14 | RUN dotnet build "Store.InventoryApi.csproj" -c Release -o /app/build 15 | 16 | FROM build AS publish 17 | RUN dotnet publish "Store.InventoryApi.csproj" -c Release -o /app/publish 18 | 19 | FROM base AS final 20 | WORKDIR /app 21 | COPY --from=publish /app/publish . 22 | ENTRYPOINT ["dotnet", "Store.InventoryApi.dll"] -------------------------------------------------------------------------------- /src/Store.InventoryApi/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Caching.Memory; 2 | 3 | var builder = WebApplication.CreateBuilder(args); 4 | builder.Services.AddEndpointsApiExplorer(); 5 | builder.Services.AddSwaggerGen(); 6 | builder.Services.AddMemoryCache(); // we'll use cache to simulate storage 7 | builder.Services.AddApplicationMonitoring(); 8 | 9 | var app = builder.Build(); 10 | 11 | // Configure the HTTP request pipeline. 12 | if (app.Environment.IsDevelopment()) 13 | { 14 | app.UseSwagger(); 15 | app.UseSwaggerUI(); 16 | } 17 | 18 | app.MapGet("/inventory/{productId}", (string productId, IMemoryCache memoryCache) => 19 | { 20 | var memCacheKey = $"{productId}-inventory"; 21 | int inventoryValue = -404; 22 | 23 | if(!memoryCache.TryGetValue(memCacheKey, out inventoryValue)) 24 | { 25 | inventoryValue = new Random().Next(1, 100); 26 | memoryCache.Set(memCacheKey, inventoryValue); 27 | } 28 | 29 | inventoryValue = memoryCache.Get(memCacheKey); 30 | 31 | return Results.Ok(inventoryValue); 32 | }) 33 | .Produces(StatusCodes.Status200OK) 34 | .WithName("GetInventoryCount"); 35 | 36 | app.Run(); -------------------------------------------------------------------------------- /src/Store.InventoryApi/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "Store.InventoryApi": { 5 | "commandName": "Project", 6 | "launchUrl": "swagger", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | }, 10 | "applicationUrl": "http://localhost:4999", 11 | "dotnetRunMessages": true 12 | }, 13 | "Docker": { 14 | "commandName": "Docker", 15 | "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", 16 | "publishAllPorts": true 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Store.InventoryApi/Store.InventoryApi.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | Linux 8 | 83cf3d50-0a3a-4e68-87b0-6b05aa7e62cc 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Store.InventoryApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Store.InventoryApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ApplicationMapNodeName": "Inventory API" 10 | } 11 | -------------------------------------------------------------------------------- /src/Store.ProductApi/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build 8 | WORKDIR /src 9 | COPY ["Store.ProductApi/Store.ProductApi.csproj", "Store.ProductApi/"] 10 | COPY ["Monitoring/Monitoring.csproj", "Monitoring/"] 11 | RUN dotnet restore "Store.ProductApi/Store.ProductApi.csproj" 12 | COPY . . 13 | WORKDIR "/src/Store.ProductApi" 14 | RUN dotnet build "Store.ProductApi.csproj" -c Release -o /app/build 15 | 16 | FROM build AS publish 17 | RUN dotnet publish "Store.ProductApi.csproj" -c Release -o /app/publish 18 | 19 | FROM base AS final 20 | WORKDIR /app 21 | COPY --from=publish /app/publish . 22 | ENTRYPOINT ["dotnet", "Store.ProductApi.dll"] -------------------------------------------------------------------------------- /src/Store.ProductApi/Program.cs: -------------------------------------------------------------------------------- 1 | using Bogus; 2 | 3 | var builder = WebApplication.CreateBuilder(args); 4 | builder.Services.AddEndpointsApiExplorer(); 5 | builder.Services.AddSwaggerGen(); 6 | builder.Services.AddApplicationMonitoring(); 7 | 8 | var app = builder.Build(); 9 | 10 | // Configure the HTTP request pipeline. 11 | if (app.Environment.IsDevelopment()) 12 | { 13 | app.UseSwagger(); 14 | app.UseSwaggerUI(); 15 | } 16 | 17 | // generae the list of products 18 | var products = new Faker() 19 | .StrictMode(true) 20 | .RuleFor(p => p.ProductId, (f, p) => f.Database.Random.Guid()) 21 | .RuleFor(p => p.ProductName, (f, p) => f.Commerce.ProductName()).Generate(10); 22 | 23 | // mapget for all the products 24 | app.MapGet("/products", () => Results.Ok(products)) 25 | .Produces(StatusCodes.Status200OK) 26 | .WithName("GetProducts"); 27 | 28 | app.Run(); 29 | 30 | public class Product 31 | { 32 | public Guid ProductId => Guid.NewGuid(); 33 | public string ProductName { get; set; } 34 | } -------------------------------------------------------------------------------- /src/Store.ProductApi/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "Store.ProductApi": { 5 | "commandName": "Project", 6 | "launchUrl": "swagger", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | }, 10 | "applicationUrl": "http://localhost:4998", 11 | "dotnetRunMessages": true 12 | }, 13 | "Docker": { 14 | "commandName": "Docker", 15 | "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", 16 | "publishAllPorts": true 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Store.ProductApi/Store.ProductApi.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | Linux 8 | 046c140a-8a19-4729-9b7a-1ab8ea5e9ffa 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Store.ProductApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Store.ProductApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ApplicationMapNodeName": "Products API" 10 | } 11 | -------------------------------------------------------------------------------- /src/Store.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32324.85 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Store.ProductApi", "Store.ProductApi\Store.ProductApi.csproj", "{278CD1A8-2A46-4467-9AFB-9809F5C2EA81}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Store.InventoryApi", "Store.InventoryApi\Store.InventoryApi.csproj", "{559C9860-F7E6-4410-B25F-73A3CF6C34AB}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Store", "Store\Store.csproj", "{E8CE69DB-18CD-4115-A15A-B7F7AEB98E1B}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Monitoring", "Monitoring\Monitoring.csproj", "{4661C6D1-2380-409D-B75A-78BF22AC8CC5}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {278CD1A8-2A46-4467-9AFB-9809F5C2EA81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {278CD1A8-2A46-4467-9AFB-9809F5C2EA81}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {278CD1A8-2A46-4467-9AFB-9809F5C2EA81}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {278CD1A8-2A46-4467-9AFB-9809F5C2EA81}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {559C9860-F7E6-4410-B25F-73A3CF6C34AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {559C9860-F7E6-4410-B25F-73A3CF6C34AB}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {559C9860-F7E6-4410-B25F-73A3CF6C34AB}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {559C9860-F7E6-4410-B25F-73A3CF6C34AB}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {E8CE69DB-18CD-4115-A15A-B7F7AEB98E1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {E8CE69DB-18CD-4115-A15A-B7F7AEB98E1B}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {E8CE69DB-18CD-4115-A15A-B7F7AEB98E1B}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {E8CE69DB-18CD-4115-A15A-B7F7AEB98E1B}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {4661C6D1-2380-409D-B75A-78BF22AC8CC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {4661C6D1-2380-409D-B75A-78BF22AC8CC5}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {4661C6D1-2380-409D-B75A-78BF22AC8CC5}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {4661C6D1-2380-409D-B75A-78BF22AC8CC5}.Release|Any CPU.Build.0 = Release|Any CPU 36 | EndGlobalSection 37 | GlobalSection(SolutionProperties) = preSolution 38 | HideSolutionNode = FALSE 39 | EndGlobalSection 40 | GlobalSection(ExtensibilityGlobals) = postSolution 41 | SolutionGuid = {817DE4DA-AA76-4275-A47A-7992D74B6C34} 42 | EndGlobalSection 43 | EndGlobal 44 | -------------------------------------------------------------------------------- /src/Store/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Not found 8 | 9 |

Sorry, there's nothing at this address.

10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /src/Store/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build 8 | WORKDIR /src 9 | COPY ["Store/Store.csproj", "Store/"] 10 | COPY ["Monitoring/Monitoring.csproj", "Monitoring/"] 11 | RUN dotnet restore "Store/Store.csproj" 12 | COPY . . 13 | WORKDIR "/src/Store" 14 | RUN dotnet build "Store.csproj" -c Release -o /app/build 15 | 16 | FROM build AS publish 17 | RUN dotnet publish "Store.csproj" -c Release -o /app/publish 18 | 19 | FROM base AS final 20 | WORKDIR /app 21 | COPY --from=publish /app/publish . 22 | ENTRYPOINT ["dotnet", "Store.dll"] -------------------------------------------------------------------------------- /src/Store/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model Store.Pages.ErrorModel 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Error 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |

Error.

19 |

An error occurred while processing your request.

20 | 21 | @if (Model.ShowRequestId) 22 | { 23 |

24 | Request ID: @Model.RequestId 25 |

26 | } 27 | 28 |

Development Mode

29 |

30 | Swapping to the Development environment displays detailed information about the error that occurred. 31 |

32 |

33 | The Development environment shouldn't be enabled for deployed applications. 34 | It can result in displaying sensitive information from exceptions to end users. 35 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 36 | and restarting the app. 37 |

38 |
39 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/Store/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Diagnostics; 4 | 5 | namespace Store.Pages 6 | { 7 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 8 | [IgnoreAntiforgeryToken] 9 | public class ErrorModel : PageModel 10 | { 11 | public string? RequestId { get; set; } 12 | 13 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 14 | 15 | private readonly ILogger _logger; 16 | 17 | public ErrorModel(ILogger logger) 18 | { 19 | _logger = logger; 20 | } 21 | 22 | public void OnGet() 23 | { 24 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Store/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @using Microsoft.Extensions.Caching.Memory 3 | @inject IStoreBackendClient _storeBackendClient 4 | @inject IMemoryCache _memoryCache 5 | 6 | Index 7 | 8 |

Products in the store:

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | @foreach (var product in _products) 20 | { 21 | 22 | 23 | 24 | 25 | } 26 | 27 |
ProductInventory
@product.ProductName@product.Quantity
28 | 29 | 30 | @code 31 | { 32 | List _products = new List(); 33 | bool _shouldRender = false; 34 | protected override bool ShouldRender() => _shouldRender; 35 | const string cacheKey = "PRODUCTS"; 36 | 37 | protected override async Task OnInitializedAsync() 38 | { 39 | Product[] tmp; 40 | if (!_memoryCache.TryGetValue(cacheKey, out tmp)) 41 | { 42 | var products = await _storeBackendClient.GetProducts(); 43 | foreach (var product in products) 44 | { 45 | product.Quantity = await _storeBackendClient.GetInventory(product.ProductId); 46 | } 47 | _products = products.ToList(); 48 | _memoryCache.Set(cacheKey, _products.ToArray()); 49 | tmp = _products.ToArray(); 50 | } 51 | _products = tmp.ToList(); 52 | 53 | _shouldRender = true; 54 | } 55 | } -------------------------------------------------------------------------------- /src/Store/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace Store.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = "_Layout"; 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Store/Pages/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Web 2 | @namespace Store.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | @RenderBody() 18 | 19 |
20 | 21 | An error has occurred. This application may no longer respond until reloaded. 22 | 23 | 24 | An unhandled exception has occurred. See browser dev tools for details. 25 | 26 | Reload 27 | 🗙 28 |
29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/Store/Program.cs: -------------------------------------------------------------------------------- 1 | using Refit; 2 | 3 | var builder = WebApplication.CreateBuilder(args); 4 | 5 | // Add services to the container. 6 | builder.Services.AddRazorPages(); 7 | builder.Services.AddServerSideBlazor(); 8 | builder.Services.AddHttpClient("Products", (httpClient) => httpClient.BaseAddress = new Uri(builder.Configuration.GetValue("ProductsApi"))); 9 | builder.Services.AddHttpClient("Inventory", (httpClient) => httpClient.BaseAddress = new Uri(builder.Configuration.GetValue("InventoryApi"))); 10 | builder.Services.AddScoped(); 11 | builder.Services.AddMemoryCache(); 12 | builder.Services.AddApplicationMonitoring(); 13 | 14 | var app = builder.Build(); 15 | 16 | // Configure the HTTP request pipeline. 17 | if (!app.Environment.IsDevelopment()) 18 | { 19 | app.UseExceptionHandler("/Error"); 20 | } 21 | 22 | app.UseStaticFiles(); 23 | app.UseRouting(); 24 | app.MapBlazorHub(); 25 | app.MapFallbackToPage("/_Host"); 26 | 27 | app.Run(); 28 | 29 | public class Product 30 | { 31 | public string ProductId { get; set; } 32 | public string ProductName { get; set; } 33 | public int Quantity { get; set; } 34 | } 35 | 36 | public interface IStoreBackendClient 37 | { 38 | [Get("/products")] 39 | Task> GetProducts(); 40 | 41 | [Get("/inventory/{productId}")] 42 | Task GetInventory(string productId); 43 | } 44 | 45 | public class StoreBackendClient : IStoreBackendClient 46 | { 47 | IHttpClientFactory _httpClientFactory; 48 | 49 | public StoreBackendClient(IHttpClientFactory httpClientFactory) 50 | { 51 | _httpClientFactory = httpClientFactory; 52 | } 53 | 54 | public async Task GetInventory(string productId) 55 | { 56 | var client = _httpClientFactory.CreateClient("Inventory"); 57 | return await RestService.For(client).GetInventory(productId); 58 | } 59 | 60 | public async Task> GetProducts() 61 | { 62 | var client = _httpClientFactory.CreateClient("Products"); 63 | return await RestService.For(client).GetProducts(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/Store/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Store": { 4 | "commandName": "Project", 5 | "launchBrowser": true, 6 | "environmentVariables": { 7 | "ASPNETCORE_ENVIRONMENT": "Development" 8 | }, 9 | "applicationUrl": "http://localhost:5000", 10 | "dotnetRunMessages": true 11 | }, 12 | "Docker": { 13 | "commandName": "Docker", 14 | "launchBrowser": true, 15 | "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", 16 | "publishAllPorts": true 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Store/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | Store 4 | 5 |
6 |
7 |
8 | About 9 |
10 | 11 |
12 | @Body 13 |
14 |
15 |
16 | -------------------------------------------------------------------------------- /src/Store/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/Store/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 | 
2 | 3 | @Title 4 | 5 | 6 | Please take our 7 | brief survey 8 | 9 | and tell us what you think. 10 |
11 | 12 | @code { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] 15 | public string? Title { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /src/Store/Store.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | Linux 8 | db8f5ee3-72be-4bb0-819b-c9b8f911f15e 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Store/_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 Store 10 | @using Store.Shared 11 | -------------------------------------------------------------------------------- /src/Store/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Store/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ApplicationMapNodeName": "Store Frontend", 10 | "ProductsApi": "http://localhost:4998", 11 | "InventoryApi": "http://localhost:4999" 12 | } 13 | -------------------------------------------------------------------------------- /src/Store/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/Store/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/Store/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 | icon name 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* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /src/Store/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} -------------------------------------------------------------------------------- /src/Store/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/src/Store/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /src/Store/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/src/Store/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /src/Store/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/src/Store/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /src/Store/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/src/Store/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /src/Store/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | h1:focus { 8 | outline: none; 9 | } 10 | 11 | a, .btn-link { 12 | color: #0071c1; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .content { 22 | padding-top: 1.1rem; 23 | } 24 | 25 | .valid.modified:not([type=checkbox]) { 26 | outline: 1px solid #26b050; 27 | } 28 | 29 | .invalid { 30 | outline: 1px solid red; 31 | } 32 | 33 | .validation-message { 34 | color: red; 35 | } 36 | 37 | #blazor-error-ui { 38 | background: lightyellow; 39 | bottom: 0; 40 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 41 | display: none; 42 | left: 0; 43 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 44 | position: fixed; 45 | width: 100%; 46 | z-index: 1000; 47 | } 48 | 49 | #blazor-error-ui .dismiss { 50 | cursor: pointer; 51 | position: absolute; 52 | right: 0.75rem; 53 | top: 0.5rem; 54 | } 55 | 56 | .blazor-error-boundary { 57 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 58 | padding: 1rem 1rem 1rem 3.7rem; 59 | color: white; 60 | } 61 | 62 | .blazor-error-boundary::after { 63 | content: "An error has occurred." 64 | } 65 | -------------------------------------------------------------------------------- /src/Store/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/2b85ffa3bf0359f3e89ee222375afa4f4fc6060a/src/Store/wwwroot/favicon.ico --------------------------------------------------------------------------------