-
Notifications
You must be signed in to change notification settings - Fork 437
[Modules] Multi additions to staticSites #1655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AlexanderSehr
merged 8 commits into
Azure:users/itpropro/staticSites
from
itpropro:feature/staticSites
Jul 12, 2022
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d819b2d
feat(staticsites): Added linkedBackends to staticSites extension
itpropro 6cf177c
feat(staticsites): Added tests, readme, linkedBackends
itpropro 67adae1
docs(staticsites): Removed parameter placeholder
itpropro ec13798
Update modules/Microsoft.Web/staticSites/config/readme.md
itpropro 09317cf
Update modules/Microsoft.Web/staticSites/config/readme.md
itpropro 80fa029
Update modules/Microsoft.Web/staticSites/customDomains/readme.md
itpropro e69b889
Update modules/Microsoft.Web/staticSites/linkedBackends/readme.md
itpropro 1e37a5a
fix(staticsites): Integrated PR feedback
itpropro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 6 additions & 6 deletions
12
modules/Microsoft.Web/staticSites/.test/min.parameters.json
This file contains hidden or 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 |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| { | ||
| "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
| "contentVersion": "1.0.0.0", | ||
| "parameters": { | ||
| "name": { | ||
| "value": "<<namePrefix>>-az-wss-min-001" | ||
| } | ||
| "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
| "contentVersion": "1.0.0.0", | ||
| "parameters": { | ||
| "name": { | ||
| "value": "<<namePrefix>>-az-wss-min-001" | ||
| } | ||
| } | ||
| } |
124 changes: 74 additions & 50 deletions
124
modules/Microsoft.Web/staticSites/.test/parameters.json
This file contains hidden or 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 |
|---|---|---|
| @@ -1,50 +1,74 @@ | ||
| { | ||
| "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
| "contentVersion": "1.0.0.0", | ||
| "parameters": { | ||
| "name": { | ||
| "value": "<<namePrefix>>-az-wss-x-001" | ||
| }, | ||
| "lock": { | ||
| "value": "CanNotDelete" | ||
| }, | ||
| "sku": { | ||
| "value": "Standard" | ||
| }, | ||
| "stagingEnvironmentPolicy": { | ||
| "value": "Enabled" | ||
| }, | ||
| "allowConfigFileUpdates": { | ||
| "value": true | ||
| }, | ||
| "enterpriseGradeCdnStatus": { | ||
| "value": "Disabled" | ||
| }, | ||
| "systemAssignedIdentity": { | ||
| "value": true | ||
| }, | ||
| "userAssignedIdentities": { | ||
| "value": { | ||
| "/subscriptions/<<subscriptionId>>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<<namePrefix>>-az-msi-x-001": {} | ||
| } | ||
| }, | ||
| "roleAssignments": { | ||
| "value": [ | ||
| { | ||
| "roleDefinitionIdOrName": "Reader", | ||
| "principalIds": [ | ||
| "<<deploymentSpId>>" | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| "privateEndpoints": { | ||
| "value": [ | ||
| { | ||
| "subnetResourceId": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<<namePrefix>>-az-vnet-x-001/subnets/<<namePrefix>>-az-subnet-x-005-privateEndpoints", | ||
| "service": "staticSites" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| { | ||
| "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
| "contentVersion": "1.0.0.0", | ||
| "parameters": { | ||
| "name": { | ||
| "value": "<<namePrefix>>-az-wss-x-001" | ||
| }, | ||
| "lock": { | ||
| "value": "CanNotDelete" | ||
| }, | ||
| "sku": { | ||
| "value": "Standard" | ||
| }, | ||
| "stagingEnvironmentPolicy": { | ||
| "value": "Enabled" | ||
| }, | ||
| "allowConfigFileUpdates": { | ||
| "value": true | ||
| }, | ||
| "enterpriseGradeCdnStatus": { | ||
| "value": "Disabled" | ||
| }, | ||
| "systemAssignedIdentity": { | ||
| "value": true | ||
| }, | ||
| "customDomains": { | ||
| "value": [ | ||
| "<<namePrefix>>domain1.domain", | ||
| "<<namePrefix>>domain2.domain.domain", | ||
| "<<namePrefix>>domain3.domain.domain.domain" | ||
| ] | ||
| }, | ||
| "appSettings": { | ||
| "value": { | ||
| "foo": "bar", | ||
| "setting": 1 | ||
| } | ||
| }, | ||
| "functionAppSettings": { | ||
| "value": { | ||
| "foo": "bar", | ||
| "setting": 1 | ||
| } | ||
| }, | ||
| "userAssignedIdentities": { | ||
| "value": { | ||
| "/subscriptions/<<subscriptionId>>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<<namePrefix>>-az-msi-x-001": {} | ||
| } | ||
| }, | ||
| "roleAssignments": { | ||
| "value": [ | ||
| { | ||
| "roleDefinitionIdOrName": "Reader", | ||
| "principalIds": [ | ||
| "<<deploymentSpId>>" | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| "privateEndpoints": { | ||
| "value": [ | ||
| { | ||
| "subnetResourceId": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<<namePrefix>>-az-vnet-x-001/subnets/<<namePrefix>>-az-subnet-x-005-privateEndpoints", | ||
| "service": "staticSites" | ||
| } | ||
| ] | ||
| }, | ||
| "linkedBackend": { | ||
| "value": { | ||
| "resourceId": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Web/sites/<<namePrefix>>-az-fa-x-001" | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,33 @@ | ||
| @allowed([ | ||
| 'appsettings' | ||
| 'functionappsettings' | ||
| ]) | ||
| @description('Required. Type of settings to apply.') | ||
| param kind string | ||
|
|
||
| @description('Required. App settings.') | ||
| param properties object | ||
|
|
||
| @description('Conditional. The name of the parent Static Web App. Required if the template is used in a standalone deployment.') | ||
| param staticSiteName string | ||
|
|
||
| resource staticSite 'Microsoft.Web/staticSites@2022-03-01' existing = { | ||
| name: staticSiteName | ||
| } | ||
|
|
||
| resource config 'Microsoft.Web/staticSites/config@2022-03-01' = { | ||
| #disable-next-line BCP225 | ||
| name: kind | ||
| parent: staticSite | ||
| properties: properties | ||
| } | ||
|
|
||
| @description('The name of the config.') | ||
| output name string = config.name | ||
|
|
||
| @description('The resource ID of the config.') | ||
| output resourceId string = config.id | ||
|
|
||
| @description('The name of the resource group the config was created in.') | ||
| output resourceGroupName string = resourceGroup().name | ||
|
|
||
This file contains hidden or 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,37 @@ | ||
| # Static Site Config `[Microsoft.Web/staticSites/config]` | ||
|
|
||
| This module deploys a Static Site Config. | ||
|
|
||
| ## Navigation | ||
|
|
||
| - [Resource Types](#Resource-Types) | ||
| - [Parameters](#Parameters) | ||
| - [Outputs](#Outputs) | ||
|
|
||
| ## Resource Types | ||
|
|
||
| | Resource Type | API Version | | ||
| | :-- | :-- | | ||
| | `Microsoft.Web/staticSites/config` | [2022-03-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Web/staticSites/config) | | ||
|
|
||
| ## Parameters | ||
|
|
||
| **Required parameters** | ||
| | Parameter Name | Type | Allowed Values | Description | | ||
| | :-- | :-- | :-- | :-- | | ||
| | `kind` | string | `[appsettings, functionappsettings]` | Type of settings to apply. | | ||
| | `properties` | object | | App settings. | | ||
|
|
||
| **Conditional parameters** | ||
| | Parameter Name | Type | Description | | ||
| | :-- | :-- | :-- | | ||
| | `staticSiteName` | string | The name of the parent Static Web App. Required if the template is used in a standalone deployment. | | ||
|
|
||
|
|
||
| ## Outputs | ||
|
|
||
| | Output Name | Type | Description | | ||
| | :-- | :-- | :-- | | ||
| | `name` | string | The name of the config. | | ||
| | `resourceGroupName` | string | The name of the resource group the config was created in. | | ||
| | `resourceId` | string | The resource ID of the config. | |
This file contains hidden or 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,4 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", | ||
| "version": "0.6" | ||
| } |
29 changes: 29 additions & 0 deletions
29
modules/Microsoft.Web/staticSites/customDomains/deploy.bicep
This file contains hidden or 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,29 @@ | ||
| @description('Conditional. The custom domain name. Required if the template is used in a standalone deployment.') | ||
| param name string | ||
|
|
||
| @description('Conditional. The name of the parent Static Web App. Required if the template is used in a standalone deployment.') | ||
| param staticSiteName string | ||
|
|
||
| @description('Optional. Validation method for adding a custom domain.') | ||
| param validationMethod string = 'cname-delegation' | ||
|
|
||
| resource staticSite 'Microsoft.Web/staticSites@2022-03-01' existing = { | ||
| name: staticSiteName | ||
| } | ||
|
|
||
| resource customDomain 'Microsoft.Web/staticSites/customDomains@2022-03-01' = { | ||
| name: name | ||
| parent: staticSite | ||
| properties: { | ||
| validationMethod: validationMethod | ||
| } | ||
| } | ||
|
|
||
| @description('The name of the static site.') | ||
| output name string = customDomain.name | ||
|
|
||
| @description('The resource ID of the static site.') | ||
| output resourceId string = customDomain.id | ||
|
|
||
| @description('The resource group the static site was deployed into.') | ||
| output resourceGroupName string = resourceGroup().name |
This file contains hidden or 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,37 @@ | ||
| # Static Site Custom Domain `[Microsoft.Web/staticSites/customDomains]` | ||
|
|
||
| This module deploys a Custom Domain into a Static Site. | ||
|
|
||
| ## Navigation | ||
|
|
||
| - [Resource Types](#Resource-Types) | ||
| - [Parameters](#Parameters) | ||
| - [Outputs](#Outputs) | ||
|
|
||
| ## Resource Types | ||
|
|
||
| | Resource Type | API Version | | ||
| | :-- | :-- | | ||
| | `Microsoft.Web/staticSites/customDomains` | [2022-03-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Web/staticSites/customDomains) | | ||
|
|
||
| ## Parameters | ||
|
|
||
| **Conditional parameters** | ||
| | Parameter Name | Type | Description | | ||
| | :-- | :-- | :-- | | ||
| | `name` | string | The custom domain name. Required if the template is used in a standalone deployment. | | ||
| | `staticSiteName` | string | The name of the parent Static Web App. Required if the template is used in a standalone deployment. | | ||
|
|
||
| **Optional parameters** | ||
| | Parameter Name | Type | Default Value | Description | | ||
| | :-- | :-- | :-- | :-- | | ||
| | `validationMethod` | string | `'cname-delegation'` | Validation method for adding a custom domain. | | ||
|
|
||
|
|
||
| ## Outputs | ||
|
|
||
| | Output Name | Type | Description | | ||
| | :-- | :-- | :-- | | ||
| | `name` | string | The name of the static site. | | ||
| | `resourceGroupName` | string | The resource group the static site was deployed into. | | ||
| | `resourceId` | string | The resource ID of the static site. | |
This file contains hidden or 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,4 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", | ||
| "version": "0.6" | ||
| } |
This file contains hidden or 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
33 changes: 33 additions & 0 deletions
33
modules/Microsoft.Web/staticSites/linkedBackends/deploy.bicep
This file contains hidden or 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,33 @@ | ||
| @description('Requried. The resource id of the backend linked to the static site.') | ||
| param backendResourceId string | ||
|
|
||
| @description('Optional. The region of the backend linked to the static site.') | ||
| param region string = resourceGroup().location | ||
|
|
||
| @description('Conditional. The name of the parent Static Web App. Required if the template is used in a standalone deployment.') | ||
| param staticSiteName string | ||
|
|
||
| @description('Optional. Name of the backend to link to the static site.') | ||
| param linkedBackendName string = uniqueString(backendResourceId) | ||
|
|
||
| resource staticSite 'Microsoft.Web/staticSites@2022-03-01' existing = { | ||
| name: staticSiteName | ||
| } | ||
|
|
||
| resource linkedBackend 'Microsoft.Web/staticSites/linkedBackends@2022-03-01' = { | ||
| name: linkedBackendName | ||
| parent: staticSite | ||
| properties: { | ||
| backendResourceId: backendResourceId | ||
| region: region | ||
| } | ||
| } | ||
|
|
||
| @description('The name of the static site.') | ||
| output name string = linkedBackend.name | ||
|
|
||
| @description('The resource ID of the static site.') | ||
| output resourceId string = linkedBackend.id | ||
|
|
||
| @description('The resource group the static site was deployed into.') | ||
| output resourceGroupName string = resourceGroup().name |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.