Code Monkey home page Code Monkey logo

fhir-server-samples's Introduction

⚠️ Thank you for your interest in our repository. As of May 13, 2022, this repository has been archived, and is no longer maintained or updated.

FHIR Server Samples

This respository contains example applications and scenarios that show use of the FHIR Server for Azure and the Azure API for FHIR.

The scenario is meant to illustrate how to connect a web application to the FHIR API. The scenario also illustrates features such as the SMART on FHIR Active Directory Proxy. It can be deployed using the Azure API for FHIR PaaS server:

Or the open source FHIR Server for Azure:

In both cases a storage account will be deploy and in this storage account there is a BLOB container called fhirimport, patient bundles generated with Synthea can dumped in this storage container and they will be ingested into the FHIR server. The bulk ingestion is performed by an Azure Function.

The environments can also optionally be configured to support $export. To enable $export, add the -EnableExport $true parameter to the script below. The $export operation will produce a new line delimited json (ndjson) for each resource type. These ndjson files are easily consumed with something like Databricks (Apache-Spark). Please see the analytics folder for some details and example queries. Note that the Databricks environment is not deployed automatically with the sandbox and must be set up separately.

Note: To enable $export you must have subscription rights that allow you to set data plane access roles for storage accounts, e.g. you must be a subscription owner.

Prerequisites

Before deploying the samples scenario, make sure you have Az and AzureAd powershell modules installed:

Install-Module Az
Install-Module AzureAd

The new Az module requires PowerShell version 5.1 or above installed on your computer. So if you have PowerShell version below 5.1, you need to update it. To check your PowerShell version, you can run:

$PSVersionTable.PSVersion

Currently, there is a bug with PowerShell Az Module version 4.6.1 confirmed with Azure ARM team. For now, please avoid using version 4.6.1. Version 4.5 and versions 4.7.0 or above should work fine. To check your Az module version, you can run:

Get-InstalledModule -Name Az

Deployment

To deploy the sample scenario, first clone this git repo and find the deployment scripts folder:

git clone https://github.com/Microsoft/fhir-server-samples
cd fhir-server-samples/deploy/scripts

Log into your Azure subscription:

Login-AzAccount

Connect to Azure AD with:

Connect-AzureAd -TenantDomain <AAD TenantDomain>

NOTE The connection to Azure AD can be made using a different tenant domain than the one tied to your Azure subscription. If you don't have privileges to create app registrations, users, etc. in your Azure AD tenant, you can create a new one, which will just be used for demo identities, etc.

Then, deploy the scenario with the Open Source FHIR Server for Azure:

.\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName <ENVIRONMENTNAME> -UsePaaS $false

or the managed Azure API for FHIR:

.\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName <ENVIRONMENTNAME> -UsePaaS $true

and to enable $export:

.\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName <ENVIRONMENTNAME> -UsePaaS $true -EnableExport $true

To delete the senario:

.\Delete-FhirServerSamplesEnvironment.ps1 -EnvironmentName <ENVIRONMENTNAME>

NOTE If you are using PowerShell Core on other platforms (macOS or Linux), please make sure to specify password in the command. You can do this by:

./Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName <ENVIRONMENTNAME> -UsePaaS <TRUE/FALSE> -AdminPassword $(ConvertTo-SecureString -AsPlainText -Force "<YOURPASSWORD>")

If the deployment is successful, you would see information like below being written on your terminal or CloudShell as the scripts run:

Current context is user: xxxx
FhirServer PS module is loaded
Current context is user: xxxx
Adding permission to keyvault for xxxx
Ensuring API application exists
Checking if UserPrincipalName exists
User not, will create.

DeploymentName          : xxxx
ResourceGroupName       : xxxx
ProvisioningState       : Succeeded
Timestamp               : 11/24/2020 10:30:18 PM
Mode                    : Incremental
TemplateLink            : 
                          Uri            : https://raw.githubusercontent.com/Microsoft/fhir-server-samples/master/deploy/templates/a
                          zuredeploy-sandbox.json
                          ContentVersion : 1.0.0.0
                          
Parameters              : 
                          Name                             Type                       Value     
                          ===============================  =========================  ==========
                          environmentName                  String                     xxxx
                          appServicePlanSku                String                     xxxx       
                          aadAuthority                     String                     
                          xxxx
                          aadFhirServerAudience            String                               
                          aadDashboardClientId             String                     xxxx
                          aadDashboardClientSecret         String                     xxxx
                          aadServiceClientId               String                     xxxx
                          aadServiceClientSecret           String                     xxxx
                          smartAppClientId                 String                     xxxx
                          fhirServerTemplateUrl            String                     
                          https://raw.githubusercontent.com/microsoft/fhir-server/master/samples/templates/default-azuredeploy.json
                          sqlAdminPassword                 SecureString                         
                          fhirDashboardJSTemplateUrl       String                     https://raw.githubusercontent.com/Microsoft/fh
                          ir-server-samples/master/deploy/templates/azuredeploy-fhirdashboard-js.json
                          fhirApiLocation                  String                     westus2   
                          fhirVersion                      String                     R4        
                          fhirImporterTemplateUrl          String                     https://raw.githubusercontent.com/Microsoft/fh
                          ir-server-samples/master/deploy/templates/azuredeploy-importer.json
                          smartAppTemplateUrl              String                               
                          fhirDashboardRepositoryUrl       String                     
                          https://github.com/Microsoft/fhir-server-samples
                          fhirDashboardRepositoryBranch    String                     master    
                          deployDashboardSourceCode        Bool                       True      
                          usePaaS                          Bool                       True      
                          accessPolicies                   Array                      [
                            {
                              "objectId": "xxxx"
                            },
                            {
                              "objectId": "xxxx"
                            },
                            {
                              "objectId": "xxxx"
                            }
                          ]
                          solutionType                     String                     FhirServerSamples
                          enableExport                     Bool                       False     
                          
Outputs                 : 
DeploymentDebugLogLevel : 

Warming up site...

