Skip to content

connection.json file has @appsetting, which is not recognized #9

Description

@raunaknarooka

I have the following connection.json file which has a managed api connection

{
"managedApiConnections": {

    "products-evgt-apiConnection": {
        "api": {
          "id": "/subscriptions/@appsetting('WORKFLOWS_SUBSCRIPTION_ID')/providers/Microsoft.Web/locations/westeurope/managedApis/azureeventgrid"
        },
        "kind": "V2",
        "authentication": {
          "type": "ManagedServiceIdentity"
        },
        "connection": {
          "id": "/subscriptions/@appsetting('WORKFLOWS_SUBSCRIPTION_ID')/resourceGroups/@appsetting('WORKFLOWS_RESOURCE_GROUP_NAME')/providers/Microsoft.Web/connections/int0313-iver-products-evgt-apiConnection"
        },
        "connectionProperties": {
          "authentication": {
            "audience": "https://management.core.windows.net/",
            "type": "ManagedServiceIdentity"
          }
        },
        "connectionRuntimeUrl": "@appsetting('EVENTGRID_CONNECTION_RUNTIMEURL')"
      }
},

As i understand, the testing framework looks at all built in and managed connections and replaces them with a localhost url. When i use the appsetting in the connectionRuntimeurl of the eventgrid api connection, it tells its an invalid url. I get the following error:
Error Message:
Initialization method INT0313.Iver.Products.Tests.Products.Products.TestInitialize threw exception. System.UriFormatException: Invalid URI: The format of the URI could not be determined..
Stack Trace:
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
at System.Uri..ctor(String uriString)
at LogicAppUnit.InternalHelper.ConnectionHelper.<>c.b__3_0(JProperty connection)
at System.Collections.Generic.List1.ForEach(Action1 action)
at LogicAppUnit.InternalHelper.ConnectionHelper.ReplaceManagedApiConnectionUrlsWithMockServer()
at LogicAppUnit.WorkflowTestBase.Initialize(String logicAppBasePath, String workflowName, String localSettingsFilename)
at LogicAppUnit.WorkflowTestBase.Initialize(String logicAppBasePath, String workflowName)
at INT0313.Iver.Products.Tests.Products.Products.TestInitialize() in C:\Users\PSRAUNAR\OneDrive - Peab\Dokument\INT0313.Iver.Products\INT0313.Iver.Products.Tests\Products\Products.cs:line 21

And the output stops here:
Standard Output Messages:


  •                          INITIALIZING TEST                               -
    

Azurite is listening on ports 10000 (Blob service), 10001 (Queue service) and 10002 (Table service).
Workflow 'Products_Source' is Stateful
Replacing workflow trigger 'When_a_file_is_added_or_updated' with a HTTP Request trigger.
Replacing workflow actions using a built-in connector with a HTTP action for the mock test server:
Copy_file_to_error_folder:
Connector Type: /serviceProviders/Sftp/copyFile
Mocked URL: http://pw02cvvv:7075/Copy_file_to_error_folder
Delete_file_from_source_folder:
Connector Type: /serviceProviders/Sftp/deleteFile
Mocked URL: http://pw02cvvv:7075/Delete_file_from_source_folder
Copy_file_to_processed_folder:
Connector Type: /serviceProviders/Sftp/copyFile
Mocked URL: http://pw02cvvv:7075/Copy_file_to_processed_folder
Delete_file:
Connector Type: /serviceProviders/Sftp/deleteFile
Mocked URL: http://pw02cvvv:7075/Delete_file
Upload_blob_to_storage_container-Logging:
Connector Type: /serviceProviders/AzureBlob/uploadBlob
Mocked URL: http://pw02cvvv:7075/Upload_blob_to_storage_container-Logging
Updating connections file for managed API connectors:

when i put a valid dummy url in connectionruntimeurl it works. But this is not what i want. The connections are deployed in the azure devops pipeline and i need this to be an app setting.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions