Skip to content

Service code for the Software Engineering Foundations Guild intern Azure lab

Notifications You must be signed in to change notification settings

CarsonTolleshaug/Alaska-Azure-Lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SE-Azure-Lab

This repo contains API code for the Software Engineering Foundations Guild intern Azure lab.

Step 1: Get Your Visual Studio Enterprise Subscription

Go to https://azure.microsoft.com/en-us/offers/ms-azr-0063p/

Click Activate and enter your information.

To verify it worked, go to https://portal.azure.com and go to Subscriptions, turn off the "global" filter, and search for "Visual Studio Enterprise Subscription". You should see the subscription in the list.

Subscription

Step 2: Create an App Service

From the portal home page, click the Create a Resource button.

Create

From there select "Web App"

Web App Option

  • Set "Subscription" to Visual Studio Enterprise Subscription
  • Click the "Create New" button under the resource group selection, and give it a unique name
  • Set "Name" to a unique, memorable name (the name will be part of your URL later)
  • Keep "Publish" set to Code
  • Set "Runtime Stack" to .NET 6 (LTS)
  • Set "Operating System" to Windows
  • Keep "Region" set to whatever it defaults to
  • Click the "Create New" button under the "Windows Plan" selection, and give it a unique name
  • Change "Sku and size" to F1 under the "Dev / Test" section.

Web App Settings

Click the "Review + create" button. Ensure that everything looks good, and then click the "Create" button.

Step 3: Create a Cosmos Database

From the portal home page, click the Create a Resource button. This time select "Azure Cosmos DB".

Cosmos DB Option

Select "Azure Cosmos DB API for MongoDB" as your API option.

Cosmos DB API

  • Set "Subscription" to Visual Studio Enterprise Subscription
  • Set "Resource Group" to the resource group you created in the previous step
  • Set "Account Name" to a unique name
  • Keep "Location" set to whatever it defaults to
  • Keep "Capacity mode" set to Provisioned throughput
  • (Optional) Check the "Limit total account throughput" checkbox
  • Keep "Version" set to 4.0

Cosmos DB Settings

Click the "Review + create" button. Ensure that everything looks good, and then click the "Create" button.

Step 4: Fork this repo

Fork this repo to your own github account by clicking the "fork" button in the top right corner.

Fork button

Step 5: Setup CI/CD

Enable CI/CD to pull code from this repo and deploy into your azure app service. In the azure portal, navigate to the app service you made in Step 2 and click on the "Deployment Center".

Deployment Center

On the deployment center page, select GitHub from the source dropdown. Use the sign in button to log into your GitHub account.

  • Select your github name as the Organization
  • Select Alaska-Azure-Lab as the Repository
  • Select main as the Branch

Lastly click Save, and once it's done saving click Sync to deploy the code.

Viewing the site

You can find the url for your site on the Overview page.

You should now be able to go to your site's url and see this:

Site

Step 6: Add connection string to config

Get the connection string

Navigate to your Cosmos DB. Go to the "Connection String" section and copy the "Primary Connection String".

Connection String

Use the connection string

Navigate to your App Service. Go to the "Configuration" section.

App Service Configuration

Add an application setting with the name database__connectionString and then paste the connection string you copied before into the value of this new setting.

Lastly click Save

Step 7: Use the API and see the results in the DB

You should now be able to POST a person to the API and see it returned in one of the GET requests. After doing so you should also be able to see the person in the database. To view the contents of the database, go to the "Data Explorer" section in your Cosmos DB.

Data Explorer

About

Service code for the Software Engineering Foundations Guild intern Azure lab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages