├── .vscode └── settings.json ├── all-in-one ├── azuredeploy.parameters.json ├── install.sh ├── docker-compose.yml └── azuredeploy.json ├── LICENSE ├── README.md └── .gitignore /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "markdownlint.config": { 3 | "MD028": false, 4 | "MD025": { 5 | "front_matter_title": "" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /all-in-one/azuredeploy.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 | "adminUsername": { 6 | "value": "GEN-UNIQUE" 7 | }, 8 | "adminPasswordOrKey": { 9 | "value": "GEN-PASSWORD" 10 | }, 11 | "dnsLabelPrefix": { 12 | "value": "GEN-UNIQUE" 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /all-in-one/install.sh: -------------------------------------------------------------------------------- 1 | # Install Prerequisites 2 | sudo apt update 3 | sudo apt install apt-transport-https ca-certificates curl software-properties-common -y 4 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 5 | sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" 6 | sudo apt update 7 | sudo apt upgrade -y 8 | 9 | sudo apt install docker -y 10 | sudo apt install docker-compose -y 11 | sudo systemctl enable docker 12 | 13 | # Download and run sample docker compose file 14 | wget https://raw.githubusercontent.com/matthansen0/azure-openemr/main/all-in-one/docker-compose.yml 15 | docker-compose up -d 16 | 17 | # Checking Web Service Status 18 | echo "Waiting for web services." 19 | until $(curl --output /dev/null --silent --head --fail http://127.0.0.1:80); do 20 | printf '.' 21 | sleep 5 22 | done -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Matt Hansen 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 | -------------------------------------------------------------------------------- /all-in-one/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # Use admin/pass as user/password credentials to login to openemr (from OE_USER and OE_PASS below) 2 | # MYSQL_HOST and MYSQL_ROOT_PASS are required for openemr 3 | # MYSQL_USER, MYSQL_PASS, OE_USER, MYSQL_PASS are optional for openemr and 4 | # if not provided, then default to openemr, openemr, admin, and pass respectively. 5 | version: '3.1' 6 | services: 7 | mysql: 8 | restart: always 9 | image: mariadb:10.11 10 | command: ['mysqld','--character-set-server=utf8mb4'] 11 | volumes: 12 | - databasevolume:/var/lib/mysql 13 | environment: 14 | MYSQL_ROOT_PASSWORD: rootDBP@ass1 15 | openemr: 16 | restart: always 17 | image: openemr/openemr:7.0.2 18 | ports: 19 | - 80:80 20 | - 443:443 21 | volumes: 22 | - logvolume01:/var/log 23 | - sitevolume:/var/www/localhost/htdocs/openemr/sites 24 | environment: 25 | MYSQL_HOST: mysql 26 | MYSQL_ROOT_PASS: rootDBP@ass1 27 | MYSQL_USER: openemr 28 | MYSQL_PASS: emrDBP@ass1 29 | OE_USER: admin 30 | OE_PASS: openEMRonAzure! 31 | depends_on: 32 | - mysql 33 | volumes: 34 | logvolume01: {} 35 | sitevolume: {} 36 | databasevolume: {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenEMR on Azure 2 | 3 | 4 | This repository contains automation to deploy [OpenEMR](https://www.open-emr.org/) on Azure. Great work being done on this project on the [OpenEMR Repo](https://github.com/openemr/openemr). 5 | 6 | ## All-in-one: 7 | ### OpenEMR+MySQL Containers with Docker Compose on an Azure IaaS Virtual Machine 8 | 9 | [//]: # (The short URLs below are to show impact of this solution by tracking number of deployments. You can use the direct link if you wish - https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmatthansen0%2Fazure-openemr%2Fmain%2Fall-in-one%2Fazuredeploy.json) 10 | 11 | [![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://urls.hansencloud.com/openemr-allinone) 12 | [![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2Fmatthansen0%2Fazure-openemr%2Fmain%2Fall-in-one%2Fazuredeploy.json) 13 | 14 | 15 | This template allows you to deploy an Ubuntu Server 22.04-LTS VM with Docker 16 | and starts an OpenEMR container listening an port 80 which uses MySQL database running 17 | in a separate but linked Docker container, which are created using Docker Compose. The shell script validates service functionality before finishing; the deployment typically takes about 15 minutes. 18 | 19 | This deployment will listen on HTTP/80 and HTTPS/443 (with a self-signed cert) by default and has a public IP resources associated with it, if this is for an internal deployment please [dissociate the public IP address](https://docs.microsoft.com/en-us/azure/virtual-network/remove-public-ip-address-vm) from the VM. 20 | 21 | The ***default credentials*** for this deployment are in the [docker-compose.yml file](all-in-one/docker-compose.yml) and by default the login for OpenEMR is ``admin/openEMRonAzure!``. You can change these credentials using the steps below. 22 | 23 | ``go to administration->Users and you need to provide "Your Password:" - The password of the current user logged in. "User`s New Password:" - The new password to be changed.`` 24 | 25 | You may also want to [change the MySQL Credentials](https://www.mysqltutorial.org/mysql-changing-password.aspx) and update them in OpenEMR ``In order to change the mysql user and password you need to provide the correct credentials in the file sqlconf.php, which can be found under /sites/default/sqlconf.php``. 26 | 27 | ## IaaS Web & PaaS DB: 28 | ### Deployment of OpenEMR Docker Container to an Azure IaaS Virtual Machine + Azure MySQL 29 | 30 | This section has yet to be developed, feel free to submit a PR! 31 | 32 | 33 | ## ACI + PaaS DB: 34 | ### Deployment of OpenEMR Docker on ACI + Azure MySQL 35 | 36 | This section has yet to be developed, feel free to submit a PR! 37 | 38 | ## Other Deployment Options 39 | 40 | OpenEMR can be deployed directly on a WAMP or LAMP stack in IaaS, on Azure App Services, in ACI, or even AKS. It can use a local DB or one hosted by a VM directly, a container or Azure MySQL. There are many combinations of how to deploy this solution. Please feel free to submit a PR or an issue if you would like to see an alternative deployment method. 41 | 42 | ## Contributing: 43 | 44 | PRs and issues welcome! -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /all-in-one/azuredeploy.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "vmName": { 6 | "type": "string", 7 | "defaultValue": "OpenEMR", 8 | "metadata": { 9 | "description": "The name of you Virtual Machine." 10 | } 11 | }, 12 | "adminUsername": { 13 | "type": "string", 14 | "metadata": { 15 | "description": "Username for the Virtual Machine." 16 | } 17 | }, 18 | "authenticationType": { 19 | "type": "string", 20 | "defaultValue": "password", 21 | "allowedValues": [ 22 | "sshPublicKey", 23 | "password" 24 | ], 25 | "metadata": { 26 | "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." 27 | } 28 | }, 29 | "adminPasswordOrKey": { 30 | "type": "securestring", 31 | "metadata": { 32 | "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." 33 | } 34 | }, 35 | "dnsLabelPrefix": { 36 | "type": "string", 37 | "defaultValue": "[toLower(concat('OpenEMR-', uniqueString(resourceGroup().id)))]", 38 | "metadata": { 39 | "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." 40 | } 41 | }, 42 | "ubuntuOSVersion": { 43 | "type": "string", 44 | "defaultValue": "22_04-lts-gen2", 45 | "allowedValues": [ 46 | "22_04-lts-gen2" 47 | ], 48 | "metadata": { 49 | "description": "The Ubuntu version for the VM. This will pick a fully patched image of this given Ubuntu version." 50 | } 51 | }, 52 | "location": { 53 | "type": "string", 54 | "defaultValue": "[resourceGroup().location]", 55 | "metadata": { 56 | "description": "Location for all resources." 57 | } 58 | }, 59 | "VmSize": { 60 | "type": "string", 61 | "defaultValue": "Standard_D2s_v3", 62 | "metadata": { 63 | "description": "The size of the VM" 64 | } 65 | }, 66 | "virtualNetworkName": { 67 | "type": "string", 68 | "defaultValue": "vNet", 69 | "metadata": { 70 | "description": "Name of the VNET" 71 | } 72 | }, 73 | "subnetName": { 74 | "type": "string", 75 | "defaultValue": "Subnet", 76 | "metadata": { 77 | "description": "Name of the subnet in the virtual network" 78 | } 79 | }, 80 | "networkSecurityGroupName": { 81 | "type": "string", 82 | "defaultValue": "SecGroupNet", 83 | "metadata": { 84 | "description": "Name of the Network Security Group" 85 | } 86 | } 87 | }, 88 | "variables": { 89 | "publicIpAddressName": "[concat(parameters('vmName'), 'PublicIP' )]", 90 | "networkInterfaceName": "[concat(parameters('vmName'),'NetInt')]", 91 | "subnetRef": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('subnetName'))]", 92 | "osDiskType": "Standard_LRS", 93 | "subnetAddressPrefix": "10.1.0.0/24", 94 | "addressPrefix": "10.1.0.0/16", 95 | "linuxConfiguration": { 96 | "disablePasswordAuthentication": true, 97 | "ssh": { 98 | "publicKeys": [ 99 | { 100 | "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", 101 | "keyData": "[parameters('adminPasswordOrKey')]" 102 | } 103 | ] 104 | } 105 | } 106 | }, 107 | "resources": [ 108 | { 109 | "type": "Microsoft.Network/networkInterfaces", 110 | "apiVersion": "2020-06-01", 111 | "name": "[variables('networkInterfaceName')]", 112 | "location": "[parameters('location')]", 113 | "dependsOn": [ 114 | "[resourceId('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]", 115 | "[resourceId('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]", 116 | "[resourceId('Microsoft.Network/publicIpAddresses/', variables('publicIpAddressName'))]" 117 | ], 118 | "properties": { 119 | "ipConfigurations": [ 120 | { 121 | "name": "ipconfig1", 122 | "properties": { 123 | "subnet": { 124 | "id": "[variables('subnetRef')]" 125 | }, 126 | "privateIPAllocationMethod": "Dynamic", 127 | "publicIpAddress": { 128 | "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]" 129 | } 130 | } 131 | } 132 | ], 133 | "networkSecurityGroup": { 134 | "id": "[resourceId('Microsoft.Network/networkSecurityGroups',parameters('networkSecurityGroupName'))]" 135 | } 136 | } 137 | }, 138 | { 139 | "type": "Microsoft.Network/networkSecurityGroups", 140 | "apiVersion": "2020-06-01", 141 | "name": "[parameters('networkSecurityGroupName')]", 142 | "location": "[parameters('location')]", 143 | "properties": { 144 | "securityRules": [ 145 | { 146 | "name": "HTTP", 147 | "properties": { 148 | "priority": 1000, 149 | "protocol": "TCP", 150 | "access": "Allow", 151 | "direction": "Inbound", 152 | "sourceAddressPrefix": "*", 153 | "sourcePortRange": "*", 154 | "destinationAddressPrefix": "*", 155 | "destinationPortRange": "80" 156 | } 157 | }, 158 | { 159 | "name": "HTTPS", 160 | "properties": { 161 | "priority": 1001, 162 | "protocol": "TCP", 163 | "access": "Allow", 164 | "direction": "Inbound", 165 | "sourceAddressPrefix": "*", 166 | "sourcePortRange": "*", 167 | "destinationAddressPrefix": "*", 168 | "destinationPortRange": "443" 169 | } 170 | } 171 | ] 172 | } 173 | }, 174 | { 175 | "type": "Microsoft.Network/virtualNetworks", 176 | "apiVersion": "2020-06-01", 177 | "name": "[parameters('virtualNetworkName')]", 178 | "location": "[parameters('location')]", 179 | "properties": { 180 | "addressSpace": { 181 | "addressPrefixes": [ 182 | "[variables('addressPrefix')]" 183 | ] 184 | }, 185 | "subnets": [ 186 | { 187 | "name": "[parameters('subnetName')]", 188 | "properties": { 189 | "addressPrefix": "[variables('subnetAddressPrefix')]", 190 | "privateEndpointNetworkPolicies": "Enabled", 191 | "privateLinkServiceNetworkPolicies": "Enabled" 192 | } 193 | } 194 | ] 195 | } 196 | }, 197 | { 198 | "type": "Microsoft.Network/publicIpAddresses", 199 | "apiVersion": "2020-06-01", 200 | "name": "[variables('publicIpAddressName')]", 201 | "location": "[parameters('location')]", 202 | "sku": { 203 | "name": "Basic", 204 | "tier": "Regional" 205 | }, 206 | "properties": { 207 | "publicIpAllocationMethod": "Dynamic", 208 | "publicIPAddressVersion": "IPv4", 209 | "dnsSettings": { 210 | "domainNameLabel": "[parameters('dnsLabelPrefix')]" 211 | }, 212 | "idleTimeoutInMinutes": 4 213 | } 214 | }, 215 | { 216 | "type": "Microsoft.Compute/virtualMachines", 217 | "apiVersion": "2020-06-01", 218 | "name": "[parameters('vmName')]", 219 | "location": "[parameters('location')]", 220 | "dependsOn": [ 221 | "[resourceId('Microsoft.Network/networkInterfaces/', variables('networkInterfaceName'))]" 222 | ], 223 | "properties": { 224 | "hardwareProfile": { 225 | "vmSize": "[parameters('VmSize')]" 226 | }, 227 | "storageProfile": { 228 | "osDisk": { 229 | "createOption": "fromImage", 230 | "managedDisk": { 231 | "storageAccountType": "[variables('osDiskType')]" 232 | } 233 | }, 234 | "imageReference": { 235 | "publisher": "Canonical", 236 | "offer": "0001-com-ubuntu-server-jammy", 237 | "sku": "[parameters('ubuntuOSVersion')]", 238 | "version": "latest" 239 | } 240 | }, 241 | "networkProfile": { 242 | "networkInterfaces": [ 243 | { 244 | "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" 245 | } 246 | ] 247 | }, 248 | "osProfile": { 249 | "computerName": "[parameters('vmName')]", 250 | "adminUsername": "[parameters('adminUsername')]", 251 | "adminPassword": "[parameters('adminPasswordOrKey')]", 252 | "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('linuxConfiguration'))]" 253 | } 254 | } 255 | }, 256 | { 257 | "name": "OpenEMR/docker", 258 | "type": "Microsoft.Compute/virtualMachines/extensions", 259 | "apiVersion": "2019-07-01", 260 | "location": "[resourceGroup().location]", 261 | "tags": { 262 | "displayName": "docker compose" 263 | }, 264 | "dependsOn": [ 265 | "[parameters('vmName')]" 266 | ], 267 | "properties": { 268 | "publisher": "Microsoft.Azure.Extensions", 269 | "type": "CustomScript", 270 | "typeHandlerVersion": "2.1", 271 | "autoUpgradeMinorVersion": true, 272 | "settings": { 273 | "fileUris": [ 274 | "https://raw.githubusercontent.com/matthansen0/azure-openemr/main/all-in-one/install.sh" 275 | ] 276 | }, 277 | "protectedSettings": { 278 | "commandToExecute": "sh install.sh" 279 | } 280 | } 281 | } 282 | ], 283 | "outputs": { 284 | "adminUsername": { 285 | "type": "string", 286 | "value": "[parameters('adminUsername')]" 287 | }, 288 | "hostname": { 289 | "type": "string", 290 | "value": "[reference(variables('publicIPAddressName')).dnsSettings.fqdn]" 291 | }, 292 | "sshCommand": { 293 | "type": "string", 294 | "value": "[concat('ssh ', parameters('adminUsername'), '@', reference(variables('publicIPAddressName')).dnsSettings.fqdn)]" 295 | } 296 | } 297 | } --------------------------------------------------------------------------------