File tree Expand file tree Collapse file tree 5 files changed +72
-6
lines changed Expand file tree Collapse file tree 5 files changed +72
-6
lines changed Original file line number Diff line number Diff line change 1- # This workflow will build a .NET project
2- # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
31
42name : API
53
Original file line number Diff line number Diff line change 1- # generate-url-shortene
2- Let's Build It: Url Shortener Project
1+ # Generate-url-shortene
2+
3+ ## Let's Build It: Url Shortener Project
4+
5+ ## Infrastructure as Code
6+
7+ ### Log in into Azure
8+
9+ ``` bash
10+ az login
11+ ```
12+
13+ ### Create Resource Group
14+
15+ ``` bash
16+ az group create --name rg-urlshortener-dev --location EastAsia
17+ ```
Original file line number Diff line number Diff line change 11var builder = WebApplication . CreateBuilder ( args ) ;
22
3- // Add services to the container.
4- // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
3+
54builder . Services . AddOpenApi ( ) ;
65
76var app = builder . Build ( ) ;
Original file line number Diff line number Diff line change 1+ param location string = resourceGroup ().location
2+
3+ var uniqueId = uniqueString (resourceGroup ().id )
4+
5+ module apiService 'modules/compute/appservice.bicep' = {
6+ name : 'apiDeployment'
7+ params : {
8+ location : location
9+ appName : 'api-${uniqueId }'
10+ appServiceplanName : 'plan-api-${uniqueId }'
11+ }
12+ }
13+
14+
15+
Original file line number Diff line number Diff line change 1+ param location string = resourceGroup ().location
2+ param appServiceplanName string
3+ param appName string
4+
5+ resource appServicePlan 'Microsoft.Web/serverfarms@2023-12-01' = {
6+ name : appServiceplanName
7+ location : location
8+ kind : 'linux'
9+ sku : {
10+ name : 'B1'
11+ }
12+ properties : {
13+ reserved : true
14+ }
15+ }
16+
17+
18+ resource webApp 'Microsoft.Web/sites@2023-12-01' = {
19+ name : appName
20+ location : location
21+ properties : {
22+ serverFarmId : appServicePlan .id
23+ httpsOnly : true
24+ siteConfig : {
25+ linuxFxVersion : 'DOTNETCORE|9.0'
26+ }
27+ }
28+ }
29+
30+
31+ resource webAppConfig 'Microsoft.Web/sites/config@2023-12-01' = {
32+ parent : webApp
33+ name : 'web'
34+ properties : {
35+ scmType : 'GitHub'
36+ }
37+ }
38+
39+ output webAppId string = webApp .id
You can’t perform that action at this time.
0 commit comments