PSRule and Azure site AVM with hybridConnectionRelays #3242
Replies: 1 comment 5 replies
-
Hi @mikkelh-SDU, thanks for your question. To enable me to help you:
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey
Firstly I'm not sure if it is a PSRule or AVM fault
When running my psrule test for my main.bicep where i use Azure AVM and I'm in the need of a hybrid connection relay. The module states it need a resourceId for the relay and when i provide it like this:
resourceId: resourceId('Microsoft.Relay/namespaces/hybridConnections', relayNamespaceName, hybridConnectionName)
or
resourceId: '${subscription().id}/resourceGroups/${rgCommonName}/providers/Microsoft.Relay/namespaces/${relayNamespaceName}/hybridConnections/${hybridConnectionName}'
I get this error when running my PSRule:
[ERROR] Failed to expand bicep source 'C:\tfs\TimeEditAPI\infra\main.bicepparam'. Exception calling "GetBicepParamResources" with "2" argument(s): "Unable to expand resources because the source file 'C:\tfs\TimeEditAPI\infra\main.bicepparam' was not valid. An error occurred evaluating expression '[split(substring(reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', split(parameters('hybridConnectionResourceId'), '/')[2], split(parameters('hybridConnectionResourceId'), '/')[4]), 'Microsoft.Relay/namespaces', split(parameters('hybridConnectionResourceId'), '/')[8]), '2021-11-01').serviceBusEndpoint, indexOf(reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', split(parameters('hybridConnectionResourceId'), '/')[2], split(parameters('hybridConnectionResourceId'), '/')[4]), 'Microsoft.Relay/namespaces', split(parameters('hybridConnectionResourceId'), '/')[8]), '2021-11-01').serviceBusEndpoint, '.servicebus')), ':')[0]]' line 8529. startIndex ('-1') must be a non-negative value. (Parameter 'startIndex') Actual value was -1."
That said if i try to deploy my bicep to Azure, it works in as expected
Beta Was this translation helpful? Give feedback.
All reactions