Updates to ARM and before the HOL guide

This commit is contained in:
kylebunting 2021-03-21 12:02:43 -04:00
Родитель 730a0bfab0
Коммит 52f1434347
10 изменённых файлов: 188 добавлений и 94 удалений

Просмотреть файл

@ -29,7 +29,8 @@ The names of manufacturers, products, or URLs are provided for informational pur
- [Task 2: Run ARM template to provision lab resources](#task-2-run-arm-template-to-provision-lab-resources)
- [Task 3: Configure application settings on the ToolBoothFunctions Function App](#task-3-configure-application-settings-on-the-toolboothfunctions-function-app)
- [Task 4: Add your IP address to the Cosmos DB firewall](#task-4-add-your-ip-address-to-the-cosmos-db-firewall)
- [Task 5: Create a GitHub account](#task-5-create-a-github-account)
- [Task 5: Set the default web browser to Microsoft Edge on the Lab VM](#task-5-set-the-default-web-browser-to-microsoft-edge-on-the-lab-vm)
- [Task 6: Create a GitHub account](#task-6-create-a-github-account)
# Serverless architecture before the hands-on lab setup guide
@ -42,7 +43,7 @@ The names of manufacturers, products, or URLs are provided for informational pur
## Before the hands-on lab
**Duration**: 15 minutes
**Duration**: 20 minutes
In this exercise, you set up your environment for use in the rest of the hands-on lab. You should follow all steps provided _before_ attending the hands-on lab.
@ -95,12 +96,12 @@ In this task, you run an Azure Resource Manager (ARM) template to create the han
- Application Insights
- Azure Computer Vision service
- Azure Event Grid Topic
- Azure Logic App
- Azure Key Vault plus secrets for:
- `computerVisionApiKey`
- `cosmosDBAuthorizationKey`
- `dataLakeConnectionString`
- `eventGridTopicKey`
- Azure Logic App
> **Note**: You can review the steps to manually provision and configure the lab resources in the [Manual resource setup guide](./Manual-resource-setup.md).
@ -113,30 +114,47 @@ In this task, you run an Azure Resource Manager (ARM) template to create the han
<img src="http://azuredeploy.net/deploybutton.png"/>
</a>
2. On the custom deployment screen in the Azure portal, enter the following:
2. On the custom deployment screen, the first parameter you need to populate is the `ObjectId` associated with the account you used to log into the Azure portal. To retrieve this, select the **Cloud Shell** icon on the Azure portal toolbar to open an Azure command line interface (CLI) terminal window at the bottom of your open browser window.
![The Cloud Shell icon is highlighted on the Azure portal toolbar.](media/azure-toolbar-cloud-shell.png "Azure toolbar")
3. In the PowerShell terminal window that opens in the Azure portal, enter the following command at the prompt:
```powershell
az ad signed-in-user show --query objectId -o tsv
```
![At the cloud shell prompt, the az ad signed-in-user show command is entered and highlighted.](media/azure-cli-az-ad-signed-in-user-show.png "Azure CLI")
4. Execute the command and copy the output value.
![In the cloud shell, the output from the az ad signed-in-user show command is highlighted.](media/azure-cli-az-ad-signed-in-user-show-output.png "Azure CLI")
5. Now, on the custom deployment screen in the Azure portal, enter the following:
- **Subscription**: Select the subscription you are using for this hands-on lab.
- **Resource group**: Select the hands-on-lab-SUFFIX resource group from the dropdown list.
- **Signed In User Object Id**: Paste the value you copied above from the cloud shell terminal command output.
- **Vm Username**: Accept the default value, **demouser**.
- **Vm Password**: Accept the default value, **Password.1!!**.
![The Custom deployment blade is displayed, and the information above is entered on the Custom deployment blade.](media/azure-custom-deployment.png "Custom deployment blade")
3. Select **Review + create** to review the custom deployment.
6. Select **Review + create** to review the custom deployment.
> **Note**: The ARM template will append a hyphen followed by a 13-digit string at the end of resource names. This suffix ensures globally unique names for resources. We will ignore that string when referring to resources throughout the lab.
4. On the Review + create blade, ensure the _Validation passed_ message is displayed and then select **Create** to begin the custom deployment.
7. On the Review + create blade, ensure the _Validation passed_ message is displayed and then select **Create** to begin the custom deployment.
> **Note**: The deployment of the custom ARM template should finish in about 5 minutes.
![On the Review + create blade for the custom deployment, the Validation passed message is highlighted, and the Create button is highlighted.](media/azure-custom-deployment-review-create.png "Review + create custom deployment")
5. You can monitor the deployment's progress on the **Deployment** blade that opens when you start the ARM template deployment. When the deployment completes, select **Outputs** from the left-hand menu.
8. You can monitor the deployment's progress on the **Deployment** blade that opens when you start the ARM template deployment. When the deployment completes, select **Outputs** from the left-hand menu.
![The Microsoft Template Deployment page is displayed, and the Outputs item is highlighted in the left-hand menu.](media/microsoft-template-deployment.png "Template deployment")
6. The deployment **Outputs** page contains the output values from running the deployment, including the endpoints for various services and the **Secret Uris** for the secrets added to Key Vault. Leave this page open for the next task, as you will be copying the **Secret Uri** values into the configuration for one of the Azure Function Apps.
9. The deployment **Outputs** page contains the output values from running the deployment, including the endpoints for various services and the **Secret Uris** for the secrets added to Key Vault. Leave this page open for the next task, as you will be copying the **Secret Uri** values into the configuration for one of the Azure Function Apps.
![The Outputs page of the template deployment is displayed. Outputs is selected and highlighted in the left-hand menu, and the four secret Uri values are highlighted in the list of outputs.](media/microsoft-template-deployment-outputs.png "Deployment outputs")
@ -220,7 +238,60 @@ In this task, you copy the Secret Uri values from the ARM template deployment's
5. Select **Save**.
### Task 5: Create a GitHub account
### Task 5: Set the default web browser to Microsoft Edge on the Lab VM
In this task, you create an RDP connection to your Lab virtual machine (VM) and change the default web browser to Microsoft Edge. This will ensure Microsoft Edge is used when launching a web browser from Visual Studio and prevent the functionality issues encountered if using Internet Explorer.
1. In the [Azure portal](https://portal.azure.com), select **Resource groups** from the Azure services list.
![Resource groups is highlighted in the Azure services list.](media/azure-services-resource-groups.png "Azure services")
2. Select the **hands-on-lab-SUFFIX** resource group from the list.
![The "hands-on-lab-SUFFIX" resource group is highlighted.](./media/resource-groups.png "Resource groups list")
3. In the list of resources within your resource group, select the **LabVM Virtual machine** resource.
![The list of resources in the hands-on-lab-SUFFIX resource group are displayed, and LabVM is highlighted.](./media/resource-group-resources-labvm.png "LabVM in resource group list")
4. On your LabVM blade, select **Connect** and **RDP** from the top menu.
![The LabVM blade is displayed, with the Connect button highlighted in the top menu.](./media/connect-vm-rdp.png "Connect to Lab VM")
5. On the Connect to virtual machine blade, select **Download RDP File**, then open the downloaded RDP file.
![The Connect to virtual machine blade is displayed, and the Download RDP File button is highlighted.](./media/connect-to-virtual-machine.png "Connect to virtual machine")
6. Select **Connect** on the Remote Desktop Connection dialog.
![In the Remote Desktop Connection Dialog Box, the Connect button is highlighted.](./media/remote-desktop-connection.png "Remote Desktop Connection dialog")
7. Enter the following credentials when prompted, and then select **OK**:
- **User name**: demouser
- **Password**: Password.1!!
![The credentials specified above are entered into the Enter your credentials dialog.](media/rdc-credentials.png "Enter your credentials")
8. Select **Yes** to connect if prompted that the remote computer's identity cannot be verified.
![In the Remote Desktop Connection dialog box, a warning states that the remote computer's identity cannot be verified and asks if you want to continue anyway. At the bottom, the Yes button is highlighted.](./media/remote-desktop-connection-identity-verification-labvm.png "Remote Desktop Connection dialog")
9. Once logged in, select the **Search** icon on the start bar, enter **default apps** into the search box, and select **Default apps** in the search results.
![The search icon is highlighted on the Windows start bar. In the search dialog, "default apps" is entered into the search box and highlighted. In the search results, Default apps is highlighted.](media/search-default-apps.png "Windows Search")
10. In the Default apps dialog, select **Internet Explorer** under **Web browser**.
![In the Default apps dialog, Internet Explorer is highlighted under Web browser.](media/default-apps-web-browser.png "Default apps")
11. In the **Choose an app** dialog, select **Microsoft Edge**
![In the Choose an App dialog, Microsoft Edge is highlighted.](media/default-apps-web-browser-choose-an-app.png "Choose an app")
12. Close the **Default apps** dialog**.
### Task 6: Create a GitHub account
In this task, you sign up for a free GitHub account, which is used for hosting a copy of the sample application used throughout this lab. This account will be integrated into the CI/CD workflow for pushing updates to the Function Apps in Azure.

Просмотреть файл

@ -2,6 +2,12 @@
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.3.0.0",
"parameters": {
"signedInUserObjectId": {
"type": "string",
"metadata":{
"description": "The Object Id associated with the account you used to sign into the Azure portal. Retrieve this using the Azure CLI and 'az ad signed-in-user show --query objectId -o tsv'."
}
},
"vmUsername": {
"defaultValue": "demouser",
"type": "string",
@ -74,11 +80,30 @@
"tenantId": "[subscription().tenantId]",
"accessPolicies": [
{
"objectId": "[parameters('signedInUserObjectId')]",
"permissions": {
"secrets": ["all"]
},
"tenantId": "[subscription().tenantId]"
}
]
}
},
{
"name": "[concat(variables('keyVaultName'), '/add')]",
"type": "Microsoft.KeyVault/vaults/accessPolicies",
"apiVersion": "2019-09-01",
"dependsOn": [
"[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]"
],
"properties": {
"accessPolicies": [
{
"tenantId": "[subscription().tenantId]",
"objectId": "[reference(resourceId('Microsoft.Web/sites', variables('tollBoothFunctionAppName')), '2019-08-01', 'Full').identity.principalId]",
"permissions": {
"secrets": ["get"]
},
"tenantId": "[subscription().tenantId]"
}
}
]
}
@ -296,81 +321,10 @@
"contentVersion": "1.0.0.0"
},
"parameters": {},
"state": "Enabled",
"sku": {
"name": "Standard"
}
"triggers": {},
"actions": {}
}
},
{
"name": "[variables('vmName')]",
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2020-06-01",
"location": "[variables('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/networkInterfaces/', variables('vmNetworkInterfaceName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[variables('vmSize')]"
},
"storageProfile": {
"osDisk": {
"createOption": "FromImage",
"managedDisk": {
"storageAccountType": "Premium_LRS"
}
},
"imageReference": {
"publisher": "microsoftvisualstudio",
"offer": "visualstudio2019latest",
"sku": "vs-2019-comm-latest-ws2019",
"version": "latest"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('vmNetworkInterfaceName'))]"
}
]
},
"osProfile": {
"computerName": "[variables('vmName')]",
"adminUsername": "[parameters('vmUsername')]",
"adminPassword": "[parameters('vmPassword')]",
"windowsConfiguration": {
"enableAutomaticUpdates": true,
"provisionVmAgent": true
}
}
},
"resources": [
{
"name": "SetupLabVm",
"type": "extensions",
"apiVersion": "2020-06-01",
"location": "[variables('location')]",
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"protectedSettings": {},
"typeHandlerVersion": "1.9",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": ["[variables('vmCustomScriptUri')]"],
"commandToExecute": "[concat('powershell -ExecutionPolicy Unrestricted -File ', variables('vmCustomScriptFileName'))]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
],
"tags": {
"displayName": "SetupLabVm"
}
}
]
},
{
"type": "Microsoft.Insights/components",
"apiVersion": "2018-05-01-preview",
@ -445,7 +399,7 @@
},
{
"name": "computerVisionApiKey",
"value": "[concat('@Microsoft.KeyVault(SecretUri=', '{computerVisionApiKeySecretUri}', ')')]"
"value": "[concat('@Microsoft.KeyVault(SecretUri=', reference(resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('cosmosDbAuthKeySecretName'))).secretUriWithVersion, ')')]"
},
{
"name": "cosmosDBEndpointUrl",
@ -453,7 +407,7 @@
},
{
"name": "cosmosDBAuthorizationKey",
"value": "[concat('@Microsoft.KeyVault(SecretUri=', '{cosmosDBAuthorizationKeySecretUri}', ')')]"
"value": "[concat('@Microsoft.KeyVault(SecretUri=', reference(resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('cosmosDbAuthKeySecretName'))).secretUriWithVersion, ')')]"
},
{
"name": "cosmosDBDatabaseId",
@ -465,7 +419,7 @@
},
{
"name": "dataLakeConnection",
"value": "[concat('@Microsoft.KeyVault(SecretUri=', '{dataLakeConnectionSecretUri}', ')')]"
"value": "[concat('@Microsoft.KeyVault(SecretUri=', reference(resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('dataLakeConnectionSecretName'))).secretUriWithVersion, ')')]"
},
{
"name": "eventGridTopicEndpoint",
@ -473,7 +427,7 @@
},
{
"name": "eventGridTopicKey",
"value": "[concat('@Microsoft.KeyVault(SecretUri=', '{eventGridTopicKeySecretUri}', ')')]"
"value": "[concat('@Microsoft.KeyVault(SecretUri=', reference(resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('eventGridTopicKeySecretName'))).secretUriWithVersion, ')')]"
},
{
"name": "exportCsvContainerName",
@ -570,6 +524,75 @@
}
}
},
{
"name": "[variables('vmName')]",
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2020-06-01",
"location": "[variables('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/networkInterfaces/', variables('vmNetworkInterfaceName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[variables('vmSize')]"
},
"storageProfile": {
"osDisk": {
"createOption": "FromImage",
"managedDisk": {
"storageAccountType": "Premium_LRS"
}
},
"imageReference": {
"publisher": "microsoftvisualstudio",
"offer": "visualstudio2019latest",
"sku": "vs-2019-comm-latest-ws2019",
"version": "latest"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('vmNetworkInterfaceName'))]"
}
]
},
"osProfile": {
"computerName": "[variables('vmName')]",
"adminUsername": "[parameters('vmUsername')]",
"adminPassword": "[parameters('vmPassword')]",
"windowsConfiguration": {
"enableAutomaticUpdates": true,
"provisionVmAgent": true
}
}
},
"resources": [
{
"name": "SetupLabVm",
"type": "extensions",
"apiVersion": "2020-06-01",
"location": "[variables('location')]",
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"protectedSettings": {},
"typeHandlerVersion": "1.9",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": ["[variables('vmCustomScriptUri')]"],
"commandToExecute": "[concat('powershell -ExecutionPolicy Unrestricted -File ', variables('vmCustomScriptFileName'))]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
],
"tags": {
"displayName": "SetupLabVm"
}
}
]
},
{
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('virtualNetworkName')]",
@ -656,6 +679,10 @@
}
],
"outputs": {
"ComputerVisionEndpoint": {
"type": "string",
"value": "[concat(reference(concat('Microsoft.CognitiveServices/accounts/', variables('computerVisionName'))).endpoint, 'vision/v3.0/ocr')]"
},
"CosmosDbEndpoint": {
"type": "string",
"value": "[reference(concat('Microsoft.DocumentDb/databaseAccounts/', variables('cosmosDbAccountName'))).documentEndpoint]"
@ -664,9 +691,9 @@
"type": "string",
"value": "[reference(concat('Microsoft.EventGrid/topics/', variables('eventGridTopicName'))).endpoint]"
},
"ComputerVisionEndpoint": {
"ComputerVisionKeySecretUri": {
"type": "string",
"value": "[concat(reference(concat('Microsoft.CognitiveServices/accounts/', variables('computerVisionName'))).endpoint, 'vision/v3.0/ocr')]"
"value": "[reference(resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('computerVisionSecretName'))).secretUriWithVersion]"
},
"CosmosDbAuthKeySecretUri": {
"type": "string",
@ -676,10 +703,6 @@
"type": "string",
"value": "[reference(resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('dataLakeConnectionSecretName'))).secretUriWithVersion]"
},
"ComputerVisionKeySecretUri": {
"type": "string",
"value": "[reference(resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('computerVisionSecretName'))).secretUriWithVersion]"
},
"EventGridTopicKeySecretUri": {
"type": "string",
"value": "[reference(resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('eventGridTopicKeySecretName'))).secretUriWithVersion]"

Двоичные данные
Hands-on lab/media/azure-cli-az-ad-signed-in-user-show-output.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 47 KiB

Двоичные данные
Hands-on lab/media/azure-cli-az-ad-signed-in-user-show.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 37 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 158 KiB

После

Ширина:  |  Высота:  |  Размер: 163 KiB

Двоичные данные
Hands-on lab/media/azure-custom-deployment.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 66 KiB

После

Ширина:  |  Высота:  |  Размер: 118 KiB

Двоичные данные
Hands-on lab/media/azure-toolbar-cloud-shell.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 10 KiB

Двоичные данные
Hands-on lab/media/default-apps-web-browser-choose-an-app.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 22 KiB

Двоичные данные
Hands-on lab/media/default-apps-web-browser.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 127 KiB

Двоичные данные
Hands-on lab/media/search-default-apps.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 59 KiB