-
Notifications
You must be signed in to change notification settings - Fork 7
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
IaC (Bicep) for provisioning dependencies/ui #18
base: main
Are you sure you want to change the base?
Changes from all commits
06d3e38
889637a
f2fbc93
23b203d
67f93df
058058a
cf7bc1b
e2ca335
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Azure Static Web Apps CI/CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_and_deploy_job: | ||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | ||
runs-on: ubuntu-latest | ||
name: Build and Deploy Job | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Build And Deploy | ||
id: builddeploy | ||
uses: Azure/static-web-apps-deploy@v1 | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_JOLLY_COAST_02C1A010F }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | ||
action: "upload" | ||
###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### | ||
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig | ||
app_location: "/src/ui" # App source code path | ||
api_location: "/src/api" # Api source code path - optional | ||
output_location: "build" # Built app content directory - optional | ||
###### End of Repository/Build Configurations ###### | ||
|
||
close_pull_request_job: | ||
if: github.event_name == 'pull_request' && github.event.action == 'closed' | ||
runs-on: ubuntu-latest | ||
name: Close Pull Request Job | ||
steps: | ||
- name: Close Pull Request | ||
id: closepullrequest | ||
uses: Azure/static-web-apps-deploy@v1 | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_JOLLY_COAST_02C1A010F }} | ||
action: "close" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Azure Static Web Apps CI/CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_and_deploy_job: | ||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | ||
runs-on: ubuntu-latest | ||
name: Build and Deploy Job | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Build And Deploy | ||
id: builddeploy | ||
uses: Azure/static-web-apps-deploy@v1 | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LEMON_WATER_0C8A3290F }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | ||
action: "upload" | ||
###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### | ||
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig | ||
app_location: "/src/ui" # App source code path | ||
api_location: "/src/api" # Api source code path - optional | ||
output_location: "build" # Built app content directory - optional | ||
###### End of Repository/Build Configurations ###### | ||
|
||
close_pull_request_job: | ||
if: github.event_name == 'pull_request' && github.event.action == 'closed' | ||
runs-on: ubuntu-latest | ||
name: Close Pull Request Job | ||
steps: | ||
- name: Close Pull Request | ||
id: closepullrequest | ||
uses: Azure/static-web-apps-deploy@v1 | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LEMON_WATER_0C8A3290F }} | ||
action: "close" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-azuretools.vscode-azurefunctions" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Attach to Node Functions", | ||
"type": "node", | ||
"request": "attach", | ||
"port": 9229, | ||
"preLaunchTask": "func: host start" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"azureFunctions.deploySubpath": "src/api", | ||
"azureFunctions.postDeployTask": "npm install (functions)", | ||
"azureFunctions.projectLanguage": "JavaScript", | ||
"azureFunctions.projectRuntime": "~4", | ||
"debug.internalConsoleOptions": "neverOpen", | ||
"azureFunctions.projectSubpath": "src/api", | ||
"azureFunctions.preDeployTask": "npm prune (functions)" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "func", | ||
"label": "func: host start", | ||
"command": "host start", | ||
"problemMatcher": "$func-node-watch", | ||
"isBackground": true, | ||
"dependsOn": "npm install (functions)", | ||
"options": { | ||
"cwd": "${workspaceFolder}/src/api" | ||
} | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "npm install (functions)", | ||
"command": "npm install", | ||
"options": { | ||
"cwd": "${workspaceFolder}/src/api" | ||
} | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "npm prune (functions)", | ||
"command": "npm prune --production", | ||
"problemMatcher": [], | ||
"options": { | ||
"cwd": "${workspaceFolder}/src/api" | ||
} | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Installation | ||
|
||
The environment can provisioned using the Bicep templates inclulded with the project and executed in a number of ways including: | ||
|
||
1. Azure CLI | ||
2. GitHub Actions | ||
3. Azure DevOps | ||
4. Azure Portal | ||
|
||
We will provide examples of the first two methods in this document. Manual provisioning using the Azure CLI or continuous delivery via GitHub Actions. | ||
|
||
<br/> | ||
|
||
## Deploying the Bicep templates using the Azure CLI | ||
|
||
#### :wrench: CREATING THE RESOURCE GROUP #### | ||
|
||
Before executing any of the following Bicep templates, you first need to login to your Azure account using the Azure CLI `az` command line tool: | ||
|
||
```bash | ||
az login | ||
``` | ||
|
||
Then, create a resource group if it does not already exist: | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worthwhile adding instructions around the following:
|
||
```bash | ||
az group create --name <ResourceGroupName> --location <Location> | ||
``` | ||
|
||
Replace `<ResourceGroupName>` and `<Location>` with your preferred resource group name and Azure location, respectively. | ||
|
||
<br/> | ||
|
||
#### :wrench: PROVISIONING THE AI DEPENDENCIES | ||
|
||
To deploy the required AI services, deploy the `ai.bicep` file with the `az deployment group create` command: | ||
|
||
```bash | ||
az deployment group create --resource-group <ResourceGroupName> --template-file ai.bicep | ||
``` | ||
|
||
Replace `<ResourceGroupName>` with the name of the resource group you created. | ||
|
||
This command will deploy all the resources defined in the `ai.bicep` file to the specified resource group. The `ai.bicep` file should be located in the same directory from which you're running the command. If it's in a different location, you would need to specify the full path to the file in the `--template-file` argument. | ||
|
||
Please ensure that you have the Azure CLI installed and you're logged in to your Azure account before running these commands. | ||
|
||
<br/> | ||
|
||
#### :wrench: PROVISONING THE WEB INFRASTRUCTURE | ||
|
||
To deploy the required web infrastructure, deploy the `web.bicep` file with the `az deployment group create` command: | ||
|
||
```bash | ||
az deployment group create --resource-group <ResourceGroupName> --template-file web.bicep | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to add any comments/gotchas here for expected errors? |
||
``` | ||
|
||
Replace `<ResourceGroupName>` with the name of the resource group you created. | ||
|
||
This command will deploy all the resources defined in the `web.bicep` file to the specified resource group. The `web.bicep` file should be located in the same directory from which you're running the command. If it's in a different location, you would need to specify the full path to the file in the `--template-file` argument. | ||
|
||
Please ensure that you have the Azure CLI installed and you're logged in to your Azure account before running these commands. | ||
|
||
<br/> | ||
|
||
## Deploying infastructure continuously using GitHub Actions | ||
|
||
Coming soon... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also review actions in the deploy branch? Would love to get your feedback on this. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
{ | ||
"analysisServicesServers": "as", | ||
"apiManagementService": "apim-", | ||
"appConfigurationConfigurationStores": "appcs-", | ||
"appManagedEnvironments": "cae-", | ||
"appContainerApps": "ca-", | ||
"authorizationPolicyDefinitions": "policy-", | ||
"automationAutomationAccounts": "aa-", | ||
"blueprintBlueprints": "bp-", | ||
"blueprintBlueprintsArtifacts": "bpa-", | ||
"cacheRedis": "redis-", | ||
"cdnProfiles": "cdnp-", | ||
"cdnProfilesEndpoints": "cdne-", | ||
"cognitiveServicesAccounts": "cog-", | ||
"cognitiveServicesOpenAI": "cog-oai-", | ||
"cognitiveServicesFormRecognizer": "cog-fr-", | ||
"cognitiveServicesTextAnalytics": "cog-ta-", | ||
"cognitiveServicesSpeechServices": "cog-ss-", | ||
"computeAvailabilitySets": "avail-", | ||
"computeCloudServices": "cld-", | ||
"computeDiskEncryptionSets": "des", | ||
"computeDisks": "disk", | ||
"computeDisksOs": "osdisk", | ||
"computeGalleries": "gal", | ||
"computeSnapshots": "snap-", | ||
"computeVirtualMachines": "vm", | ||
"computeVirtualMachineScaleSets": "vmss-", | ||
"containerInstanceContainerGroups": "ci", | ||
"containerRegistryRegistries": "cr", | ||
"containerServiceManagedClusters": "aks-", | ||
"databricksWorkspaces": "dbw-", | ||
"dataFactoryFactories": "adf-", | ||
"dataLakeAnalyticsAccounts": "dla", | ||
"dataLakeStoreAccounts": "dls", | ||
"dataMigrationServices": "dms-", | ||
"dBforMySQLServers": "mysql-", | ||
"dBforPostgreSQLServers": "psql-", | ||
"devicesIotHubs": "iot-", | ||
"devicesProvisioningServices": "provs-", | ||
"devicesProvisioningServicesCertificates": "pcert-", | ||
"documentDBDatabaseAccounts": "cosmos-", | ||
"eventGridDomains": "evgd-", | ||
"eventGridDomainsTopics": "evgt-", | ||
"eventGridEventSubscriptions": "evgs-", | ||
"eventHubNamespaces": "evhns-", | ||
"eventHubNamespacesEventHubs": "evh-", | ||
"hdInsightClustersHadoop": "hadoop-", | ||
"hdInsightClustersHbase": "hbase-", | ||
"hdInsightClustersKafka": "kafka-", | ||
"hdInsightClustersMl": "mls-", | ||
"hdInsightClustersSpark": "spark-", | ||
"hdInsightClustersStorm": "storm-", | ||
"hybridComputeMachines": "arcs-", | ||
"insightsActionGroups": "ag-", | ||
"insightsComponents": "appi-", | ||
"keyVaultVaults": "kv-", | ||
"kubernetesConnectedClusters": "arck", | ||
"kustoClusters": "dec", | ||
"kustoClustersDatabases": "dedb", | ||
"logicIntegrationAccounts": "ia-", | ||
"logicWorkflows": "logic-", | ||
"machineLearningServicesWorkspaces": "mlw-", | ||
"managedIdentityUserAssignedIdentities": "id-", | ||
"managementManagementGroups": "mg-", | ||
"migrateAssessmentProjects": "migr-", | ||
"networkApplicationGateways": "agw-", | ||
"networkApplicationSecurityGroups": "asg-", | ||
"networkAzureFirewalls": "afw-", | ||
"networkBastionHosts": "bas-", | ||
"networkConnections": "con-", | ||
"networkDnsZones": "dnsz-", | ||
"networkExpressRouteCircuits": "erc-", | ||
"networkFirewallPolicies": "afwp-", | ||
"networkFirewallPoliciesWebApplication": "waf", | ||
"networkFirewallPoliciesRuleGroups": "wafrg", | ||
"networkFrontDoors": "fd-", | ||
"networkFrontdoorWebApplicationFirewallPolicies": "fdfp-", | ||
"networkLoadBalancersExternal": "lbe-", | ||
"networkLoadBalancersInternal": "lbi-", | ||
"networkLoadBalancersInboundNatRules": "rule-", | ||
"networkLocalNetworkGateways": "lgw-", | ||
"networkNatGateways": "ng-", | ||
"networkNetworkInterfaces": "nic-", | ||
"networkNetworkSecurityGroups": "nsg-", | ||
"networkNetworkSecurityGroupsSecurityRules": "nsgsr-", | ||
"networkNetworkWatchers": "nw-", | ||
"networkPrivateDnsZones": "pdnsz-", | ||
"networkPrivateLinkServices": "pl-", | ||
"networkPublicIPAddresses": "pip-", | ||
"networkPublicIPPrefixes": "ippre-", | ||
"networkRouteFilters": "rf-", | ||
"networkRouteTables": "rt-", | ||
"networkRouteTablesRoutes": "udr-", | ||
"networkTrafficManagerProfiles": "traf-", | ||
"networkVirtualNetworkGateways": "vgw-", | ||
"networkVirtualNetworks": "vnet-", | ||
"networkVirtualNetworksSubnets": "snet-", | ||
"networkVirtualNetworksVirtualNetworkPeerings": "peer-", | ||
"networkVirtualWans": "vwan-", | ||
"networkVpnGateways": "vpng-", | ||
"networkVpnGatewaysVpnConnections": "vcn-", | ||
"networkVpnGatewaysVpnSites": "vst-", | ||
"notificationHubsNamespaces": "ntfns-", | ||
"notificationHubsNamespacesNotificationHubs": "ntf-", | ||
"operationalInsightsWorkspaces": "log-", | ||
"portalDashboards": "dash-", | ||
"powerBIDedicatedCapacities": "pbi-", | ||
"purviewAccounts": "pview-", | ||
"recoveryServicesVaults": "rsv-", | ||
"resourcesResourceGroups": "rg-", | ||
"searchSearchServices": "srch-", | ||
"serviceBusNamespaces": "sb-", | ||
"serviceBusNamespacesQueues": "sbq-", | ||
"serviceBusNamespacesTopics": "sbt-", | ||
"serviceEndPointPolicies": "se-", | ||
"serviceFabricClusters": "sf-", | ||
"signalRServiceSignalR": "sigr", | ||
"sqlManagedInstances": "sqlmi-", | ||
"sqlServers": "sql-", | ||
"sqlServersDataWarehouse": "sqldw-", | ||
"sqlServersDatabases": "sqldb-", | ||
"sqlServersDatabasesStretch": "sqlstrdb-", | ||
"storageStorageAccounts": "st", | ||
"storageStorageAccountsVm": "stvm", | ||
"storSimpleManagers": "ssimp", | ||
"streamAnalyticsCluster": "asa-", | ||
"synapseWorkspaces": "syn", | ||
"synapseWorkspacesAnalyticsWorkspaces": "synw", | ||
"synapseWorkspacesSqlPoolsDedicated": "syndp", | ||
"synapseWorkspacesSqlPoolsSpark": "synsp", | ||
"timeSeriesInsightsEnvironments": "tsi-", | ||
"webServerFarms": "plan-", | ||
"webSitesAppService": "app-", | ||
"webSitesAppServiceEnvironment": "ase-", | ||
"webSitesFunctions": "func-", | ||
"webStaticSites": "stapp-" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
param speechServiceName string | ||
param textAnalyticsServiceName string | ||
param openAIServiceName string | ||
param location string = resourceGroup().location | ||
|
||
module speechService '../core/ai/speech.bicep' = { | ||
name: 'speechServiceDeployment' | ||
params: { | ||
serviceName: speechServiceName | ||
location: location | ||
} | ||
} | ||
|
||
module textAnalyticsService '../core/ai/textanalytics.bicep' = { | ||
name: 'textAnalyticsServiceDeployment' | ||
params: { | ||
serviceName: textAnalyticsServiceName | ||
location: location | ||
} | ||
} | ||
|
||
module openAIService '../core/ai/openai.bicep' = { | ||
name: 'openAIServiceDeployment' | ||
params: { | ||
serviceName: openAIServiceName | ||
location: location | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the spirit of making things easy/inclusive for new to azure folk, should we add a paragraph about bicep.
Also explicitly add the following?