-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Release 0.3.1 * Release 0.3.1 * Release 0.3.1 --------- Co-authored-by: Microsoft Open Source <[email protected]>
- Loading branch information
1 parent
c34a1a4
commit 212ce7f
Showing
36 changed files
with
885 additions
and
81 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
107 changes: 107 additions & 0 deletions
107
...icep/CRML/subscriptionAlias/generateddocs/subscriptionAliasScopeEscape.bicep.md
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,107 @@ | ||
# ALZ Bicep CRML - Subscription Alias Module with Scope Escape | ||
|
||
Module to deploy an Azure Subscription into an existing billing scope that can be from an EA, MCA or MPA, using Scope Escaping feature of ARM to allow deployment not requiring tenant root scope access. | ||
|
||
## Parameters | ||
|
||
Parameter name | Required | Description | ||
-------------- | -------- | ----------- | ||
parSubscriptionName | Yes | Name of the subscription to be created. Will also be used as the alias name. Whilst you can use any name you like we recommend it to be: all lowercase, no spaces, alphanumeric and hyphens only. | ||
parSubscriptionBillingScope | Yes | The full resource ID of billing scope associated to the EA, MCA or MPA account you wish to create the subscription in. | ||
parTags | No | Tags you would like to be applied. | ||
parManagementGroupId | No | The ID of the existing management group where the subscription will be placed. Also known as its parent management group. (Optional) | ||
parSubscriptionOwnerId | No | The object ID of a responsible user, Microsoft Entra group or service principal. (Optional) | ||
parSubscriptionOfferType | No | The offer type of the EA, MCA or MPA subscription to be created. Defaults to = Production | ||
parTenantId | No | The ID of the tenant. Defaults to = tenant().tenantId | ||
|
||
### parSubscriptionName | ||
|
||
 | ||
|
||
Name of the subscription to be created. Will also be used as the alias name. Whilst you can use any name you like we recommend it to be: all lowercase, no spaces, alphanumeric and hyphens only. | ||
|
||
### parSubscriptionBillingScope | ||
|
||
 | ||
|
||
The full resource ID of billing scope associated to the EA, MCA or MPA account you wish to create the subscription in. | ||
|
||
### parTags | ||
|
||
 | ||
|
||
Tags you would like to be applied. | ||
|
||
### parManagementGroupId | ||
|
||
 | ||
|
||
The ID of the existing management group where the subscription will be placed. Also known as its parent management group. (Optional) | ||
|
||
### parSubscriptionOwnerId | ||
|
||
 | ||
|
||
The object ID of a responsible user, Microsoft Entra group or service principal. (Optional) | ||
|
||
### parSubscriptionOfferType | ||
|
||
 | ||
|
||
The offer type of the EA, MCA or MPA subscription to be created. Defaults to = Production | ||
|
||
- Default value: `Production` | ||
|
||
- Allowed values: `DevTest`, `Production` | ||
|
||
### parTenantId | ||
|
||
 | ||
|
||
The ID of the tenant. Defaults to = tenant().tenantId | ||
|
||
- Default value: `[tenant().tenantId]` | ||
|
||
## Outputs | ||
|
||
Name | Type | Description | ||
---- | ---- | ----------- | ||
outSubscriptionName | string | | ||
outSubscriptionId | string | | ||
|
||
## Snippets | ||
|
||
### Parameter file | ||
|
||
```json | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"template": "infra-as-code/bicep/CRML/subscriptionAlias/subscriptionAliasScopeEscape.json" | ||
}, | ||
"parameters": { | ||
"parSubscriptionName": { | ||
"value": "" | ||
}, | ||
"parSubscriptionBillingScope": { | ||
"value": "" | ||
}, | ||
"parTags": { | ||
"value": {} | ||
}, | ||
"parManagementGroupId": { | ||
"value": "" | ||
}, | ||
"parSubscriptionOwnerId": { | ||
"value": "" | ||
}, | ||
"parSubscriptionOfferType": { | ||
"value": "Production" | ||
}, | ||
"parTenantId": { | ||
"value": "[tenant().tenantId]" | ||
} | ||
} | ||
} | ||
``` |
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
48 changes: 48 additions & 0 deletions
48
dependencies/infra-as-code/bicep/CRML/subscriptionAlias/subscriptionAliasScopeEscape.bicep
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,48 @@ | ||
targetScope = 'managementGroup' | ||
|
||
metadata name = 'ALZ Bicep CRML - Subscription Alias Module with Scope Escape' | ||
metadata description = 'Module to deploy an Azure Subscription into an existing billing scope that can be from an EA, MCA or MPA, using Scope Escaping feature of ARM to allow deployment not requiring tenant root scope access.' | ||
|
||
@sys.description('Name of the subscription to be created. Will also be used as the alias name. Whilst you can use any name you like we recommend it to be: all lowercase, no spaces, alphanumeric and hyphens only.') | ||
param parSubscriptionName string | ||
|
||
@sys.description('The full resource ID of billing scope associated to the EA, MCA or MPA account you wish to create the subscription in.') | ||
param parSubscriptionBillingScope string | ||
|
||
@sys.description('Tags you would like to be applied.') | ||
param parTags object = {} | ||
|
||
@sys.description('The ID of the existing management group where the subscription will be placed. Also known as its parent management group. (Optional)') | ||
param parManagementGroupId string = '' | ||
|
||
@sys.description('The object ID of a responsible user, Microsoft Entra group or service principal. (Optional)') | ||
param parSubscriptionOwnerId string = '' | ||
|
||
@allowed([ | ||
'DevTest' | ||
'Production' | ||
]) | ||
@sys.description('The offer type of the EA, MCA or MPA subscription to be created. Defaults to = Production') | ||
param parSubscriptionOfferType string = 'Production' | ||
|
||
@sys.description('The ID of the tenant. Defaults to = tenant().tenantId') | ||
param parTenantId string = tenant().tenantId | ||
|
||
resource resSubscription 'Microsoft.Subscription/aliases@2021-10-01' = { | ||
scope: tenant() | ||
name: parSubscriptionName | ||
properties: { | ||
additionalProperties: { | ||
tags: parTags | ||
managementGroupId: empty(parManagementGroupId) ? null : contains(toLower(parManagementGroupId), toLower('/providers/Microsoft.Management/managementGroups/')) ? parManagementGroupId : '/providers/Microsoft.Management/managementGroups/${parManagementGroupId}' | ||
subscriptionOwnerId: empty(parSubscriptionOwnerId) ? null : parSubscriptionOwnerId | ||
subscriptionTenantId: parTenantId | ||
} | ||
displayName: parSubscriptionName | ||
billingScope: parSubscriptionBillingScope | ||
workload: parSubscriptionOfferType | ||
} | ||
} | ||
|
||
output outSubscriptionName string = resSubscription.name | ||
output outSubscriptionId string = resSubscription.properties.subscriptionId |
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
Oops, something went wrong.