Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Task 1: Ensure Database Accessibility

  1. Sign in to the @lab.VirtualMachine(Workstation1).SelectLink as @lab.VirtualMachine(Workstation1).Username with the password @lab.VirtualMachine(Workstation1).Password.

    If you are using your pesonal machine and subscription, you will need to use your Windows/Azure login details where needed. The lab environment access details will not work.

  2. On WS-2022 ESX, start Microsoft Edge and go to the Azure Portal at https://portal.azure.com.

  3. Sign in to the Azure admin portal using the following credentials.
    • Microsoft 365 credentials:
      • Username: @lab.CloudPortalCredential(User1).Username
      • Password: @lab.CloudPortalCredential(User1).Password
  4. On the Welcome to Microsoft Azure page, select Cancel.

  5. In the Microsoft Azure portal, search for and select SQL databases.

  6. On the SQL databases blade, select DB01.

  7. On the DB01 blade, in the navigation pane, select Overview.

  8. On the Overview blade, select Set server firewall.

  9. On the Networking blade, under Firewall rules, select Add your client IPv4 address and then select Save.

  10. In the top breadcrumb navigation, select DB01.

  11. In the navigation pane, select Query editor.

  12. Under SQL server authentication, login as azureadmin with the password QWERTqwert12345.

  13. Expand Tables and verify dbo.Products is listed.
    If dbo.Products is **not** listed, perform the remaining steps.
    If dbo.Products is listed, continue to the next task.

  14. In Query 1, enter the following query:

     CREATE TABLE dbo.Products (
           ProductID INT PRIMARY KEY,
           ProductName NVARCHAR(255),
           Price DECIMAL(18, 2),
           Description NVARCHAR(MAX),
           CategoryID INT
         );
    
  15. On the menu, select Run.

  16. On the Messages tab, confirm the query succeeded.

  17. Remove the previous query and enter the following query and then select Run:

         INSERT INTO dbo.Products (ProductID, ProductName, Price, Description, CategoryID) VALUES
           (1, 'Organic Blueberries', 4.99, 'Sweet, antioxidant-rich organic blueberries.', 1),
           (2, 'Bananas', 1.29, 'Organic bananas, naturally ripened.', 1),
           (3, 'Organic Avocados', 2.99, 'Rich, creamy organic avocados.', 1),
           (4, 'Organic Broccoli', 3.49, 'Fresh, crisp organic broccoli.', 2),
           (5, 'Organic Carrots', 2.49, 'Sweet and crunchy organic carrots.', 2),
           (6, 'Organic Kale', 3.99, 'Dark, leafy green packed with nutrients.', 2),
           (7, 'Organic Greek Yogurt', 6.99, 'Thick, creamy organic Greek yogurt.', 3),
           (8, 'Organic Cheddar Cheese', 5.49, 'Sharp and rich organic cheddar cheese.', 3),
           (9, 'Free-Range Eggs', 4.29, 'Fresh, free-range large brown eggs.', 3),
           (10, 'Gluten-Free Bread', 6.99, 'Soft, gluten-free sandwich bread.', 4),
           (11, 'Sourdough Loaf', 4.99, 'Freshly baked artisan sourdough bread.', 4),
           (12, 'Vegan Chocolate Chip Cookies', 5.99, 'Delicious vegan chocolate chip cookies.', 4),
           (13, 'Grass-Fed Ground Beef', 8.99, '100% grass-fed ground beef.', 5),
           (14, 'Organic Chicken Breast', 9.99, 'Organic, free-range chicken breast.', 5),
           (15, 'Wild-Caught Shrimp', 13.99, 'Fresh, wild-caught shrimp from the Gulf.', 5),
           (16, 'Organic Olive Oil', 10.99, 'Extra virgin olive oil from Italy.', 6),
           (17, 'Brown Rice', 2.99, 'Nutty and wholesome organic brown rice.', 6),
           (18, 'Organic Almond Butter', 9.99, 'Smooth organic almond butter with no added sugar.', 6),
           (19, 'Organic Gala Apples', 3.99, 'Crisp and sweet, perfect for snacking.', 1),
           (20, 'Organic Baby Spinach', 4.99, 'Fresh organic spinach, ready to use.', 2),
           (21, 'Almond Milk - Unsweetened', 2.99, 'Dairy-free milk alternative, unsweetened.', 3),
           (22, 'Whole Wheat Bread', 5.49, 'Freshly baked whole wheat bread.', 4),
           (23, 'Wild-Caught Salmon', 12.99, 'Fresh wild-caught Alaskan salmon.', 5),
           (24, 'Organic Quinoa', 6.99, 'A versatile grain, rich in protein.', 6);
    
  18. On the Messages tab, confirm the query succeeded and there are 24 affected rows.

  19. In the breadcrumb navigation, select Home.

  20. In the unsaved edits message, select OK.