These samples are for the Azure for Developers instructor-led course - https://codewithdan.com/products/azure-for-developers.
Perform the following steps:
- Create a new Storage Account in Azure
- Add a Storage Table named
customers
- Add a Blob Storage named
blobs
- Add a Storage Queue named
orders
- Create a new Service Bus namespace and add a Queue named
orders
(use the defaults for the Queue) - Create a new Cosmos DB account based on the
Core (SQL)
API. You can name it anything you'd like. - Add a new
Container
with the following names (use the default of 400 RU/s)
Database: MoviesDatabase
Container: MoviesContainer
Partition Key: /id
- Add your storage account name and key as well as your service bus connection string into
webapp/appsettings.json
(update the appropriate properties that you see there) - Add your Cosmos DB
URI
andPrimary Key
values (get these your Cosmos DB account'sSettings --> Keys
section in the Portal) into theCosmosDB
section ofappSettings.json
- Add your service bus connection string into
console/appsettings.json
Perform the following tasks to run the Key Vault demo:
- Create a Key Vault named AzureForDevsKeyVault in a Resource Group of your choosing. Allow all networks to access it.
- Add a secret named AppSecret into the new key vault and give it any value
- Create a Web App in Azure and deploy this application to it. You'll need to publish the app if running outside of Visual Studio by running "dotnet build" and "dotnet publish" and then publish the bin/Debug/netcoreappx.x/publishfolder to the Web App. The Azure Tools VS Code extension can help with this.
- Go into the Web App in the Azure Portal, select Identity, and turn on the System assigned option.
- Go to the Key Vault, select Access Policies, and add an access policy. Select your Web App as the principal and give the Secret permissions section Get> and List> privileges.
- Open the .sln file in Visual Studio
- Press F5 to build and run the project
-
Open the project
webapp
folder in VS Code -
Open a command prompt at the root and run the following command to trust dev certs:
dotnet dev-certs https --trust
-
Run
dotnet run
-
Open the browser and go to
https://localhost:5001