Implement IaaS Solutions Flashcards

1
Q

What Docker command should you use to generate a container image?

1) az acr generate
2) az acr build
3) az acr import
4) az acr run

A

az acr build

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What command should you use to create an ARM template based off the resource group myRG?

1) az group export –name myRG
2) az group deployment –name myRG
3) az group deployment export –name myRG

A

az group export –name myRG

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What’s the command for deploying a template using the Azure CLI?

1) az deployment group create
2) az deployment create
3) az group deployment create

A

az deployment group create –name {templateName} –resource-group {groupName} –template-file $templateFile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What’s the commandlet for deploying a resource group template using PowerShell?

A

New-AzResourceGroupDeployment

New-AzResourceGroupDeployment -Name blanktemplate -ResourceGroupName myResourceGroup -TemplateFile $templateFile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How would you run a single test by using the test toolkit?

A

Use the parameter -Test and specify the test name with double quotation marks: “Template Should Not Contain Blanks”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What’s the Azure CLI command for deploying an ARM template?

A

az deployment group create

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s the benefit of using Azure Container Instance over a WebApp using Docker?

A

Doesn’t require IaaS provisioning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Azure Disk Encryption is supported for Generation 1 and 2. True or false?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When uploading a Disk Image to Azure they must be in what format?

A

VHD

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

When uploading a dynamic disk does it have to be converted to a fixed-size disk?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which command should you use to generate a docker container image?

  • az acr import
  • az acr update
  • az acr create
  • az acr build
A

az acr build

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What’s the format for tagging a Docker image in Registery registery1, called app1?

A

registry1.azurecr.io/app1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What’s the difference between az group export and az group deployment export?

A

az group export creates an ARM resource template for the resource group.
az group deployment export exports the template used for deployment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When creating a webapp with no exisiting plans what order should the commands be?

A

az group create
az appservice plan create
az webapp create

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What’s the command to create a resource group using AzureCLI?

A

az group create –name myResourceGroup –location eastus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What’s the command to create an Azure VM using AzureCLI?

A

az vm create \

  • -resource-group myResourceGroup \
  • -name myVM \
  • -image UbuntuLTS \
  • -admin-username azureuser \
  • -generate-ssh-keys
17
Q

What’s the command to create a resource group using PowerShell?

A

New-AzResourceGroup -Name “myResourceGroup” -Location “EastUS”

18
Q

What’s the command to create an Azure VM using PowerShell?

A

New-AzVm `

- ResourceGroupName "myResourceGroup" `
- Name "myVM" `
- Location "East US" `
- Image UbuntuLTS `
- size Standard_B2s `
- PublicIpAddressName myPubIP `
- OpenPorts 80,22 `
- GenerateSshKey `
- SshKeyName mySSHKey
19
Q

What PowerShell command would you use to get the Public IP address of a VM?

A

Get-AzPublicIpAddress -ResourceGroupName “myResourceGroup” | Select “IpAddress”

20
Q

What PowerShell command would you use to deploy an ARM template?

A

New-AzResourceGroupDeployment `

  • Name blanktemplate `
  • ResourceGroupName myResourceGroup `
  • TemplateFile $templateFile
21
Q

What commands would you use to tag and push a container to a Azure Docker registery?

A

docker tag aci-tutorial-app /aci-tutorial-app:v1

docker push /aci-tutorial-app:v1

21
Q

What commands would you use to tag and push a container to a Azure Docker registery?

A

docker tag appsvc-tutorial-custom-image .azurecr.io/appsvc-tutorial-custom-image:latest

docker push .azurecr.io/appsvc-tutorial-custom-image:latest

22
Q

What should the dockerfile look like for building a sample app?

A
FROM node:8.9.3-alpine
RUN mkdir -p /usr/src/app
COPY ./app/ /usr/src/app/
WORKDIR /usr/src/app
RUN npm install
CMD node /usr/src/app/index.js
23
Q

What AzureCLI command would you use to start a container instance?

A

az container create \

  • -resource-group learn-deploy-aci-rg \
  • -name mycontainer \
  • -image mcr.microsoft.com/azuredocs/aci-helloworld \
  • -ports 80 \
  • -dns-name-label $DNS_NAME_LABEL \
  • -location eastus
24
Q

What tag should you add to set enviroment variables for a docker container?

A

–environment-variables \

COSMOS_DB_ENDPOINT=$COSMOS_DB_ENDPOINT \

COSMOS_DB_MASTERKEY=$COSMOS_DB_MASTERKEY

25
Q

What Azure CLI command would you run to get a storage account key for a container?

A

STORAGE_KEY=$(az storage account keys list \

  • -resource-group learn-deploy-aci-rg \
  • -account-name $STORAGE_ACCOUNT_NAME \
  • -query “[0].value” \
  • -output tsv)
26
Q

When creating a container, what tags should you use for setting storage tags?

A
  • -azure-file-volume-account-name $STORAGE_ACCOUNT_NAME \
    • -azure-file-volume-account-key $STORAGE_KEY \
    • -azure-file-volume-share-name aci-share-demo \
    • -azure-file-volume-mount-path /aci/logs/
27
Q

Why would you use the command az container attach rather than az container logs?

A

The az container attach command shows container events and logs. By contrast, the az container logs only shows the logs and not the startup events.

28
Q

What is the basic overview for a docker file?

A

FROM {base image}

{Set Up}

EXPOSE [Ports to expose]

ENTRYPOINT [“command”]

29
Q

What PowerShell command should you use to create a container?

A

New-AzContainerGroup -ResourceGroupName myResourceGroup -Name mycontainer -Image mcr.microsoft.com/windows/servercore/iis:nanoserver -OsType Windows -DnsNameLabel aci-demo-win

30
Q

What would a docker file for building a web application look like?

A

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src
COPY [“WebApplication1/WebApplication1.csproj”, “WebApplication1/”]
RUN dotnet restore “WebApplication1/WebApplication1.csproj”
COPY . .
WORKDIR “/src/WebApplication1”
RUN dotnet build “WebApplication1.csproj” -c Release -o /app/build

FROM build AS publish
RUN dotnet publish “WebApplication1.csproj” -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY –from=publish /app/publish .
ENTRYPOINT [“dotnet”, “WebApplication1.dll”]