forked from Azure/PSRule.Rules.Azure
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed API Connection might be missing dynamic properties Azure#2424 (A…
- Loading branch information
1 parent
431a35f
commit 5f7b0bf
Showing
7 changed files
with
390 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
// Community provided sample from: https://github.com/Azure/PSRule.Rules.Azure/issues/2424 | ||
|
||
#disable-next-line no-hardcoded-location | ||
var location = 'eastus' | ||
|
||
module serviceBus './Tests.Bicep.29.child.bicep' = { | ||
name: 'my-test-service-bus' | ||
params: { | ||
Location: location | ||
ServiceBusSkuName: 'Standard' | ||
} | ||
} | ||
|
||
var logicAppParams = { | ||
'$connections': { | ||
value: { | ||
serviceBusSender: { | ||
connectionId: serviceBus.outputs.SendConnection.Id | ||
connectionName: serviceBus.outputs.SendConnection.Name | ||
id: subscriptionResourceId(serviceBus.outputs.SendConnection.Api.Type, location, serviceBus.outputs.SendConnection.Api.Name) | ||
} | ||
serviceBusListener: { | ||
connectionId: serviceBus.outputs.ListenConnection.Id | ||
connectionName: serviceBus.outputs.ListenConnection.Name | ||
id: subscriptionResourceId(serviceBus.outputs.ListenConnection.Api.Type, location, serviceBus.outputs.ListenConnection.Api.Name) | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource workflow 'Microsoft.Logic/workflows@2019-05-01' = { | ||
name: 'a-test-logic-app' | ||
location: location | ||
properties: { | ||
state: 'Enabled' | ||
definition: { | ||
// Actual definition omitted | ||
} | ||
parameters: logicAppParams | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
// Community provided sample from: https://github.com/Azure/PSRule.Rules.Azure/issues/2424 | ||
|
||
param Location string = resourceGroup().location | ||
param ServiceBusSkuName string = 'Standard' | ||
|
||
resource serviceBus 'Microsoft.ServiceBus/namespaces@2022-01-01-preview' = { | ||
name: 'myServiceBus' | ||
location: Location | ||
sku: { | ||
name: ServiceBusSkuName | ||
tier: ServiceBusSkuName | ||
} | ||
properties: { | ||
minimumTlsVersion: '1.2' | ||
} | ||
|
||
resource sendAuthRule 'AuthorizationRules' = { | ||
name: 'SendAccess' | ||
properties: { | ||
rights: [ | ||
'Send' | ||
] | ||
} | ||
} | ||
|
||
resource listenAuthRule 'AuthorizationRules' = { | ||
name: 'ListenAccess' | ||
properties: { | ||
rights: [ | ||
'Listen' | ||
] | ||
} | ||
} | ||
|
||
// Queues and Topics omitted | ||
|
||
} | ||
|
||
resource sendApiConnection 'Microsoft.Web/connections@2016-06-01' = { | ||
name: 'sender-connection' | ||
location: Location | ||
properties: { | ||
api: { | ||
id: subscriptionResourceId('Microsoft.Web/locations/managedApis', Location, 'servicebus') | ||
} | ||
displayName: 'sender-connection' | ||
parameterValues: { | ||
connectionString: listKeys(serviceBus::sendAuthRule.name, serviceBus.apiVersion).primaryConnectionString | ||
} | ||
} | ||
} | ||
|
||
resource listenApiConnection 'Microsoft.Web/connections@2016-06-01' = { | ||
name: 'listener-connection' | ||
location: Location | ||
properties: { | ||
api: { | ||
id: subscriptionResourceId('Microsoft.Web/locations/managedApis', Location, 'servicebus') | ||
} | ||
displayName: 'listener-connection' | ||
parameterValues: { | ||
connectionString: listKeys(serviceBus::listenAuthRule.name, serviceBus.apiVersion).primaryConnectionString | ||
} | ||
} | ||
} | ||
|
||
output SendConnection object = { | ||
Name: sendApiConnection.name | ||
Id: sendApiConnection.id | ||
Api: { | ||
Name: sendApiConnection.properties.api.name | ||
Type: sendApiConnection.properties.api.type | ||
} | ||
} | ||
|
||
output ListenConnection object = { | ||
Name: listenApiConnection.name | ||
Id: listenApiConnection.id | ||
Api: { | ||
Name: listenApiConnection.properties.api.name | ||
Type: listenApiConnection.properties.api.type | ||
} | ||
} |
Oops, something went wrong.