Key   : fhirServerUrl
Value : https://xxxx.azurehealthcareapis.com
Name  : fhirServerUrl


Key   : dashboardUserUpn
Value : xxxx
Name  : dashboardUserUpn


Key   : dashboardUserPassword
Value : xxxx
Name  : dashboardUserPassword

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

fhir-server-samples's People

Contributors

brendankowitz avatar c-w avatar cunninghamjc avatar dependabot[bot] avatar ginalee-dotcom avatar hansenms avatar joedrowan avatar leecrossley avatar microsoftopensource avatar msftgits avatar patelsurajk avatar robwafle avatar shawndeggans avatar shmartel avatar tusv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fhir-server-samples's Issues

[Bug] Invalid deploy script-url fetched from fhir-server repository

While setting up the OS variant with SQL server, I noticed that there are some problems with the latest version.

The script that is used as deploy-script for SQL server variant is invalid and does not exist anymore.

Apparently they have been merged into one file.

Proposed solution:

  • Update the script reference
    • if possible, use a tagged version of the repository
  • Add another parameter for the solutionType here, which may be passed through and defaults to FhirServerCosmosDB. It should provide same values as the target template
  • Last but not least, the condition here must be changed, since the file-name does not contain "sql" anymore

I'd be happy to send a PR your way, but there was another problem in the fire-server repository when using SQL, for which I've created a PR already.

error creating resource

I followed the readme instructions with both a new tenant and an existing one and I am getting the following error - script continues and fives me a url but no resources are created.
.\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName fhirj2rr -UsePaaS $false Current context is user: XXXXXX fhirj2rr FhirServer PS module is loaded Creating keyvault with the name fhirj2rr-ts Current context is user: [email protected] Adding permission to keyvault for 595750b9-846e-4f16-afa6-7f5ed5f5fa60 Ensuring API application exists Checking if UserPrincipalName exists User not, will create. New-AzureADApplicationPasswordCredential : Error occurred while executing GetApplication Code: Request_ResourceNotFound Message: Resource 'ad29f0f6-8669-4d88-8a07-a070a4569434' does not exist or one of its queried reference-property objects are not present. RequestId: 3d84ab92-0d1c-4125-87fd-371a37c3bcb5 DateTimeStamp: Wed, 17 Jun 2020 19:35:11 GMT HttpStatusCode: NotFound

Issue with Deployment script

Hi Team,

I ran below script for creation of FHIR server but Azure sandbox deployment failed with below error.

.\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName fhirazure -UsePaaS $true -EnableExport $true

ERROR:-

{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"BadRequest","message":"Service name is not available."}]}

Can you please help me to fix this issue.

Thanks & Regards,
Venkatesh Tarra.

[Question] Auth options

FHIR server uses Azure AD to authenticate clients, but I'm also interested in creating a patient self-help portal, where they can manage, update and change their medical info. Does this mean I'll have to create new AD account for all of the users? Or must I add another API on top of the FHIR server that proxies/forwards all to it to manage user auth?

I was hoping this would help with the creation of a new example, or some help regarding what direction to take to implement patient login functionality?

Build FhirDashboard from VS Code

I tried to build FhirDashboard javascript project from Visual Studio Code and found config issue as,

Need config file (/.auth/me) which is mentioned in below code snippet,

image

I am able to successfully launch dashboard application as, but config file is not present so not able to get details,,,

image

Please provide the same file and any other dependency so I can build from outside..

Create-FhirServerSamplesEnvironment.ps1 failing to run as documented

Trying to use the command below by reading through the script, here are the issues.

  1. Script defaults back to WestUS and WestUS2

  2. Scrip does not process the SQL Admin Password

Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName uh-test-api -EnvironmentLocation eastus -FHIRApiLocation eastus -UsePaaS $false -PersistenceProvider sql -SqlAdminPassword nimda1234 -AdminPassword nimda6789 -EnableExport $true

Unable to deploy with deploy scripts

When following the instructions I am getting multiple errors when trying to deploy from local or from the shell. Log below

**_Ensuring API application exists
Checking if UserPrincipalName exists
User not, will create.
InvalidOperation: /home/fhirdeploy/fhir-server-samples/deploy/scripts/Create-FhirServerSamplesAuthConfig.ps1:170
Line |
170 | $password = [System.Web.Security.Membership]::GeneratePassword(16 …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Unable to find type [System.Web.Security.Membership].

ConvertTo-SecureString: /fhirdeploy/fhir-server-samples/deploy/scripts/Create-FhirServerSamplesAuthConfig.ps1:171
Line |
171 | $passwordSecureString = ConvertTo-SecureString $password -AsPlain …
| ~~~~~~~~~
| Cannot bind argument to parameter 'String' because it is null.

New-AzureADUser: /home/fhirdeploy/fhir-server-samples/deploy/scripts/Create-FhirServerSamplesAuthConfig.ps1:183
Line |
183 | … $aadUser = New-AzureADUser -DisplayName $userId -PasswordProfile $Pa …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Error occurred while executing NewUser Code: Request_BadRequest Message: A password must be specified to create a new user. RequestId: *************43704517 DateTimeStamp: Sun, 20 Dec 2020 17:57:30 GMT
| HttpStatusCode: BadRequest HttpStatusDescription: Bad Request HttpResponseStatus: Completed

Set-AzKeyVaultSecret: /home//fhirdeploy/fhir-server-samples/deploy/scripts/Create-FhirServerSamplesAuthConfig.ps1:188
Line |
188 | … e -Name "$userId-password" -SecretValue $passwordSecureString | Out-N …
| ~~~~~~~~~~~~~~~~~~~~~
| Cannot bind argument to parameter 'SecretValue' because it is null.

Exception: /home//fhirdeploy/fhir-server-samples/deploy/scripts/fhir-server/samples/scripts/PowerShell/FhirServer/Public/Set-FhirServerUserAppRoleAssignments.ps1:43
Line |
43 | throw "User not found"
| ~~~~~~~~~~~~~~~~~~~~~~
| User not found_**

Possible to call Azure FHIR API using MSAL authentication process

I am using MSAL daemon server authentication mechanism to call FHIR API using example specified in below link,
https://github.com/Azure-Samples/active-directory-dotnetcore-daemon-v2

I tried with sample application, able to retrieve access token using MSAL library but its giving forbidden error while calling FHIR API from daemon process, Is it possible to access FHIR API using daemon application?

image

Its mentioned in MSAL sample application that we need application permission in order to access API, let me know if it is possible to provide application permission for FHIR API from app registration, currently application permission for Azure Healthcare API is disabled and not able to add as shown in below image,

image

Script issue

Create-FhirServerSamplesEnvironment.ps1: Cannot validate argument on parameter 'EnvironmentName'. The character length of the 14 argument is too long. Shorten the character length of the argument so it is fewer than or equal to "12" characters, and then try the command again.

AzureAd Module is not Cross Platform

Overview
I'm currently going through the FHIR OpenHack on my Mac. The first issue I run into is the inability to use Connect-AzureAd after installing the AzureAd module. After some quick research, I see the current module published in PsGallery is Windows only due to .NET Framework dependencies.

Workaround
I was able to find a workaround here. For a short term fix, should there be some directions for users not on Windows? This would open up the repo to a much larger user base, even if this information is hidden from the main README.

Register-PackageSource -Trusted -ProviderName 'PowerShellGet' -Name 'Posh Test Gallery' -Location https://www.poshtestgallery.com/api/v2/
Install-Module -Name AzureAD.Standard.Preview
Import-Module AzureAD.Standard.Preview

Long Term Solution
Long term I think syncing with the AzureAD product group and determining if they will be releasing an updates, non-private preview version of this module.

  • If so, this will be an easy long term fix; just use the preview until the mature version is released
  • If not, moving away from the AzureAd module as it's not being updated

Unable to find type [System.Web.Security.Membership] error on macOS powershell

Checking if UserPrincipalName exists
User not, will create.
Unable to find type [System.Web.Security.Membership].
At /Users/azeemshaikh/Documents/Azure/fhir-server-samples/deploy/scripts/Create-FhirServerSamplesAuthConfig.ps1:160 char:17

  • $password = [System.Web.Security.Membership]::GeneratePassword(16 ...
  • CategoryInfo : InvalidOperation: (System.Web.Security.Membership:TypeName) [], RuntimeException
  • FullyQualifiedErrorId : TypeNotFound

I'm running the script on macOS Mojave PowerShell 6.2.4

Invalid cmdlet Connect-AzureAD

Describe the bug
In the Deployment section of the main README the command "Connect-AzureAd -TenantDomain " will fail because Connect-AzureAd is not recognized.

  • What is your PowerShell version? 7.1.2
  • What is your Az version? 5.6.0

To Reproduce
Steps to reproduce the behavior, including exact commands you are running:

  1. At the PowerShell prompt
  2. Enter the command "Connect-AzureAd -TenantDomain "
  3. See error:
    Connect-AzureAd: The term 'Connect-AzureAd' is not recognized as a name of a cmdlet, function, script file, or executable program.
    Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Expected behavior
Command successfully executed.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS
  • Version: 11.2.2

FHIR Importer

Hi,

I have deployed azuredeploy-importer.json for fhir importer for our Azure API for fhir. I have an issue that bundles are not getting loaded failing with the error.

"AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials.

I found this error message in fhirBundleBlobTriger monitor. Can you please tell me what went wrong.

Thanks and Regards!

Issue in creating the FHIR Server sample environment

Hi,

We are having an issue when creating the FHIR Server sample environment. We tried below commands but in both cases, we are getting errors. Can you please guide us?

.\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName myfhirdemo1 -UsePaaS $true
.\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName myfhirdemo1 -UsePaaS $false

Below are the errors:

PS E:\fhir-server-samples\deploy\scripts> .\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName myfhirdemo1 -UsePaaS $false Current context is user:
myfhirdemo1
FhirServer PS module is loaded
Creating keyvault with the name myfhirdemo1-ts
Current context is user:
Adding permission to keyvault for
Ensuring API application exists
Checking if UserPrincipalName exists
User not, will create.
The property 'SecretValueText' cannot be found on this object. Verify that the property exists.
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:154 char:1

  • $confidentialClientId = (Get-AzKeyVaultSecret -VaultName "${Environme ...
  •   + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
      + FullyQualifiedErrorId : PropertyNotFoundStrict
    
    

The property 'SecretValueText' cannot be found on this object. Verify that the property exists.
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:155 char:1

  • $confidentialClientSecret = (Get-AzKeyVaultSecret -VaultName "${Envir ...
  •   + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
      + FullyQualifiedErrorId : PropertyNotFoundStrict
    
    

The property 'SecretValueText' cannot be found on this object. Verify that the property exists.
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:156 char:1

  • $serviceClientId = (Get-AzKeyVaultSecret -VaultName "${EnvironmentNam ...
  •   + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
      + FullyQualifiedErrorId : PropertyNotFoundStrict
    
    

The property 'SecretValueText' cannot be found on this object. Verify that the property exists.
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:157 char:1

  • $serviceClientSecret = (Get-AzKeyVaultSecret -VaultName "${Environmen ...
  •   + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
      + FullyQualifiedErrorId : PropertyNotFoundStrict
    
    

Get-AzureADServicePrincipal : Error occurred while executing GetServicePrincipals
Code: Request_UnsupportedQuery
Message: Unsupported or invalid query filter clause specified for property 'appId' of resource 'ServicePrincipal'.
RequestId:
DateTimeStamp: Fri, 06 Nov 2020 07:27:03 GMT
HttpStatusCode: BadRequest
HttpStatusDescription: Bad Request
HttpResponseStatus: Completed
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:158 char:27

  • ... ObjectId = (Get-AzureADServicePrincipal -Filter "AppId eq '$serviceCl ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Get-AzureADServicePrincipal], ApiException
    • FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.GetServ
      icePrincipal

The property 'SecretValueText' cannot be found on this object. Verify that the property exists.
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:159 char:1

  • $dashboardUserUpn = (Get-AzKeyVaultSecret -VaultName "${EnvironmentN ...
  •   + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
      + FullyQualifiedErrorId : PropertyNotFoundStrict
    
    

Get-AzureADUser : Error occurred while executing GetUsers
Code: Request_UnsupportedQuery
Message: Unsupported or invalid query filter clause specified for property 'userPrincipalName' of resource 'User'.
RequestId:
DateTimeStamp: Fri, 06 Nov 2020 07:27:07 GMT
HttpStatusCode: BadRequest
HttpStatusDescription: Bad Request
HttpResponseStatus: Completed
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:160 char:22

  • ... dUserOid = (Get-AzureADUser -Filter "UserPrincipalName eq '$dashboard ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Get-AzureADUser], ApiException
    • FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.GetUser

The property 'SecretValueText' cannot be found on this object. Verify that the property exists.
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:161 char:1

  • $dashboardUserPassword = (Get-AzKeyVaultSecret -VaultName "${Environ ...
  •   + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
      + FullyQualifiedErrorId : PropertyNotFoundStrict
    
    

The property 'SecretValueText' cannot be found on this object. Verify that the property exists.
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:162 char:1

  • $publicClientId = (Get-AzKeyVaultSecret -VaultName "${EnvironmentName ...
  •   + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
      + FullyQualifiedErrorId : PropertyNotFoundStrict
    
    

You cannot call a method on a null-valued expression.
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:166 char:1

  • $accessPolicies += @{ "objectId" = $serviceClientObjectId.ToString() ...
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : InvokeMethodOnNull
    
    

You cannot call a method on a null-valued expression.
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:167 char:1

  • $accessPolicies += @{ "objectId" = $dashboardUserOid.ToString() }
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : InvokeMethodOnNull
    
    

New-AzResourceGroupDeployment : Cannot bind argument to parameter 'aadDashboardClientId' because it is null.
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:187 char:323

  • ... ity $aadAuthority -aadDashboardClientId $confidentialClientId -aadDas ...
  •                                         ~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [New-AzResourceGroupDeployment], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.Azure.Commands.ResourceManager.
      Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet

Warming up site...
Invoke-WebRequest : The remote name could not be resolved: 'myfhirdemo1srvr.azurewebsites.net'
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:190 char:1

  • Invoke-WebRequest -Uri "${fhirServerUrl}/metadata" | Out-Null
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
     eption
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    
    

Invoke-WebRequest : The remote name could not be resolved: 'myfhirdemo1imp.azurewebsites.net'
At E:\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:192 char:1

  • Invoke-WebRequest -Uri $functionAppUrl | Out-Null
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
     eption
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    

403 response when trying to access resources

I have a problem after setting up the open source FHIR Server for Azure. I followed the steps as described in the README yet when I open the dashboard I get a 403 response when trying to fetch the Patients. The token seems to be generated (I logged in using the same account I used to setup the environment on Azure).

So I saw #66 and tried to see if the solutions there would help. I tried to see if my account had the proper roles and added myself as owner of the <name>srvr.azurewebsites.net App in Azure Active Directory. Now, I am an absolute newbie when it comes to Azure so I'm not sure if I did it the proper way but it did not solve things.

So I tried to follow the instructions here: https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow and I am able to generate a token but still I get a 403 when trying to access the API endpoints (also in Postman).

Does anyone have an idea what I'm doing wrong? Any help is greatly appreciated!

Error in creating sample, Template parameter JToken type is not valid

I'm trying to create the sample server for importing some test data, but I'm getting an error:

Here is the command I'm running:
.\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName avfhir -UsePaaS $true

And here is the output.

Current context is user: XXXXX
Current context is user: XXXXX
avfhir
FhirServer PS module is loaded
Creating keyvault with the name avfhir-ts
WARNING: Breaking changes in the cmdlet 'New-AzKeyVault' :
WARNING:  - The ability to create new key vaults with soft delete disabled will be deprecated by December 2020. All key
 vaults will be required to have soft delete enabled. Please see the following documentation for additional guidance.
https://docs.microsoft.com/azure/key-vault/general/soft-delete-change

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: The provided information does not map to an AD object id.
WARNING: Access policy is not set. No user or application have access permission to use this vault. This can happen if
the vault was created by a service principal. Please use Set-AzKeyVaultAccessPolicy to set access policies.
Current context is user: XXXXX
Current context is user: XXXXX
Adding permission to keyvault for bb81b944-1be0-4118-9c2c-3834a636cfb5
Ensuring API application exists
Checking if UserPrincipalName exists
User not, will create.
WARNING: Breaking changes in the cmdlet 'Set-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Set-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Set-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Set-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Set-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Set-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Set-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Get-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSDeletedKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Get-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSDeletedKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Get-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSDeletedKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Get-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSDeletedKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Get-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSDeletedKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Get-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSDeletedKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
WARNING: Breaking changes in the cmdlet 'Get-AzKeyVaultSecret' :
WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING:  - "The output type 'Microsoft.Azure.Commands.KeyVault.Models.PSDeletedKeyVaultSecret' is changing"
 - The following properties in the output type are being deprecated :
 'SecretValueText'

WARNING: Note :The change is expected to take effect from the version :  '3.0.0'

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other
information on breaking changes in Azure PowerShell.
New-AzResourceGroupDeployment : 5:30:34 PM - Error: Code=InvalidTemplate; Message=Deployment template validation
failed: 'Template parameter JToken type is not valid. Expected 'String, Uri'. Actual 'Object'. Please see
https://aka.ms/resource-manager-parameter-files for usage details.'.
At C:\dev\FHIR\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:187 char:1
+ New-AzResourceGroupDeployment -TemplateUri $sandboxTemplate -environm ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDep
   loymentCmdlet

New-AzResourceGroupDeployment : The deployment validation failed
At C:\dev\FHIR\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:187 char:1
+ New-AzResourceGroupDeployment -TemplateUri $sandboxTemplate -environm ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzResourceGroupDeployment], InvalidOperationException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDep
   loymentCmdlet

Warming up site...
Invoke-WebRequest : The remote name could not be resolved: 'avfhir.azurehealthcareapis.com'
At C:\dev\FHIR\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:190 char:1
+ Invoke-WebRequest -Uri "${fhirServerUrl}/metadata" | Out-Null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Invoke-WebRequest : The remote name could not be resolved: 'avfhirimp.azurewebsites.net'
At C:\dev\FHIR\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:192 char:1
+ Invoke-WebRequest -Uri $functionAppUrl | Out-Null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand


Name                           Value
----                           -----
fhirServerUrl                  https://avfhir.azurehealthcareapis.com
dashboardUserPassword          WA;oA]XG%I>V!RzF
dashboardUserUpn               avfhir-admin@XXXXXXXX
dashboardUrl                   https://avfhirdash.azurewebsites.net

Deploy Script doesn't start deploy

Hello,

After logging in an account where I'm admin and have all permissions, I'm trying to deploy the managed Azure API for FHIR by running the following command:
.\Create-FhirServerSamplesAuthConfig.ps1 -EnvironmentName duphill2 -UsePaaS $true

Unfortunately, the only outcome is:

  • Creation of the Resource group "duphill2"
  • Creation of the Key vault "duphill2-ts" inside the resource group

The feedback on the powershell console is:

C:\new\fhir-server-samples\deploy\scripts [master ≡]> .\Create-FhirServerSamplesAuthConfig.ps1 -EnvironmentName duphill2 -UsePaaS $false

duphill2
FhirServer PS module is loaded
Creating keyvault with the name duphill2-ts
WARNING: The provided information does not map to an AD object id.
WARNING: Access policy is not set. No user or application have access permission to use this vault. This can happen if the vault was created by a
service principal. Please use Set-AzKeyVaultAccessPolicy to set access policies.
Current context is user: ...@....
Current context is user: ...@....
Adding permission to keyvault for ....
Ensuring API application exists
Checking if UserPrincipalName exists
User not, will create.

These are my PowerShell modules:

Version    Name                                Repository           Description
-------    ----                                ----------           -----------
5.2.0      Az                                  PSGallery            Microsoft Azure PowerShell - Cmdlets to manage resources in Azure. This module i...
2.2.2      Az.Accounts                         PSGallery            Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Re...
1.1.1      Az.Advisor                          PSGallery            Microsoft Azure PowerShell - Azure Advisor Cmdlets for Advisor in Windows PowerS...
2.0.1      Az.Aks                              PSGallery            Microsoft Azure PowerShell - Azure managed Kubernetes cmdlets for Windows PowerS...
1.1.4      Az.AnalysisServices                 PSGallery            Microsoft Azure PowerShell - Analysis Services cmdlets for Windows PowerShell an...
2.2.0      Az.ApiManagement                    PSGallery            Microsoft Azure PowerShell - Api Management service cmdlets for Azure Resource M...
1.0.0      Az.AppConfiguration                 PSGallery            Microsoft Azure PowerShell: AppConfiguration cmdlets
1.1.0      Az.ApplicationInsights              PSGallery            Microsoft Azure PowerShell - Application Insights management cmdlets for Azure R...
1.4.0      Az.Automation                       PSGallery            Microsoft Azure PowerShell - Automation service cmdlets for Azure Resource Manag...
3.1.0      Az.Batch                            PSGallery            Microsoft Azure PowerShell - Batch service cmdlets for Azure Resource Manager in...
2.0.0      Az.Billing                          PSGallery            Microsoft Azure PowerShell - Billing service cmdlets for Azure Resource Manager ...
1.6.0      Az.Cdn                              PSGallery            Microsoft Azure PowerShell - CDN service cmdlets for Azure Resource Manager in W...
1.8.0      Az.CognitiveServices                PSGallery            Microsoft Azure PowerShell - Cognitive Services management cmdlets for Azure Res...
4.7.0      Az.Compute                          PSGallery            Microsoft Azure PowerShell - Compute service cmdlets for Azure Resource Manager ...
1.0.3      Az.ContainerInstance                PSGallery            Microsoft Azure PowerShell - Container Instance cmdlets for Azure Resource Manag...
2.1.0      Az.ContainerRegistry                PSGallery            Microsoft Azure PowerShell - Container Registry service cmdlets for Azure Resour...
1.1.0      Az.DataBoxEdge                      PSGallery            Microsoft Azure PowerShell - DataBoxEdge service cmdlets for Azure Resource Mana...
1.0.1      Az.Databricks                       PSGallery            Microsoft Azure PowerShell: Databricks cmdlets
1.11.2     Az.DataFactory                      PSGallery            Microsoft Azure PowerShell - Data Factory service cmdlets for Azure Resource Man...
1.0.2      Az.DataLakeAnalytics                PSGallery            Microsoft Azure PowerShell - Data Lake Analytics in Windows PowerShell and Power...
1.3.0      Az.DataLakeStore                    PSGallery            Microsoft Azure PowerShell - Azure Data Lake Store cmdlets in Windows PowerShell...
1.0.0      Az.DataShare                        PSGallery            Microsoft Azure PowerShell - DataShare service cmdlets for Azure Resource Manage...
1.1.0      Az.DeploymentManager                PSGallery            PowerShell .Net Core Microsoft Azure PowerShell - Deployment Manager cmdlets for...
2.0.1      Az.DesktopVirtualization            PSGallery            Microsoft Azure PowerShell: DesktopVirtualization cmdlets
1.0.2      Az.DevTestLabs                      PSGallery            Microsoft Azure PowerShell - DevTest Labs service cmdlets for Azure Resource Man...
1.1.2      Az.Dns                              PSGallery            Microsoft Azure PowerShell - DNS service cmdlets for Azure Resource Manager in W...
1.3.0      Az.EventGrid                        PSGallery            Microsoft Azure PowerShell - Event Grid service cmdlets for Azure Resource Manag...
1.7.1      Az.EventHub                         PSGallery            Microsoft Azure PowerShell - Event Hubs service cmdlets for Azure Resource Manag...
1.6.1      Az.FrontDoor                        PSGallery            Microsoft Azure PowerShell - Front Door service cmdlets for Azure Resource Manag...
2.0.0      Az.Functions                        PSGallery            Microsoft Azure PowerShell - Azure Functions service cmdlets for Azure Resource ...
4.1.0      Az.HDInsight                        PSGallery            Microsoft Azure PowerShell - HDInsight service cmdlets for Azure Resource Manage...
1.2.0      Az.HealthcareApis                   PSGallery            Microsoft Azure PowerShell - HealthcareApis management cmdlets for Azure Resourc...
2.7.1      Az.IotHub                           PSGallery            Microsoft Azure PowerShell - IoT Hub service cmdlets for Azure Resource Manager ...
3.2.0      Az.KeyVault                         PSGallery            Microsoft Azure PowerShell - Key Vault service cmdlets for Azure Resource Manage...
1.0.0      Az.Kusto                            PSGallery            Microsoft Azure PowerShell: Kusto cmdlets
1.4.0      Az.LogicApp                         PSGallery            Microsoft Azure PowerShell - Logic Apps cmdlets for Azure Resource Manager in Wi...
1.1.3      Az.MachineLearning                  PSGallery            Microsoft Azure PowerShell - Machine Learning Web Services cmdlets for Azure Res...
1.1.0      Az.Maintenance                      PSGallery            Microsoft Azure PowerShell - Maintenance cmdlets for Azure Resource Manager in W...
2.0.0      Az.ManagedServices                  PSGallery            Microsoft Azure PowerShell - ManagedServices cmdlets for Azure Resource Manager
1.0.2      Az.MarketplaceOrdering              PSGallery            Microsoft Azure PowerShell - Marketplace Ordering agreements service cmdlets for...
1.1.1      Az.Media                            PSGallery            Microsoft Azure PowerShell - Media service cmdlets for Azure Resource Manager in...
2.3.0      Az.Monitor                          PSGallery            Microsoft Azure PowerShell - Monitor service cmdlets for Azure Resource Manager ...
4.3.0      Az.Network                          PSGallery            Microsoft Azure PowerShell - Networking service cmdlets for Azure Resource Manag...
1.1.1      Az.NotificationHubs                 PSGallery            Microsoft Azure PowerShell - Notification Hubs cmdlets for Azure Resource Manage...
2.3.0      Az.OperationalInsights              PSGallery            Microsoft Azure PowerShell - Operational Insights service cmdlets for Azure Reso...
1.3.1      Az.PolicyInsights                   PSGallery            Microsoft Azure PowerShell - Azure Policy Insights cmdlets for Windows PowerShel...
1.1.2      Az.PowerBIEmbedded                  PSGallery            Microsoft Azure PowerShell - Power BI Embedded service management cmdlets for Az...
1.0.3      Az.PrivateDns                       PSGallery            Microsoft Azure PowerShell - Private DNS service cmdlets for Azure Resource Mana...
3.1.0      Az.RecoveryServices                 PSGallery            Microsoft Azure PowerShell - Recovery Services cmdlets for Azure Resource Manage...
1.4.0      Az.RedisCache                       PSGallery            Microsoft Azure PowerShell - Redis Cache service cmdlets for Azure Resource Mana...
1.0.3      Az.Relay                            PSGallery            Microsoft Azure PowerShell - Relay service cmdlets for Azure Resource Manager in...
3.1.0      Az.Resources                        PSGallery            Microsoft Azure PowerShell - Azure Resource Manager and Active Directory cmdlets...
1.4.1      Az.ServiceBus                       PSGallery            Microsoft Azure PowerShell - Service Bus service cmdlets for Azure Resource Mana...
2.2.1      Az.ServiceFabric                    PSGallery            Microsoft Azure PowerShell - Service Fabric cmdlets for Azure Resource Manager i...
1.2.0      Az.SignalR                          PSGallery            Microsoft Azure PowerShell - Azure SignalR service commands for Windows PowerShe...
2.13.0     Az.Sql                              PSGallery            Microsoft Azure PowerShell - SQL service cmdlets for Azure Resource Manager in W...
1.1.0      Az.SqlVirtualMachine                PSGallery            Microsoft Azure PowerShell - SqlVirtualMachine service cmdlets for Azure Resourc...
3.1.0      Az.Storage                          PSGallery            Microsoft Azure PowerShell - Storage service data plane and management cmdlets f...
1.4.0      Az.StorageSync                      PSGallery            Microsoft Azure PowerShell - Storage Sync cmdlets in Windows PowerShell and Powe...
1.0.1      Az.StreamAnalytics                  PSGallery            Microsoft Azure PowerShell - Stream Analytics service cmdlets for Azure Resource...
1.0.0      Az.Support                          PSGallery            Microsoft Azure PowerShell - Azure Support cmdlets for Azure Resource Manager in...
1.0.4      Az.TrafficManager                   PSGallery            Microsoft Azure PowerShell - Traffic Manager service cmdlets for Azure Resource ...
2.1.1      Az.Websites                         PSGallery            Microsoft Azure PowerShell - App Service (Web Apps) service cmdlets for Azure Re...
2.0.2.128  AzureAD                             PSGallery            Azure Active Directory V2 General Availability Module....
0.7.3      posh-git                            PSGallery            Provides prompt with Git status summary information and tab completion for Git c...

Am I missing something?

Deploying samples environment fails on SecretValueText

I had an issue deploying the samples environment with command .\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName <ENVIRONMENTNAME> -UsePaaS $true. The error I get from Deploy Script is...
The property 'SecretValueText' cannot be found on this object.

It looks like SecretValueText is deprecated. I updated the script with the following and worked perfectly! Hope this helps someone.

# DEPRECATED SecretValueText
#$confidentialClientId = (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-confidential-client-id").SecretValueText
#$confidentialClientSecret = (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-confidential-client-secret").SecretValueText
#$serviceClientId = (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-service-client-id").SecretValueText
#$serviceClientSecret = (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-service-client-secret").SecretValueText
#$serviceClientObjectId = (Get-AzureADServicePrincipal -Filter "AppId eq '$serviceClientId'").ObjectId
#$dashboardUserUpn  = (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-admin-upn").SecretValueText
#$dashboardUserOid = (Get-AzureADUser -Filter "UserPrincipalName eq '$dashboardUserUpn'").ObjectId
#$dashboardUserPassword  = (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-admin-password").SecretValueText
#$publicClientId = (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-public-client-id").SecretValueText

# New way to get Secret Value
$confidentialClientId = [System.Net.NetworkCredential]::new("", (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-confidential-client-id").SecretValue).Password
$confidentialClientSecret = [System.Net.NetworkCredential]::new("", (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-confidential-client-secret").SecretValue).Password
$serviceClientId = [System.Net.NetworkCredential]::new("", (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-service-client-id").SecretValue).Password
$serviceClientSecret = [System.Net.NetworkCredential]::new("", (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-service-client-secret").SecretValue).Password
$serviceClientObjectId = (Get-AzureADServicePrincipal -Filter "AppId eq '$serviceClientId'").ObjectId
$dashboardUserUpn  = [System.Net.NetworkCredential]::new("", (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-admin-upn").SecretValue).Password
$dashboardUserOid = (Get-AzureADUser -Filter "UserPrincipalName eq '$dashboardUserUpn'").ObjectId
$dashboardUserPassword  = [System.Net.NetworkCredential]::new("", (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-admin-password").SecretValue).Password
$publicClientId = [System.Net.NetworkCredential]::new("", (Get-AzKeyVaultSecret -VaultName "${EnvironmentName}-ts" -Name "${EnvironmentName}-public-client-id").SecretValue).Password

Better Warning, Replacement, or Removal or FHIR Admin User Password Generation

Overview
I'm currently going through the FHIR OpenHack on my Mac. When running Create-FhirServerSamplesEnvironment.ps1 I get the below error.

image

I know there is already an issue around this, but I think changing the code to make the script usable without reading the issues would be a better experience for new developers using a *nix OS.

Thoughts for a fix

  • Easiest solution would be to check for the existence of the library on the system and throw a more user friendly message if it cannot be found. This message should instruct the user to add the AdminPassword parameter.
  • Second possible solution would be to replace it with a different, cross-platform approach. This may require adding another function to the module/script as there isn't a equal method in .NET Core (see below for more).
  • Third solution would be to just remove the automatic password generation, and force the user to always supply it. I think the best arguments for this are in a .NET Core issue about replacing the Windows library.

Growth Chart Code Deploy Failure

I was unable to redeploy/sync code from the repository for the growth web app, as I was encountering the following error:
npm ERR! Error: Method Not Allowed
npm ERR! at errorResponse(\add-named.js)....

I was able to resolve the issue by adding the
"WEBSITE_NODE_DEFAULT_VERSION" application setting and assigning it a value of "8.10.0"

Please update the file below to include this app setting.

fhir-server-samples/deploy/templates/azuredeploy-smart-app.json

Install-Module for AzureAD missing

Michael & gang,

I would add in a line above the "Connect-AzureAD" command to include "Install-Module AzureAD" b/c that is not part of the normal AzureRM module.

Thanks!

Deployment not working

Describe the bug
Deployment not starting after successfully logging to azure accounts

  • What is your PowerShell version? 5.1
  • What is your Az version? 2.34.1

To Reproduce
Steps to reproduce the behavior, including exact commands you are running:

  1. Login-AzAccount
  2. Connect-AzureAd -TenantDomain
  3. .\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName fhirready009 -UsePaaS $true
  4. Please log in to Azure RM with Login-AzAccount cmdlet before proceeding

Expected behavior
Deployment is successful

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. iOS] windows 11
  • Browser [e.g. chrome, safari] edge
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Unable to create non PaaS sample environment with sql server due to reference to invalid template

Describe the bug
Creating non-PaaS sample environment with sql server is failing with following errror.

New-AzResourceGroupDeployment: /home/my/fhir-server-samples/deploy/scripts/Create-FhirServerSamplesEnvironment.ps1:197
Line |
 197 |  New-AzResourceGroupDeployment -TemplateUri $sandboxTemplate -environm …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 8:27:26 PM - Error: Code=InvalidContentLink; Message=Unable to download deployment content from
     | 'https://raw.githubusercontent.com/microsoft/fhir-server/master/samples/templates/default-azuredeploy-sql.json'. The tracking Id is
     | 'a8e0163d-bb4c-4440-a604-21df446fe750'. Please see https://aka.ms/arm-deploy for usage details.

Doesn't look like the template is valid since it doesn't exist at that location. It looks like we are supposed to use same template for both cosmos/sql but pass different values for parameters.

Code snippet
https://github.com/microsoft/fhir-server-samples/blob/master/deploy/scripts/Create-FhirServerSamplesEnvironment.ps1#L153-L158

#Template URLs
$fhirServerTemplateUrl = "https://raw.githubusercontent.com/microsoft/fhir-server/master/samples/templates/default-azuredeploy.json"
if ($PersistenceProvider -eq 'sql')
{
    $fhirServerTemplateUrl = "https://raw.githubusercontent.com/microsoft/fhir-server/master/samples/templates/default-azuredeploy-sql.json"
}
  • What is your PowerShell version?
Name                           Value
----                           -----
PSVersion                      7.1.1
PSEdition                      Core
GitCommitId                    7.1.1
OS                             Linux 4.15.0-1108-azure #120~16.04.1-Ubuntu SMP Thu Feb 11 07:47:15 UTC 2021
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
  • What is your Az version?
    5.5.0

To Reproduce
Steps to reproduce the behavior, including exact commands you are running:

cd fhir-server-samples/deploy/scripts
$AdminPassword = ConvertTo-SecureString ****** -AsPlainText -Force
$SqlAdminPassword = ConvertTo-SecureString ****** -AsPlainText -Force
.\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName fhir-sql -UsePaaS $false -EnableExport $true -AdminPassword $AdminPassword -PersistenceProvider sql -SqlAdminPassword $SqlAdminPassword

Expected behavior
Sample environment should be created

Desktop (please complete the following information):
CloudShell

Create-FhirServerSamplesEnvironment.ps1 fails when using 'fhirSweden' as environment name

I could not get the script to complete when using an environment name that had 11 chars but changing it to a name with 7 chars worked.

New-AzureRmResourceGroupDeployment : 8:58:01 AM - Resource Microsoft.HealthcareApis/services 'fhirSandbox' failed with message '{
  "error": {
    "code": "BadRequest",
    "message": "Name can contain only upper and lowercase letters, numbers and the '-' character."
  }
}'
At /home/joakim/fhir-server-samples/deploy/scripts/Create-FhirServerSamplesEnvironment.ps1:128 char:1
+ New-AzureRmResourceGroupDeployment -TemplateUri $sandboxTemplate -env ...

Support for Recent Changes to Azure AD - Verified Domains

Describe the bug
New deployments of the Azure API for FHIR no longer complete successfully because there are resources/apps that use *.azurehealthcareapis.com and this is no longer valid per: https://docs.microsoft.com/en-us/azure/active-directory/develop/reference-breaking-changes#appid-uri-in-single-tenant-applications-will-require-use-of-default-scheme-or-verified-domains

To Reproduce
Steps to reproduce the behavior, including exact commands you are running:

  1. Follow normal environment setup steps.
  2. Run .\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName -UsePaaS $true
  3. See error

Expected behavior
The entire sample environment should be provisioned. It only provisions the Key Vault and then throws an error similar to this:

Error occurred while executing NewApplication Code: Request_BadRequest Message: Values of identifierUris property must use a verified domain of the organization or its subdomain: 'https://example123.azurehealthcareapis.com' Details: PropertyName - identifierUris, PropertyErrorCode - HostNameNotOnVerifiedDomain, HostName - https://example123.azurehealthcareapis.com HttpStatusCode: BadRequest HttpStatusDescription: Bad Request HttpResponseStatus: Completed

This issue was also reported in a different GitHub project: https://github.com/Azure/azure-docs-powershell-azuread/issues/724

Are there any plans to address this? As far as I can tell, this project no longer works at all because of the new restrictions.

Create-FhirServerSamplesEnvironment.ps1 gives resouorce not found

I'm using the following command:
rverSamplesEnvironment.ps1 -EnvironmentName FHIRServerOS -EnvironmentLocation westus2 -UsePaaS $false -PersistenceProvider sql -SqlAdminPassword $(ConvertTo-SecureString -AsPlainText -Force "abcnnn")

At first, it provides the following warning after creating key vault:

WARNING: The provided information does not map to an AD object id.
WARNING: Access policy is not set. No user or application have access permission to use this vault. This can happen if
the vault was created by a service principal. Please use Set-AzKeyVaultAccessPolicy to set access policies.

Then come several errors with the first one "The Resource 'Microsoft.Web/sites/fhirserverossrvr' under resource group 'FHIRServerOS' was not found.

It seems something failed to create.

Any info would be helpful

Create-FhirServerSamplesEnvironment.ps1 ignores -EnvironmentLocation flag

Not all resources created when running the Create-FhirServerSamplesEnvironment.ps1 script are created in the location specified by the -EnvironmentLocation flag.

The Azure API for FHIR is created in West US 2.
The Application Insights is created in East US.

We ran the following:
Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName nma1-fhir -UsePaaS $true -EnableExport $true -EnvironmentLocation NorthCentralUS

Sample doesnt deploy

Hi folks

Are there some issues with the deployment script? It doesn't work for me, issues when deploying.

I have logged in and connected to AD and then I run the following command:-

.\Create-FhirServerSamplesEnvironment.ps1 -EnvironmentName gregor12345 -UsePaaS $true

And I get ->

New-AzResourceGroupDeployment : 14:59:16 - Error: Code=InvalidTemplate; Message=Deployment template validation failed:
'Template parameter JToken type is not valid. Expected 'String, Uri'. Actual 'Object'. Please see
https://aka.ms/resource-manager-parameter-files for usage details.'.
At C:\Users\gsutt\source\repos\fhir-server-samples\deploy\scripts\Create-FhirServerSamplesEnvironment.ps1:225 char:1

  • New-AzResourceGroupDeployment -TemplateUri $sandboxTemplate -environm ...
  •   + CategoryInfo          : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception
      + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCm  
     dlet
    

Fhir Importer fails to import large batches: Cosmos PUTs rejected due to high request count; messages end up in poison queue

After generating data using java -jar synthea-with-dependencies.jar -m "covid19" -p 50 and placing the files in the import storage container, the importer function will attempt to import the files at an extremely high rate. This causes a ton of the following errors (from the function app logs):

2020-10-06T20:49:11.354 [Warning] Request failed with TooManyRequests. Waiting 00:00:08.0310000 before next retry. Retry attempt 4
...
2020-10-06T20:49:15.438 [Error] Executed 'FhirBundleBlobTrigger' (Failed, Id=8c069d01-5689-4376-9d81-6a4bc2d512c4, Duration=24264ms)Unable to upload to server. Error code TooManyRequests

Eventually, the following is logged and the function app no longer attempts to import the files:

2020-10-06T20:49:15.499 [Warning] Message has reached MaxDequeueCount of 10. Moving message to queue 'webjobs-blobtrigger-poison'.

Better throttling in the function app would allow it to consume the generated payloads at a slower rate and would not result this type of failure.

Environment Variable Prescription

Could you please add guidance to the param?

I tried to deploy and it failed (although parts of the script succeeded and there was no rollback of the successfully deployed resources).

The reason that it failed is:

New-AzureRmResourceGroupDeployment : 8:45:12 AM - Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'The provided value for the template parameter 'environmentName' at line '5' and column '28' is not valid. Length of the value should be less than or equal to '12'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.