0% found this document useful (0 votes)
99 views87 pages

Getting Started With Containers In Azure Deploy Manage And Secure Containerized Applications 1st Edition Shimon Ifrah instant download

Ebook installation

Uploaded by

fujtpepot
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views87 pages

Getting Started With Containers In Azure Deploy Manage And Secure Containerized Applications 1st Edition Shimon Ifrah instant download

Ebook installation

Uploaded by

fujtpepot
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 87

Getting Started With Containers In Azure Deploy

Manage And Secure Containerized Applications 1st


Edition Shimon Ifrah download

https://ebookbell.com/product/getting-started-with-containers-in-
azure-deploy-manage-and-secure-containerized-applications-1st-
edition-shimon-ifrah-52850038

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Getting Started With Containers In Azure Deploy Manage And Secure


Containerized Applications Shimon Ifrah

https://ebookbell.com/product/getting-started-with-containers-in-
azure-deploy-manage-and-secure-containerized-applications-shimon-
ifrah-11363600

Getting Started With Containers In Azure Deploy Secure Cloud


Applications Using Terraform 2nd Edition Shimon Ifrah

https://ebookbell.com/product/getting-started-with-containers-in-
azure-deploy-secure-cloud-applications-using-terraform-2nd-edition-
shimon-ifrah-54542376

Getting Started With Containers In Google Cloud Platform Deploy Manage


And Secure Containerized Applications 1st Ed Shimon Ifrah

https://ebookbell.com/product/getting-started-with-containers-in-
google-cloud-platform-deploy-manage-and-secure-containerized-
applications-1st-ed-shimon-ifrah-22417632

Getting Started With Containerization Reduce The Operational Burden On


Your System By Automating And Managing Your Containers Hsu

https://ebookbell.com/product/getting-started-with-containerization-
reduce-the-operational-burden-on-your-system-by-automating-and-
managing-your-containers-hsu-10422194
Introducing Net 6 Getting Started With Blazor Maui Windows App Sdk
Desktop Development And Containers 1st Ed Nico Vermeir

https://ebookbell.com/product/introducing-net-6-getting-started-with-
blazor-maui-windows-app-sdk-desktop-development-and-containers-1st-ed-
nico-vermeir-38411572

Getting Started With Natural Language Processing Final Release 1st


Edition Ekaterina Kochmar

https://ebookbell.com/product/getting-started-with-natural-language-
processing-final-release-1st-edition-ekaterina-kochmar-46078164

Getting Started With Uno Platform And Winui 3 Handson Building Of


Crossplatform Desktop Mobile And Web Applications That Can Run
Anywhere 1st Edition Andrew Hoefling

https://ebookbell.com/product/getting-started-with-uno-platform-and-
winui-3-handson-building-of-crossplatform-desktop-mobile-and-web-
applications-that-can-run-anywhere-1st-edition-andrew-
hoefling-46364362

Getting Started With Secure Embedded Systems Alexandru Radovici

https://ebookbell.com/product/getting-started-with-secure-embedded-
systems-alexandru-radovici-47255148

Getting Started With Visual Studio 2022 Learning And Implementing New
Features 2nd Dirk Strauss

https://ebookbell.com/product/getting-started-with-visual-
studio-2022-learning-and-implementing-new-features-2nd-dirk-
strauss-47378260
Getting Started
with Containers
in Azure
Deploy, Manage, and Secure Containerized
Applications

Shimon Ifrah
Getting Started with
Containers in Azure
Deploy, Manage, and Secure
Containerized Applications

Shimon Ifrah
Getting Started with Containers in Azure: Deploy, Manage, and Secure
Containerized Applications
Shimon Ifrah
Melbourne, VIC, Australia

ISBN-13 (pbk): 978-1-4842-5752-4 ISBN-13 (electronic): 978-1-4842-5753-1


https://doi.org/10.1007/978-1-4842-5753-1

Copyright © 2020 by Shimon Ifrah


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image, we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Smriti Srivastava
Development Editor: Matthew Moodie
Coordinating Editor: Shrikant Vishwakarma
Cover designed by eStudioCalamar
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street,
6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, email orders-ny@springer-sbm.
com, or visit www.springeronline.com. Apress Media, LLC is a California LLC, and the sole member (owner)
is Springer Science+Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware
corporation.
For information on translations, please email [email protected], or visit http://www.apress.com/
rights-permissions.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book’s product page, located at www.apress.com/978-1-4842-5752-4. For more
detailed information, please visit http://www.apress.com/source-code.
Printed on acid-free paper
Table of Contents
About the Author����������������������������������������������������������������������������������������������������� xi

About the Technical Reviewer������������������������������������������������������������������������������� xiii


Introduction�������������������������������������������������������������������������������������������������������������xv

Chapter 1: Get Started with Microsoft Azure������������������������������������������������������������ 1


Setting Up Your Azure Subscription���������������������������������������������������������������������������������������������� 1
Sign Up for Azure��������������������������������������������������������������������������������������������������������������������� 2
Assigning Permissions to Azure���������������������������������������������������������������������������������������������� 4
Set Up Azure Cloud Shell��������������������������������������������������������������������������������������������������������������� 9
Azure CLI������������������������������������������������������������������������������������������������������������������������������� 12
Using PowerShell in Azure Cloud Shell���������������������������������������������������������������������������������� 14
Azure Cloud Shell Code Editor����������������������������������������������������������������������������������������������� 15
Uploading and Downloading Files to and from Azure Cloud Shell����������������������������������������� 17
Secure Your Microsoft Azure Account����������������������������������������������������������������������������������������� 18
Enable Multi-Factor Authentication (MFA)����������������������������������������������������������������������������� 19
Check Global Administrator Accounts������������������������������������������������������������������������������������ 21
Azure Container Services������������������������������������������������������������������������������������������������������������ 22
Azure Container Instances (ACI)�������������������������������������������������������������������������������������������� 23
Azure Kubernetes Services (AKS)������������������������������������������������������������������������������������������ 24
Azure Container Registry (ACR)��������������������������������������������������������������������������������������������� 25
Summary������������������������������������������������������������������������������������������������������������������������������������ 26

iii
Table of Contents

Chapter 2: Store and Manage Docker Container Images on Azure Container


Registry (ACR)�������������������������������������������������������������������������������������������������������� 27
Overview of Azure Container Registry (ACR)������������������������������������������������������������������������������� 28
Set Up Microsoft Azure Container Registry (ACR)����������������������������������������������������������������������� 29
Install Docker Desktop����������������������������������������������������������������������������������������������������������� 29
Creating Azure Container Registry (ACR) Using the Portal���������������������������������������������������� 30
Creating Azure Container Registry Using Azure CLI��������������������������������������������������������������� 33
Push Docker Images to Azure Container Registry (ACR)������������������������������������������������������������� 34
Connect to ACR Using Docker������������������������������������������������������������������������������������������������ 35
Pull Images from Azure Container Registry (ACR)����������������������������������������������������������������������� 38
Manage and Secure Azure Container Registry (ACR)������������������������������������������������������������������ 39
Install VS Code����������������������������������������������������������������������������������������������������������������������� 40
Install Docker Extension�������������������������������������������������������������������������������������������������������� 40
Manage Containers with VS Code����������������������������������������������������������������������������������������� 43
Manage Docker Images with VS Code����������������������������������������������������������������������������������� 44
Manage a Container Registry with VS Code�������������������������������������������������������������������������� 44
Securing Azure Container Registry (ACR)������������������������������������������������������������������������������ 49
Upgrade ACR SKU Plan���������������������������������������������������������������������������������������������������������� 49
Rotate ACR Access Keys�������������������������������������������������������������������������������������������������������� 52
Azure CLI������������������������������������������������������������������������������������������������������������������������������� 53
Summary������������������������������������������������������������������������������������������������������������������������������������ 55

Chapter 3: Deploy Containerized Applications with Azure Container


Instances (ACI)������������������������������������������������������������������������������������������������������� 57
Set Up Azure Container Instances (ACI)�������������������������������������������������������������������������������������� 58
AZ Container Commands������������������������������������������������������������������������������������������������������� 59
Container Groups������������������������������������������������������������������������������������������������������������������� 60
ACI Limitations���������������������������������������������������������������������������������������������������������������������� 60
Deploy Linux and Windows Containers to ACI����������������������������������������������������������������������������� 60
Deploy Linux Containers�������������������������������������������������������������������������������������������������������� 61
Deploy Containers Using Azure CLI���������������������������������������������������������������������������������������� 67
Deploy Windows Containers�������������������������������������������������������������������������������������������������� 68

iv
Table of Contents

Mount Storage Volume to an ACI Container��������������������������������������������������������������������������� 70


Mounting Azure File Share Volume to an ACI Container�������������������������������������������������������� 71
Scale Containerized Applications in ACI�������������������������������������������������������������������������������������� 76
Deploy to Web App for Containers����������������������������������������������������������������������������������������� 81
Monitor and Manage Containerized Applications on ACI������������������������������������������������������������� 83
Monitoring ACI with Azure Monitor���������������������������������������������������������������������������������������� 83
Managing ACI Deployments��������������������������������������������������������������������������������������������������� 89
Manage ACI with Azure Resource Explorer���������������������������������������������������������������������������� 95
Summary������������������������������������������������������������������������������������������������������������������������������������ 96

Chapter 4: Deploy Containerized Applications with Azure Kubernetes


Service (AKS)���������������������������������������������������������������������������������������������������������� 97
Kubernetes���������������������������������������������������������������������������������������������������������������������������������� 98
Kubernetes Components������������������������������������������������������������������������������������������������������������� 98
Kubernetes Master���������������������������������������������������������������������������������������������������������������� 98
Kubernetes Node������������������������������������������������������������������������������������������������������������������� 99
Kubernetes Add-ons�������������������������������������������������������������������������������������������������������������� 99
Getting Started with AKS����������������������������������������������������������������������������������������������������������� 100
Creating an AKS Cluster������������������������������������������������������������������������������������������������������ 100
Creating an AKS Cluster Using Azure Cloud Shell���������������������������������������������������������������� 108
Connecting ACR to AKS�������������������������������������������������������������������������������������������������������� 108
Deploying Containers Using an ACR Image to AKS�������������������������������������������������������������� 109
Deploy Kubernetes Web UI (Dashboard) on AKS����������������������������������������������������������������������� 112
Enable Web UI (Dashboard) on AKS������������������������������������������������������������������������������������� 113
Deploy with Dashboard (Web UI)����������������������������������������������������������������������������������������� 113
Mount Storage Volumes in AKS������������������������������������������������������������������������������������������������� 116
Create a Storage Class�������������������������������������������������������������������������������������������������������� 117
Create a Storage Role���������������������������������������������������������������������������������������������������������� 118
Create a Volume Claim�������������������������������������������������������������������������������������������������������� 119
Create a Deployment with Persistent Storage��������������������������������������������������������������������� 119
Manage and Secure AKS����������������������������������������������������������������������������������������������������������� 121
Summary���������������������������������������������������������������������������������������������������������������������������������� 128

v
Table of Contents

Chapter 5: Deploy Docker Container Host on Azure Virtual Machine������������������� 129


Why Use a Container Host?������������������������������������������������������������������������������������������������������� 129
Installing Docker Container Host on Ubuntu Linux VM�������������������������������������������������������������� 130
Create a Linux Docker Host Using the Portal����������������������������������������������������������������������� 130
Create a Linux Docker Host Using Azure CLI and Azure Cloud Shell����������������������������������� 132
Get Azure VM Using Azure CLI��������������������������������������������������������������������������������������������� 133
Connect Using SSH from Azure Cloud Shell������������������������������������������������������������������������ 134
Install Docker Using the Snap Application Store����������������������������������������������������������������� 135
Install the Latest Docker Version����������������������������������������������������������������������������������������� 136
Install Docker Container Host on Windows Server 2019 VM����������������������������������������������������� 137
Create a Windows Docker Container Using the Portal��������������������������������������������������������� 137
Create a Windows Docker Container Using Azure CLI��������������������������������������������������������� 138
Connect to the VM��������������������������������������������������������������������������������������������������������������� 139
Update Docker on Windows Server 2019���������������������������������������������������������������������������� 140
Manage Container Hosts on Azure�������������������������������������������������������������������������������������������� 141
Auto-Shutdown Container Host VM������������������������������������������������������������������������������������� 141
Configure Start/Stop Container Host VM����������������������������������������������������������������������������� 144
Summary���������������������������������������������������������������������������������������������������������������������������������� 160

Chapter 6: Secure Your Microsoft Azure Containers�������������������������������������������� 161


Protect and Manage Accounts and Hosts on Microsoft Azure Using Azure AD and Bastion����� 162
Azure Active Directory Reporting����������������������������������������������������������������������������������������� 162
Azure Bastion���������������������������������������������������������������������������������������������������������������������������� 167
Azure Bastion Pricing���������������������������������������������������������������������������������������������������������� 167
Bastion in Action������������������������������������������������������������������������������������������������������������������ 168
Enable Azure Bastion on an Azure VM��������������������������������������������������������������������������������� 168
Manage Bastion������������������������������������������������������������������������������������������������������������������� 175
Create Bastion Using Azure PowerShell������������������������������������������������������������������������������ 177

vi
Table of Contents

Use Azure Security Center and Secure Score to Protect Your Tenant��������������������������������������� 177
Security Center�������������������������������������������������������������������������������������������������������������������� 177
Secure Score����������������������������������������������������������������������������������������������������������������������� 182
Secure Your Containers with Azure Firewall and Network Security Groups (NSG)������������������� 184
Azure Firewall���������������������������������������������������������������������������������������������������������������������� 184
Network Security Groups (NSGs)����������������������������������������������������������������������������������������� 184
Summary���������������������������������������������������������������������������������������������������������������������������������� 193

Chapter 7: Scale Containers and Containerized Applications on Azure��������������� 195


Scale Azure Kubernetes Service (AKS)������������������������������������������������������������������������������������� 195
Create an AKS Cluster��������������������������������������������������������������������������������������������������������� 196
Scaling an AKS Cluster�������������������������������������������������������������������������������������������������������� 196
Autoscale AKS Using Azure CLI�������������������������������������������������������������������������������������������� 201
Update Existing AKS Cluster to Autoscale��������������������������������������������������������������������������� 202
Delete an AKS Cluster Using Azure CLI�������������������������������������������������������������������������������� 202
Scale Azure Container Instances (ACI)�������������������������������������������������������������������������������������� 202
Scale Azure Container Registry (ACR)��������������������������������������������������������������������������������������� 205
Scale Azure Docker Container Host VM������������������������������������������������������������������������������������� 205
Scale an Azure VM Using the Portal������������������������������������������������������������������������������������� 206
Scale an Azure VM Using Azure CLI������������������������������������������������������������������������������������� 207
Azure Spot Virtual Machines����������������������������������������������������������������������������������������������������� 207
Azure Spot Virtual Machines Pricing����������������������������������������������������������������������������������� 208
Deploy a Spot Virtual Machine��������������������������������������������������������������������������������������������� 208
Eviction Policy��������������������������������������������������������������������������������������������������������������������� 209
Create a Spot VM Using Azure CLI��������������������������������������������������������������������������������������� 210
Summary���������������������������������������������������������������������������������������������������������������������������������� 210

Chapter 8: Monitor Containers and Containerized Applications on Azure����������� 211


Azure Monitor Overview������������������������������������������������������������������������������������������������������������ 211
Azure Monitor Products������������������������������������������������������������������������������������������������������� 212
Azure Monitor Data�������������������������������������������������������������������������������������������������������������� 212
Azure Monitor Activity Logs������������������������������������������������������������������������������������������������������ 213

vii
Table of Contents

Monitor Azure Kubernetes Service (AKS)���������������������������������������������������������������������������������� 213


Log Analytics����������������������������������������������������������������������������������������������������������������������� 214
Monitoring��������������������������������������������������������������������������������������������������������������������������� 215
Disable Azure Monitor for Containers���������������������������������������������������������������������������������� 223
Monitor Azure Container Instances (ACI)����������������������������������������������������������������������������������� 224
Monitor ACI with Azure CLI�������������������������������������������������������������������������������������������������� 226
Monitor Azure Container Registry (ACR)����������������������������������������������������������������������������������� 227
Monitor Azure Docker Container Host VM��������������������������������������������������������������������������������� 230
Azure Monitor Insights for VMs������������������������������������������������������������������������������������������� 231
Connection Monitor������������������������������������������������������������������������������������������������������������� 241
Disable Azure Monitoring for VMs��������������������������������������������������������������������������������������� 244
Summary���������������������������������������������������������������������������������������������������������������������������������� 246

Chapter 9: Back Up and Restore Containers and Containerized


Applications on Azure������������������������������������������������������������������������������������������ 247
Azure Backup Solutions������������������������������������������������������������������������������������������������������������ 248
Azure Backup���������������������������������������������������������������������������������������������������������������������� 248
Azure Site Recovery������������������������������������������������������������������������������������������������������������ 249
Back Up Azure Kubernetes Service (AKS)��������������������������������������������������������������������������������� 250
Azure Recovery Services����������������������������������������������������������������������������������������������������� 251
Back Up Azure File Shares��������������������������������������������������������������������������������������������������� 256
Restore Azure File Shares��������������������������������������������������������������������������������������������������� 260
Monitor Backup Jobs����������������������������������������������������������������������������������������������������������� 264
Back Up Azure Container Instances (ACI)���������������������������������������������������������������������������������� 266
Back Up Azure Container Registry (ACR)����������������������������������������������������������������������������������� 268
Back Up Azure Docker Container Host VM�������������������������������������������������������������������������������� 269
Back Up Azure VM Using Azure CLI�������������������������������������������������������������������������������������� 273
Restore a Virtual Machine���������������������������������������������������������������������������������������������������� 273
Delete Recovery Services Vault������������������������������������������������������������������������������������������������ 276
Summary���������������������������������������������������������������������������������������������������������������������������������� 278

viii
Table of Contents

Chapter 10: Troubleshooting Containers and Containerized


Applications on Azure������������������������������������������������������������������������������������������ 279
Troubleshooting Azure Kubernetes Service (AKS)��������������������������������������������������������������������� 281
Capacity Issues������������������������������������������������������������������������������������������������������������������� 281
Storage Issues��������������������������������������������������������������������������������������������������������������������� 281
AKS Limits��������������������������������������������������������������������������������������������������������������������������� 281
IP Address Limit������������������������������������������������������������������������������������������������������������������� 282
Pod Issues��������������������������������������������������������������������������������������������������������������������������� 282
Troubleshoot Azure Container Instances (ACI)�������������������������������������������������������������������������� 283
Slow Start���������������������������������������������������������������������������������������������������������������������������� 283
Support Versions����������������������������������������������������������������������������������������������������������������� 284
Bad Performance����������������������������������������������������������������������������������������������������������������� 284
Troubleshoot Azure Container Registry (ACR)��������������������������������������������������������������������������� 284
Storage Issues��������������������������������������������������������������������������������������������������������������������� 284
Performance Issues������������������������������������������������������������������������������������������������������������� 285
Can’t Log In to ACR�������������������������������������������������������������������������������������������������������������� 285
Access Issues (Firewall)������������������������������������������������������������������������������������������������������ 285
Troubleshoot Azure Docker Container Host VM������������������������������������������������������������������������� 286
Boot Diagnostics������������������������������������������������������������������������������������������������������������������ 287
Redeploy VM������������������������������������������������������������������������������������������������������������������������ 290
Serial Console���������������������������������������������������������������������������������������������������������������������� 292
Connection Troubleshooting������������������������������������������������������������������������������������������������ 293
Summary���������������������������������������������������������������������������������������������������������������������������������� 294

Index��������������������������������������������������������������������������������������������������������������������� 295

ix
About the Author
Shimon Ifrah is an IT professional with years of experience
in the design, management, and deployment of information
technology systems and networks. In the last few years,
Shimon has been specializing in cloud computing and
containerized applications on Amazon AWS and other
public cloud providers. Shimon also holds more than twenty
vendor certificates from Microsoft, AWS, VMware, and Cisco.
During his career in the IT industry, he has worked for some
of the largest managed services and technology companies
in the world, helping them administer systems for the largest
enterprises. He is based out of Melbourne, Australia.

xi
About the Technical Reviewer
Samuel Rowe is a technologist who specializes in
application innovation and solving problems. He is an
agile advocate with extensive experience in DevOps and
cloud practices. He is currently working at Microsoft as a
solution architect, having previously worked for IBM and
Codeweavers.

xiii
Introduction
Back in early 2019, while finishing my book on deploying containers on AWS, I decided I
wanted to write a similar book about the same technology in Microsoft Azure.
In a multi-cloud world where companies use multiple cloud providers to run their
workload, locking yourself to one platform is not an ideal solution. Because most cloud
platforms offer similar services, transitioning between platforms is not hard if you
already have experience with one platform.
There is no doubt that Microsoft Azure is a great platform, and ignoring it can only
harm your career path to success. This book will fill in the gaps and give you a step-by-­
step guide on getting started with Azure and deploying containerized applications on
Azure services.
Azure has a variety of cloud services that allow us to deploy containers, and in this
book I will cover each of them in great detail.
When I planned this book, I wanted to achieve two things:

Write a book that is not superficial and that touches topics on a


deep technical level backed by a step-by-step approach.

Write a book that covers all elements of running applications in a


production environment and doesn’t just focus on running code.

In this book, you will not find pages filled with back-to-back code. Instead, you
will find chapters filled with technical information and explanations that will help you
understand and take actions. My detailed, easy to understand, step-by-step approach
will walk you through the labs without missing important information.
I hope you will find this book useful and helpful in growing your career and
knowledge base. This book is the second book in my “Deploy Containers” book series,
and I hope you like it.
The third book in the series is planned to be released in 2021.
I would like to take this opportunity to say thank you to my loving family for their
amazing support and love that they have given me during the writing stages.
I would also like to say thank you to the amazing team at Apress for believing in me
and giving me the opportunity to publish my books.

xv
CHAPTER 1

Get Started with


Microsoft Azure
This book will cover all Microsoft Azure Container services and support services needed
to secure, back up, and maintain containerized applications on Microsoft Azure. In this
chapter, we will focus on setting up our Microsoft Azure cloud environment and all the
tools needed to deploy containers in Azure.
We will start with signing up for a Microsoft Azure subscription, and then we will
assign permissions for our Administrator account, set up Azure Cloud Shell and Azure CLI,
and finish with an overview of all the Container services on Microsoft Azure. To begin, we
will cover the basics and build our capabilities from there using the following topics:

• Set up your Azure tenant and subscription.

• Secure and set up Administrative permissions.

• Set up Azure Cloud Shell.

• Perform Azure Container Services Overview.

Setting Up Your Azure Subscription


The first step in getting started with Azure is setting up an Azure account and billing.
Like other cloud providers, Microsoft Azure offers free Azure services to people
signing up.
Currently, Azure offers the following for new accounts:
Twelve months of free services (see Table 1-1)
$200 free credit to use any Azure service for thirty days
25+ Azure services that are always free to use

1
© Shimon Ifrah 2020
S. Ifrah, Getting Started with Containers in Azure, https://doi.org/10.1007/978-1-4842-5753-1_1
Chapter 1 Get Started with Microsoft Azure

Table 1-1 shows each service that is free for twelve months and its free monthly limit.

Table 1-1. Twelve Months Free Services


Service Details

Linux and Windows Virtual 750 hours every month using B1S VM
Machines instance
Blob Storage 5 GB of LRS hot block storage
SQL Database 20 GB of storage
File Storage 5 GB of LRS file storage
Managed Disks 64 GB x 2
Azure Cosmos DB 5 GB and 400 requests units
Bandwidth 15 GB of outbound data transfer

Table 1-2 lists the main Azure products that are always free.

Table 1-2. Azure Products and Services That Are Always Free
Service Details

App Services (Compute) 10 web, mobile or API apps


Azure Functions (Compute) 1,000,000 requests per month
AKS (Artificial Intelligence + Machine learning) Free deployments of containers
Face API (Artificial Intelligence + Machine learning) 30,000 requests
DevTest Labs Free developer tools

The main objective of the free services is getting you to explore, understand, and
learn how to use them at no cost, and it is recommended you take advantage of the free
services.

S
 ign Up for Azure
To get started and sign up for Azure, you will need to provide a billing method, regardless
of whether you are using free services or not.
2
Chapter 1 Get Started with Microsoft Azure

The billing method is used if you use Azure services that are not included in the free offer.
To sign up for an Azure account, use the following URL: https://azure.microsoft.
com/en-us/free/. Fill in your details and follow the prompts. During the registration
process, you will be asked to verify your identity using one of the following two
verification methods.

Phone verification — using an SMS or automated phone call

Credit card — providing a credit card for billing purposes


Make sure you have these with you before signing into Azure.
Figure 1-1 shows the signup page with the free offers that are included for new
account registrations.

Figure 1-1. Try Azure for free

3
Chapter 1 Get Started with Microsoft Azure

After the registration process is complete, you will be redirected to the Azure portal
and presented with an option to take a tour that will show you where everything is in the
portal.
If you are new to Microsoft Azure, I recommend you take the tour.

Assigning Permissions to Azure


Now that we have our subscription and are logged in to the Azure portal, we will explore
the steps needed to assign permissions in Azure.
By default, the user who creates the Azure subscription has the Global Administrator
permission, which gives him or her full administrative rights to manage all resources and
subscriptions.
This section will show you how to use role-based access control (RBAC) to assign
permissions in Azure. Microsoft Azure uses RBAC to control access to Azure resources.
RBAC is very powerful because it breaks down the permissions into roles and limits the
number of permissions given to each person. Because the permissions are based on
roles, the risk of giving too many permissions is limited.
In Azure, RBAC is implemented using access control, also known as identity and
access management (IAM), which is available on a subscription level, resource-group
level, and individual-resource level, which means we can control access to Azure
resources on a few levels.
In most cases, you will assign your Global Administrators Owner permissions on the
subscription level, which will give them access to all the resources on Azure; however, in
an enterprise environment it is recommended you use management groups.
For other users, you can limit access to either the resource-group level or individual
resources.
In Figure 1-2, you can see the access control (IAM) blade on the subscription level.

4
Chapter 1 Get Started with Microsoft Azure

Figure 1-2. Access control (IAM)

Adding a user to an RBAC role on the subscription level will give them access to all
the resources in the subscription.
To add a user to an RBAC role, from the left menu on the Microsoft Azure portal click
on All Services, then click on Subscriptions, as shown in Figure 1-3.

Figure 1-3. Azure subscriptions

From the Subscriptions page, select the Azure subscription you would like to assign
permissions to.
In my case, I only have one subscription, which is the Free Trial subscription, as
shown in Figure 1-4.

5
Chapter 1 Get Started with Microsoft Azure

Figure 1-4. Azure Subscriptions page

From the Subscriptions page, I will click on the Access Control (IAM) menu on the
left, as shown in Figure 1-5.

Figure 1-5. Access Control (IAM) page

6
Chapter 1 Get Started with Microsoft Azure

To assign permissions to a user, click on Add and select “Add role assignment” from
the drop-down menu, as shown in Figure 1-6.

Figure 1-6. Add Role assignment

On the Add Role Assignment page, I have the option to select the role I would like to
assign from the list.
Currently, Azure offers more than seventy assignment roles to select from.
The Owner role will give the user full administrative permissions for everything in
Azure, including access to resources. You should avoid assigning this role to too many
administrators, and Microsoft recommends that you have less than five administrators
with Owner permissions.
Figure 1-7 shows the Add Role Assignment page and part of the list of roles
available.

7
Chapter 1 Get Started with Microsoft Azure

Figure 1-7. Add Role Assignment page

After selecting the role, I have the option to assign it to the user or groups.
From the Select search box, search for the user you would like to assign the owner
role and click Save, as shown in Figure 1-8.

8
Chapter 1 Get Started with Microsoft Azure

Figure 1-8. Select user from the Add Role Assignment page

Set Up Azure Cloud Shell


In this section, we will configure Azure Cloud Shell and learn how to use it and how to
manage resources and services in Microsoft Azure.
Azure Cloud Shell is a browser-based command-line utility hosted in Microsoft
Azure and pre-loaded with common tools and programming languages.
Azure Cloud Shell is available from anywhere and is always up-to-date with the latest
tools. All the data, including the command-line history, is saved into a persistent Azure
file share.
Azure Cloud Shell pricing is based on the Azure file share size where the data exist.
In Cloud Shell, we select between Bash and PowerShell as the shell we will run the
command from.
When using the Bash Shell, the Azure file share will create a 5GB image that will be
used to run it.
To set up Cloud Shell, from the Azure portal click on the Cloud Shell icon, as shown
in Figure 1-9.

9
Chapter 1 Get Started with Microsoft Azure

Figure 1-9. Azure Cloud Shell icon

When you open Azure Cloud Shell for the first time, it will ask you to select which
shell you would like to start with.
In my case, I will select Bash.
Figure 1-10 shows the Welcome to Azure Cloud Shell page.

Figure 1-10. Welcome to Azure Cloud Shell page

Before we can start using Azure Cloud Shell, we need to create a storage account that
will be used to keep our data access sessions.
Figure 1-11 shows the storage account setup for Azure Cloud Shell.

10
Chapter 1 Get Started with Microsoft Azure

Figure 1-11. Create Azure file share for Azure Cloud Shell

After creating the storage account, you will be redirected Azure Cloud Shell, as
shown in Figure 1-12.
You will also notice that Bash Shell is being used.

Figure 1-12. Azure Cloud Shell has been created screen

11
Chapter 1 Get Started with Microsoft Azure

A
 zure CLI
Azure CLI is a command-line tool that Microsoft designed to automate, manage, and
deploy Azure services quickly and effectively.
The tool can be installed on any platform, is preloaded into Azure Cloud Shell, and is
always running the latest version.
Azure CLI is also available as a Docker image that can be run inside a container;
to download the Azure CLI Docker image, please visit https://hub.docker.com/r/
microsoft/azure-cli/.
To download and install Azure CLI for Windows, MacOS, and Linux, please visit
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-­
cli-­latest.
To get started with Azure CLI inside Azure Cloud Shell, type the following command:

az -h

In Figure 1-13, you can see the Azure CLI Help menu and all the available commands.

Figure 1-13. Azure CLI help


12
Chapter 1 Get Started with Microsoft Azure

The Azure CLI command syntax is as follows:

az command action

In Figure 1-14, you can see an Azure CLI command that shows all the resources
available inside an Azure subscription.

Figure 1-14. Azure CLI az resource list command


The command is:
az resource list
Azure Cloud Shell also offers a fast switch between the Bash and PowerShell
experiences.
To switch between Bash Shell and PowerShell, use the top left corner drop-down
menu to switch between the shells.
Figure 1-15 shows the drop-down menu that switches between Bash and PowerShell.

13
Chapter 1 Get Started with Microsoft Azure

Figure 1-15. Switch between Bash and PowerShell

You can switch between the shells anytime, and all sessions’ information will be
saved automatically.
It is important to note that if you have processing running in the Bash sessions, that
information will continue running.
Figure 1-16 shows the confirmation screen when you switch between shells.

Figure 1-16. Switch between shells

Using PowerShell in Azure Cloud Shell


If you decide to use PowerShell in Azure Cloud Shell, please note that the PowerShell
version running in Cloud Shell is PowerShell Core.
PowerShell Core, also known as PowerShell 6.0, is the open-sourced and multi-­
platform version of PowerShell.
In Figure 1-17, you can see the PowerShell experience inside Azure Cloud Shell.
By default, Azure AD and Exchange Online PowerShell tools are also available from
Azure Cloud Shell.

14
Chapter 1 Get Started with Microsoft Azure

Figure 1-17. PowerShell in Azure Cloud Shell

To view all the available PowerShell modules in Azure Cloud Shell, type the following
command:

Get-module az*

Azure Cloud Shell Code Editor


Azure Cloud Shell also comes pre-loaded with a code editor out of the box without your
needing to install it.
The editor is based on the open-source code editor Monaco Editor, which is the
same code editor used by Visual Studio Code.
The editor allows us to do the following:

1. Create scripts and notes


2. Edit existing or new scripts

3. Highlight language code

4. Use the command palette

5. Access File Explorer

You can access the editor in two ways; first, by using the following command:

code.

15
Chapter 1 Get Started with Microsoft Azure

The second option is by using the editor icon, available from the top menu.
Figure 1-18 shows the editor icon in Azure Cloud Shell. The editor is available from
both shells, PowerShell and Bash.

Figure 1-18. Azure Cloud Shell editor icon

If you click on the editor icon or use the command to start it, you will see it in action,
as shown in Figure 1-19.
Once opened, you can start typing your code or paste it.
To create a new file, simply use the following command:

touch script.sh

The preceding command will create a Bash script, which we can load from the Files
menu on the left and then start writing code into it.

Figure 1-19. Editor in action


16
Chapter 1 Get Started with Microsoft Azure

To run a script in Azure Cloud Shell, simply use the following command:

bash bashscript.sh

 ploading and Downloading Files to and from Azure


U
Cloud Shell
What if you want to upload or download scripts to or from Azure Cloud Shell?
That’s not a problem. Azure Cloud Shell comes with a built-in File Explorer that
allows us to easily upload and download files that are stored on Azure Cloud Shell.
Figure 1-20 shows Azure Cloud Shell File Explorer and how easy it is to access it.

Figure 1-20. Azure Cloud Shell File Explorer

If you click on “Manage file share,” you will be redirected to the actual Azure file
share that holds your Azure Cloud Shell sessions.
Figure 1-21 shows the Azure file share that stores the Azure Cloud Shell sessions with
the following details:

Storage account name

Azure file share name

Quota — in my case, the size is 6 GiB

17
Chapter 1 Get Started with Microsoft Azure

Figure 1-21. Azure file share

If you would like to check which version of PowerShell Azure Cloud Shell is running,
simply run the following command:

$PSVersionTable

As you can see in the output shown in Figure 1-22, Azure Cloud Shell runs
PowerShell Core version 6.2.3.

Figure 1-22. PowerShell Core version command

The operating system that runs Azure Cloud Shell is Linux Ubuntu.

Secure Your Microsoft Azure Account


Now that we have our Microsoft Azure subscription and account up and running and
Azure Cloud Shell configured, it is time to move on to something very important: making
sure your Azure account is secure enough.
Securing your Microsoft Azure Global Administrator account is an important task
that should not be ignored.

18
Chapter 1 Get Started with Microsoft Azure

If your Azure account is compromised and broken into your data can be exposed and
exploited by malicious people.
Therefore, in this section I will show you methods that will help secure your Azure
Global Administrator account and your tenant in general.

Enable Multi-Factor Authentication (MFA)


According to global security research that was released back in 2018, enabling multi-­
factor authentication (MFA) on your account and your user accounts can reduce the risk
of their being broken by 80 percent. This is a quick win that goes a long way in improving
the overall security status of your Azure account.
By default, Microsoft Azure doesn’t charge extra fees for enabling MFA for the Global
Administrator account, which shows the commitment Microsoft has for security and
making sure customer data is safe.
To enable MFA on your Global Administrator account, open Azure Active Directory
from the Azure portal.
Click on All Services, select Identity, and click on Azure Active Directory. Figure 1-23
shows the Azure Active Directory icon.

Figure 1-23. Azure Active Directory

19
Chapter 1 Get Started with Microsoft Azure

From the Azure Active Directory main page, click on Users, as shown in Figure 1-24.

Figure 1-24. Azure Active Directory Users menu

From the Users menu, select your Global Administrator user and click on Multi-­
Factor Authentication in the top-left menu, as shown in Figure 1-25.

Figure 1-25. Enable Multi-factor authentication

After you click on the Multi-Factor Authentication link, you will be redirected to the
Azure Active Directory Multi-Factor Authentication page, where you can use the right-­
hand menu to enable MFA.
Figure 1-26 shows the MFA page and that my account has MFA disabled.

20
Chapter 1 Get Started with Microsoft Azure

Figure 1-26. Azure MFA page

To enable MFA for my account, I need to click on Enable from the Quick Steps menu
on the right-hand side.
Figure 1-27 shows the Quick Steps menu where you enable MFA.

Figure 1-27. Enable MFA from the Quick Steps menu

Note If your Azure account is not part of an Office 365 subscription and is a
Microsoft Account, please enable MFA from the Microsoft Account Security settings
page using the following URL:
https://account.microsoft.com/security/

Check Global Administrator Accounts


Another good practice that can help you secure your Azure account and subscription
is to check on a regular basis who has Global Administrator permission in your Azure
tenant.

21
Chapter 1 Get Started with Microsoft Azure

Microsoft strongly recommends you have less than five Global Administrator
accounts inside your tenant.
You should not give administrators permissions they don’t need, and always try to
give them the exact permissions warranted by their role.

Note Global Administrator is also known as Company Administrator.

To review and check who has Global Administrator permissions for your Azure
subscription, open Azure Cloud Shell and use the PowerShell experience.
From PowerShell, run the following command (Figure 1-28):

Get-AzureADDirectoryRole | Where { $_.DisplayName -eq "Company


Administrator" } | Get-AzureADDirectoryRoleMember | Ft DisplayName

Figure 1-28. Display Global Administrator accounts

In Chapter 6, we will take a deep dive into Azure security best practices and how to
mitigate risks and threats.

Azure Container Services


In this section, we will explore the four pillar services in Microsoft Azure that enable us
to deploy containerized applications.
In the next few chapters, I will cover each of them in greater detail.
The last service, Web App for Containers, is an extension of the Azure Container
Instances (ACI) service and will be covered within the ACI chapter.
Microsoft Azure allows small and large businesses the option to deploy
containerized applications in both large and small scales.
Azure offers multiple services that cover any business needs and at any scale.

22
Chapter 1 Get Started with Microsoft Azure

The core Microsoft Azure Container Services that we will cover in this book are:

Azure Kubernetes Services (AKS)

Azure Container Instances (ACI)

Azure Container Registry (ACR)

Web App for Containers

This section will introduce each chapter, which will have more details.

Azure Container Instances (ACI)


Azure Container Instances (ACI) is the most basic, simple, and easy-to-manage
container service on Microsoft Azure.
With ACI, we can quickly deploy containers into an isolated environment without
managing servers, storage networking, and container orchestration.
ACI is also integrated with Azure Container Registry (ACR) and can pull images
directly from ACR without any complex configuration.
The start time of containerized applications on ACI is seconds compared to minutes
when running your applications on a virtual machine.
Containers running in ACI have access to a public IP address and external access
using a DNS hostname that is routable over the internet.
ACI also allows us to scale out containers in case usage goes up and the application
needs more resources to perform well.
Billing is based on seconds and provides the most cost-effective solution for
containerized application deployments; however, if you need your containers running
24/7 ACI is not the most cost-effective solution.
If you need to use persistent storage for your ACI application, you can mount a
storage volume using the Azure file share and save the state of your containers in case
they are restarted, crash, or stop.
All workloads running in ACI are secured and isolated using hypervisor-level security.
ACI supports both Windows and Linux containers.
You can deploy containers to ACI using the Azure portal and Azure CLI.
With ACI, we can also create multi-container groups that allow us to combine the
application with multiple roles and services that share the same storage network host.

23
Chapter 1 Get Started with Microsoft Azure

ACI also works with Web App for Containers, which uses Azure App Service to host
web applications in the Azure shared infrastructure.
With Web App for Containers, we can run web applications inside Linux or Windows
Containers.
In Chapter 3, we will deep dive into ACI and deploy containers.

Azure Kubernetes Services (AKS)


The Microsoft Azure Kubernetes Service (AKS) is Azure’s fastest-growing service after
virtual machines.
It provides state-of-the-art service-based container orchestration using the
Kubernetes open-source project.
AKS is an enterprise-grade orchestration solution that can scale and handle
extremely large deployments of containerized applications.
With autoscaling features, AKS can increase the number of nodes, storage volumes,
and networking without manual or human intervention.
With AKS, we can automate daily, weekly, and monthly tasks and reduce the need to
run jobs and tasks manually.
There is continuous integration and continuous delivery (CI/CD) of pipelines
directly into AKS using API.
AKS tools are fully integrated with Visual Studio 2019, Visual Studio Code, and Azure
DevOps, where you can connect your application directly to the preceding tools and
deploy using a single click.
With Azure Active Directory integration support, we can control access to AKS using
Azure AD users, groups, and RBAC roles.
With Dev Spaces, we can deploy code to a subsection in AKS that is dedicated to
testing and development without affecting production code.
We can also get insight into AKS performance using Azure Monitoring.
Azure AKS is the only cloud solution (compared to AWS and GCP) that supports
Windows Containers (currently in preview) workloads in Kubernetes.
AKS is fully integrated with Azure Container Registry (ACR) and allows fast retrieval
of container images.
As of the time of writing, AKS is available in twenty-eight Microsoft Azure regions
and growing.

24
Chapter 1 Get Started with Microsoft Azure

Azure Container Registry (ACR)


The Azure Container Registry (ACR) service is an enterprise-grade private container
registry.
ACR allows us to store Docker container images in a secure private registry and use
advanced security features to protect the images.
Using Azure infrastructure, ACR is optimized and can easily scale up and down
depending on usage and storage.
With ACR, we can opt to use security keys and admin account or use Azure Active
Directory authentication and control access to the registry using users and groups.
Once enabled and configured, we can deploy Docker images to Azure AKS, ACI, and
Web App for Containers using a single click.
ACR also supports high availability and geo-replication of a single ACR registry to
multiple regions across the globe.
We manage ACR using the same familiar Docker CLI commands without needing to
use other command-line tools.
ACR comes in three stock-keeping units (SKUs) and price points depending on size
and features.
The three ACR SKUs are:

Basic

Standard

Premium

The main difference in the SKUs is the storage. However, the geo-replication option
is only available in the Premium SKU.
Sometimes it is better to use the Premium SKU instead of deploying multiple ACRs in
different regions.
Figure 1-29 shows the Azure Container Registry (ACR) pricing page and the three
SKUs (Basic, Standard, and Premium).
Prices in the figure are for an ACR registry in a Central US datacenter and in USD.

25
Chapter 1 Get Started with Microsoft Azure

Figure 1-29. ACR pricing page

Summary
In this chapter, we covered the ins and outs of setting up a Microsoft Azure subscription
and how to use the free $200 USD credit for thirty days.
We also learned how to get started and set up Azure Cloud Shell, a web-browser
command-line utility running inside a container and hosted in Azure.
In the next few chapters, we will use Azure Cloud Shell to deploy many of the Azure
Container services.
After setting up Azure Cloud Shell, we learned how to secure our Azure environment
using quick-win methods, and the main one that we explored was using MFA to secure
our Azure Global Administrators account. It is highly recommended you use MFA to
secure all of your Global Administrator accounts.
And in the last section of this chapter, we explored the following main Azure
Container services, which we will cover in this book:
Azure Kubernetes Services (AKS)
Azure Container Instances (ACI)
Azure Container Registry (ACR)
In our next chapter, we will deep dive into the world of Azure Container Register (ACR)
and use it to store Docker container images using Docker CLI.
We will learn how to push and pull Docker images to ACR and manage them using
Azure CLI, Azure Cloud Shell, and the Azure Portal.

26
CHAPTER 2

Store and Manage


Docker Container Images
on Azure Container
Registry (ACR)
In this chapter, we will learn how to get started with Azure Container Registry (ACR) and
use it to store, upload, and download Docker images.
This chapter will cover the following:

• Overview of Azure Container Registry (ACR)

• Installing the Docker Desktop client

• Installing Visual Studio Code and the Docker extension


• Enabling the Azure Container Registry (ACR) service in Azure

• Authenticating to ACR from a local machine

• Tagging and pushing Docker images to ACR


• Pulling a Docker image from ACR to a local machine

• Securing our ACR container registry

27
© Shimon Ifrah 2020
S. Ifrah, Getting Started with Containers in Azure, https://doi.org/10.1007/978-1-4842-5753-1_2
Chapter 2 Store and Manage Docker Container Images on Azure Container Registry (ACR)

Overview of Azure Container Registry (ACR)


Azure Container Registry (ACR) is a private container image registry used to store
Docker images in a secure and high-availability environment. The underlying
infrastructure and technology behind ACR are managed by Microsoft Azure, while the
endpoints, access, and image repositories are managed by the tenant, who is us.
ACR is an elastic service that can grow easily based on our needs using the
following plans:

• Basic

• Standard

• Premium

Figure 2-1 shows the pricing details of all the plans available in ACR.

Figure 2-1. ACR pricing details

Most developers will find the basic tier enough to test various applications and code;
however, large businesses will probably opt for the Premium plan, which offers more
storage and global replications.
We can manage ACR using Azure CLI (with Azure Cloud Shell) or the Azure portal.
Because the underlying infrastructure is managed by Azure, our role in managing
ACR is limited and doesn’t require complex operation procedures.
To push and pull Docker images to and from ACR, we use the Docker CLI command-­
line utility, which is great as it doesn’t require us to learn how to use another tool.

28
Chapter 2 Store and Manage Docker Container Images on Azure Container Registry (ACR)

Set Up Microsoft Azure Container Registry (ACR)


Before we can start using ACR, there are a few requirements we need to follow that will
ensure we can connect to ACR and push and pull images. The tool that allows us to
connect to ACR is the Docker CLI client.
Docker CLI allows us to do the following:
Connect to ACR using the Docker login command
Tag images that we need to push to ACR
Push and pull images from and to ACR
We can use Azure CLI and Azure DevOps to connect to ACR.

Install Docker Desktop


Docker Desktop is a client application that is available on all major platforms (Windows,
Linux, and macOS).
To get started, install the Docker client on your client operating system by going to
the following URL:

https://www.docker.com/products/docker-desktop

From the Docker Desktop page, click “Download Desktop for Mac and Windows,” as
shown in Figure 2-2, and follow the prompts.

Figure 2-2. Docker Desktop download page


29
Chapter 2 Store and Manage Docker Container Images on Azure Container Registry (ACR)

To install Docker on Linux, please refer to the following URL: https://docs.docker.


com/install/linux/docker-ce/ubuntu/.

Creating Azure Container Registry (ACR) Using the Portal


In this section, we will create our Azure Container Registry (ACR) using the Microsoft
Azure portal. Azure also allows for creating an ACR using Azure CLI directly from Azure
Cloud Shell.
To create an Azure Container Registry (ACR), I log in to the Azure portal. From the
portal, I click on “All services” in the left-hand menu.
In the Services list, I click on “Containers” and then on “Container registries.”
Figure 2-3 shows the Container registries service in the Azure portal.

Figure 2-3. Azure Container registries service

30
Chapter 2 Store and Manage Docker Container Images on Azure Container Registry (ACR)

On the Container Registries page, I click on “Add” to start the creation process, as
shown in Figure 2-4.

Figure 2-4. Add Container registry

To create my first ACR, I will fill in the details, as shown in Figure 2-5, and as outlined
in the following list:

Registry Name — This is the name of the registry (needs to be


globally unique) and the routable address to get to it.

Subscription — This is the Azure subscription the registry will be


billed under; if you have only one subscription you can ignore this
part.

Resource Group — Here we have the option to create a new


resource group or use an existing one; in my case, I am creating a
new one.
Location — This is the Azure region in which the registry will
be hosted; this part is very important, and your ACR should be
hosted in the same region in which your applications are located.

Admin User — This option needs to be enabled in order to access


the registry.

SKU — This part is very important because, by default, Azure


selects the Standard SKU, which costs more. I recommend you
start with the Basic SKU and upgrade if needed.

31
Chapter 2 Store and Manage Docker Container Images on Azure Container Registry (ACR)

Figure 2-5 shows the Create Container Registry page with the details I used.

Figure 2-5. Create Container Registry page

32
Chapter 2 Store and Manage Docker Container Images on Azure Container Registry (ACR)

When the ACR is ready, it will show up on the Container Registries page, as shown in
Figure 2-6.

Figure 2-6. Azure Container Registries page

Creating Azure Container Registry Using Azure CLI


Microsoft Azure also gives us the option to create a new Azure Container Registry (ACR)
using Azure CLI in case we want to create it programmatically without using the Azure
portal.
To create a new ACR using the same details I used in the Azure portal, I will run the
following command from Azure Cloud Shell. Because I am using Azure CLI, I can use
both the Bash and PowerShell Shell experiences.
The following command will create a resource group called Apps in the Azure West
US Region:

az group create --name Apps --location westus

The following command will create an ACR called DeployRG with admin access
enabled in the Apps resource group and that uses the Basic SKU:

az acr create --resource-group Apps --name DeployRG --admin-enabled true


--sku Basic

To view the newly created ACR, I will run the following command:

az acr list --output table

33
Chapter 2 Store and Manage Docker Container Images on Azure Container Registry (ACR)

 ush Docker Images to Azure Container


P
Registry (ACR)
Having created our first ACR, we will now push a Docker image to it using Docker
CLI. Before we can push or pull images from ACR, we need to copy the login details to
the ACR from the Azure portal.
The login details for our ACR are in the Settings section of the ACR under the Access
Keys. Figure 2-7 shows the Access Keys’ section with the details needed to log in to
ACR. We will need to copy the following information:

Login Server — This is the address of our ACR registry.

Username — This is the username.

Password — This is the password used to log in to the ACR (only


one password is needed).

Admin User — Make sure Admin User is set to “Enable.”

Copy all the details, and we will use them to log in and connect to ACR using the
Docker CLI.

34
Chapter 2 Store and Manage Docker Container Images on Azure Container Registry (ACR)

Figure 2-7. Access keys

Connect to ACR Using Docker


Now that we have enabled ACR and have the login details, we will use the Docker CLI to
log in and push an image to ACR.
The process to push an image to ACR is as follows:
Connect to ACR using Docker login
Tag the image using Docker tag
Push the image using Docker push
To log in to ACR, I will use the Docker CLI using PowerShell and use the following
command, as shown in Figure 2-8.

Note Please use the login server details.

docker login deployrg.azurecr.io

35
Chapter 2 Store and Manage Docker Container Images on Azure Container Registry (ACR)

Figure 2-8. Docker login command

Once the login has succeeded, I will tag a local image I have on my machine. In my
case, I have an Nginx image that I will tag.

Note To download the same Nginx image, I can use the following command:
docker pull nginx
docker tag nginx deployrg.azurecr.io/nginx
Once the image is tagged, I can use the following command, as shown in
Figure 2-9, to push the image to ACR:
docker push deployrg.azurecr.io/nginx

Figure 2-9. Docker push command to ACR

To view the image we just uploaded to ACR, perform the following steps:

Log in to the Azure portal and open the container registry.

In the registry, click on “Repositories.”

36
Chapter 2 Store and Manage Docker Container Images on Azure Container Registry (ACR)

As shown in Figure 2-10, the Nginx image appears in the repository.

Figure 2-10. ACR repositories

If I click on the image, I will see all the available tags that belong to the image. In my
case, and as shown in Figure 2-11, I have the “latest” tag available.
If I click on the action menu (…) on the left-hand side of the tag, I will see five options
that are available for me to use. I will not cover them now; however, using this menu, we
can deploy the image to ACI or to a web app.

37
Random documents with unrelated
content Scribd suggests to you:
VIEW FROM MT. LEIDY.

My experience has led me to add to a hunting outfit, the oftener I


go out, rather than depleting it. The first time I really saw an up-to-
date outfit was in 1902, when I engaged as my guide Edward
Sheffield, of Idaho. I joked him about all the things he was taking
along and called him a “tenderfoot.” He replied that “he had had all
the roughing it he wanted in his time, and those who really knew
what it was generally preferred a camp as comfortable as possible.” I
experienced during that trip and a subsequent one I took next fall
such comfort, combined with good sport, as I never had before.
I would advise taking an emergency medical case supplied with all
the ordinary remedies. I have known the time when such a thing has
proved extremely useful, and I have also known of sportsmen who
have had their outing ruined through lack of some simple remedy.
AN ELK HUNT IN WYOMING

W HEN I wrote to my old guide Edward Sheffield, I was


somewhat apprehensive about the outlook for sport, because
I had heard that the best part of the Jackson Hole Country had been
included in the reserve set apart by the State of Wyoming, where
sport with big game had been entirely interdicted.

I was advised, however, that this was not the fact, and pinning my
faith to the good judgment of the guide, I made arrangements for a
fall hunt. Before reaching the terminal of the railroad journey I
chanced to meet some sportsmen who discussed the sport and
commented on the conditions existing in Jackson’s Hole. The
criticisms were by no means favorable, and various instances were
cited of parties who had been disappointed in their expectations. My
subsequent experience only served to convince me how dependent a
sportsman has become upon the services of a good guide.

The trip from St. Anthony to Jackson was without incident worth
relating, except at the start. The pack horses, which, during their
stay in town, had fared handsomely on oats and hay and been well
sheltered, did not look forward to a trip back into the bleak and
sterile mountains with the same pleasure that I did; their refractory
souls yearned for the comfortable quarters they were just leaving
with the same tenacity that the children of Israel in the wilderness
“longed for the fleshpots of Egypt,” but here the comparison ends,
for they had not a guide who was meek and gentle like Moses.

About a mile from St. Anthony the whole bunch turned off on a side
road and went back to their former quarters. After some delay they
were finally got in line again, and with the aid of a couple of
Mormons, who, for a consideration, agreed to help them for several
miles, we got the pack train properly started, and after that had no
further trouble with them.

GUIDE EDWARD SHEFFIELD AND TWO ELK HEADS.

The journey was a fairly long one, but it became more interesting as
we drew away from civilization and got closer to the place where we
intended to make permanent camp. After the first day we passed
the wide monotonous stretch of sage brush flats which lies between
St. Anthony and Victor; after that the landscape grew more
mountainous and wooded. The country became very picturesque as
we proceeded; every mountain presented a view which was a
panorama; every opening in the timber seemed a natural frame for
an entrancing picture; the atmosphere so clear and bracing gave fine
definition to objects in view; the winding river rushed fretting and
foaming between the rocks in the valley below; large clumps of
spruces clustered upon the mountain sides, and the rough crags
were powdered with snow and sometimes glistening with rills which
coursed down their rugged surfaces. After traveling along the Gros
Ventre River for a considerable distance we at last came in view of
Mt. Leidy, superbly situated between two rows of mountains on
either side of a pleasant valley, at the head of which that peak
stands. The ground was covered with a few inches of snow—enough
to make good hunting. We made an early camp and had plenty of
time to get everything arranged before it became dark. The location
was ideal; plenty of timber nearby; a fine stream of clear, cold water,
and good grazing for the horses. It was quite important to have a
good range for the stock, because there were eleven pack horses
and three riding horses—fourteen in all. To take care of these
required the services of a horse wrangler. I had three men, my
regular guide, Edward Sheffield; Charles Herdick, a Wyoming guide,
and Marcus Imo, who cooked and turned his hand to anything else
that had to be attended to.

The day being young when we arrived, I employed it in making a


short hunting scout. Charles Herdick went with me, and I soon
discovered how much my wind had deteriorated since I had last
been out, for in the meantime I had lived a life of comparative ease.
The general elevation in this section ranges from 7,000 to 10,000
feet, and it takes a few days to accustom your lungs to the rarified
atmosphere. When one is not taking any vigorous exercise the
climate feels exhilarating and inspires one with the belief that he is
able to perform any kind of feat; a few minutes of real strenuous
exercise and this delusion is destroyed. I soon discovered that
Herdick was a good hand at mountain climbing, being wonderfully
supple and possessed of the best pair of lungs of anyone I ever
knew.
We finally caught sight of a small bunch of elk at a considerable
distance. As they were moving over a crest of a hill it became
necessary to travel with speed to get near enough for a shot, if by
chance there should be a good head in the bunch. The elk had not
seen us, but were moving and might get out of range. Completely
exhausted I finally gained the summit of a hill overlooking the herd,
which had halted. An old bull stood in the quaking aspens, not over
sixty yards away. A glance at the head, and I saw that I had had my
pains for nothing. I watched the animals for a few moments, and
they seemed to me like old acquaintances, for it had been three
years since I last hunted this kind of game. I do not believe they
were as pleased to see me as I was to see them. They soon started
to run directly from us in the direction of camp, which was quite
near. My guide, Edward Sheffield, told me afterward that they came
very near, and he was afraid they would run through camp. He
gravely warned me against the danger of driving a large bunch of
“Uncle Sam’s cattle” in that direction.

It was a pleasure after this little excitement to drop into a


comfortable camp and find everything nicely arranged and a good
meal provided. My quarters were supplied with every convenience
that could be expected by one who travels with a pack outfit. It may,
perhaps, interest those who have had no practical experience in
Western hunting to know what can be furnished. We had folding
chairs, a folding table, two tents, and in each a portable sheet-iron
stove with a couple of lengths of pipe to take off the smoke. I had a
pneumatic mattress to save my tired flesh from the hard ground,
and whatever else was required which horses could pack in. When I
was tired of hunting I could rest a day or so and read novels in a
comfortable tent, no matter how cold the weather. This does not
seem like roughing it. The frontiersman of former days would have
thought such comfort with a hunting outfit impossible. Modern
progress, however, has caused most of the inconveniences of camp
life to disappear as if by magic. Would that its magic influence could
restock the wilderness with the great herds of wild animals that have
vanished.
VALLEY OF GROS VENTRE.

The following day I went out with the guide to try my luck. We had
not traveled more than two miles before discovering a small herd of
elk. We circled around them sufficiently to size them up, but could
find no heads worth picking out. Our course was then changed, and
we hunted toward a high mountain north of Mt. Leidy. From this
point we obtained a fine view of the surrounding country, which I
carefully swept with my Seitz glasses in quest of game. Far off on a
distant ridge we finally saw some elk slowly moving out of the
timber into the open. Their brown shapes showed very distinctly
against the snow-covered hills, but, although there was a
considerable number in view, no good antlers were visible. My
strong glasses proved of very great service to me. With them I could
ascertain plainly what otherwise I would have had to guess at, and
they saved me many a long excursion over rough country to
determine the value of a set of antlers. My guide was quite as
anxious as myself that I should not have any trophies unworthy of a
sportsman’s ambition. The law allows one only two heads, and it is
necessary to take great pains to avoid making mistakes. I made up
my mind that I would go back empty-handed rather than pack out
antlers which would reflect discredit upon my skill. The guide was
particularly anxious that I should obtain specimens which would do
no injury to his reputation. I think I must have passed unfavorable
judgment upon twenty-five or thirty heads—for which the guide was
mainly responsible—before I finally secured my trophies. Any
number of bulls presented themselves, some of them quite easy
marks, only to be snubbed and turned down. Paris, in passing
judgment upon the goddesses to determine which was the most
beautiful, could not have been more critical or discriminating than
the guide. I doubt if the unsuccessful rivals of the bulls I finally
chose as worthy specimens were seriously disappointed.

To illustrate the ease with which I could have secured my legal


allowance of two bulls, to say nothing of cows, I will cite a few
instances of the opportunities I had. On one occasion I was going
through the timber where I heard a number of elk. The guide called
my attention to a bull lying on the ground not sixty yards away,
partly concealed by the spruce brush. He was facing directly toward
us, his front feet folded under his body and his nose close to the
ground. We stood quite still and surveyed him carefully, sizing up the
head, which had twelve points, but not large nor heavy at the base.
The glasses were brought into service to make a more critical
examination. A couple of minutes we stood discussing him, when
finally he gave a brief snort, which sounded like an expression of
disgust at our impertinence, and then jumped up and loped out of
sight.
Shortly afterward we managed to approach close to a very large
herd of elk, mostly hidden in the timber. From our concealment we
could see a number of the animals not over thirty or forty yards
away. About 150 yards off were a couple of young bulls exercising
their skill by fencing with their antlers, evidently in sport. We could
hear the frequent clash of the horns and often got a good view of
the contestants. We waited in this spot over an hour, until despairing
of seeing anything worth shooting at before it grew too dark, we
suddenly rose up in plain view. The peaceful scene was soon
converted into one of great confusion. For a moment the elk stared
at us with their beautiful large brown eyes in astonishment, then a
general panic communicated itself to the herd, and every animal in
sight began moving off. Each clump of vegetation that could conceal
a form seemed suddenly animated by a creature breaking from its
hiding place, fleeing for safety; the cows and calves gave vent to
their peculiar bleat of alarm, while the bulls snorted and rattled their
antlers against the trees in their haste. For some hundred yards in
the timber, and well up on the mountain side, the scene became
particularly animated. I hurried to an opening in the timber, where I
could get a good view of the retreating herd, which had drawn
together into quite a solid moving mass. The number of elk greatly
exceeded my expectations. Nine-tenths of the herd had been as
carefully concealed from us as we had been from them. There must
have been at a conservative estimate not less than 400 in the herd,
and possibly 500. A sportsman could only admire this striking and
beautiful spectacle because there was no head worth securing. A
tooth hunter or a butcher, with a high-power repeating rifle, could
have repeated one of those scenes which sickens every lover of
sport.

At another time I came upon a band of elk quite as numerous, and,


although there were a couple of good heads in view, yet the number
of cow elk was so great that it was practically impossible to get a
good shot. The entire mass fled straight up the side of a steep
mountain covered with quaking aspen and spruce. For some time we
could see them crowding one another in dense masses in their
ascent, but the only shot attempted was with the camera, and
without success.

One more instance, which will not only aid in proving the ease of
securing an indifferent specimen, but goes to show that when game
is too plentiful it is an actual handicap to the sportsman. I saw a fine
head across a gulch at a considerable distance. I fired and missed it
and the animal escaped beyond range. I crossed the gulch to
examine the spot where the bull had stood and followed his tracks to
see if he had been wounded, and if so, how badly. Although the
ground was covered with two feet of snow, yet I could discover no
signs of blood. While discussing the matter with the guide we
became conscious that we were not unperceived, for a great number
of elk began to move among the trees, having evidently “spotted”
us. We made at once for concealment and ran as fast as we could
through the deep snow to an open place toward which the herd was
heading.

Carefully hidden from view we saw a great brown mass thunder


past, and before it had disappeared from sight I caught a glimpse of
the precious set of antlers belonging to the bull I shot at carried in
triumph out of sight. They appeared but for a moment in the narrow
opening, in which the intended victim was well protected by cows,
which formed a perfect wall of flesh which no bullet could pierce and
speed on to its mark. We made another run under concealment in
the hope of being able to come upon the herd again in case it
should halt, which it did. In an open space on the further side of the
mountain we confronted the elk at close quarters. The rapid
traveling in the deep snow over rough country left me very much
exhausted. The first object that attracted the attention of the guide
and myself was a large bull of twelve points at very close range. I
thought in the hurry of the moment, my vision perhaps being
blurred by nervous strain and exhaustion, that it was the same
magnificent specimen I had shot at before and was trying to secure,
and the animal’s position—turned quartering toward me—aided the
deception. I soon discovered the mistake, however, my attention
being called by the guide to another bull which proved to be the one
I so earnestly desired. I brought my rifle in position to draw a bead
on a vital spot, but the bull was immediately blanketed by several
cows running between. If I could have had a clear range the shot
would have been about the easiest I ever had, but the faithful cows
with their calves swarmed around their lord, and I beheld with
disappointment as fine a pair of antlers as I ever saw borne safely
out of sight. The old bull must have evidently believed that “there is
safety in numbers.”

There is another disadvantage in encountering a great quantity of


game when attempting to secure a good trophy. Each animal,
however poor a head it may possess, has generally a good pair of
eyes, a keen scent and excellent hearing. Each addition to a herd is
another sentinel, always on duty and ready at any moment to sound
the alarm. On a previous hunting trip, when the elk were not nearly
so plentiful, I got the heads I wanted in less time. I cannot place the
blame for the trouble I had in securing my heads on the cows
entirely.

A couple of days before the scarlet letter day of my hunt I fired at a


fine bull in a gulch quite a distance off. He immediately quickened
his pace and was soon out of range. I glanced at my rifle and I
found that the elevation of the sight had been misplaced, being
ranged for fifty yards. I think it is best to have the sight of a high
power gun with a very flat trajectory sighted for 100 yards, and to
draw a fine or coarse sight on the object as occasion may require.
We examined the spot where the bull had been seen when fired at
and discovered a sprinkling of blood along his tracks. Tying the
horses, we started to follow the trail on foot. The course the bull
took favored the higher elevations more than the depressions, which
was a bad sign, so with grave misgivings we continued the pursuit.
The increasing signs of blood inspired us with hope; here and there
he occasionally stood, as was evident from the quantity of blood and
the character of the impression his feet made in the snow. In other
respects the signs were disappointing; the tracks showed no
indication of weakness, and frequently led us across high fallen trees
and along steep places, where I followed with difficulty. The blood,
although quite plentiful, was a light red, and not the dark color
which would be discharged were some vital spot injured. Finally,
after traveling about six miles, the flow of blood began to lessen. At
length we reached a point where he entered a tract of thick timber,
evidently at a walk. We concluded that it was best not to pursue him
in this retreat, because his slow pace might indicate exhaustion and
a disposition to lie down. The only hope I had of securing him would
be in case of his lying down and becoming stiff from his wound and
not being able to get up. We concluded to allow plenty of time for
this to happen. The guide made a circuit around the timber and
could discover no trace of his having emerged from it. We then went
back to the horses and rode to camp. The succeeding day we
returned to the spot, traced the steps of the elk to a place where he
had lain down, and saw a slight discoloration of the snow where his
brisket had touched it, his tracks led onward, and signs of bleeding
had ceased. All our trouble had been in vain because of an
improperly arranged sight.
CHAS. HERDICK SKINNING A BULL ELK. THE AUTHOR
AT THE RIGHT.

By this time I had been about ten days in camp and was growing
quite accustomed to the life. Although the weather was quite cold,
at times going to eight or ten below zero at night, yet it often grew
warm enough during the day to thaw, but it was dry, light
atmosphere and always bracing. Every night for a brief interval we
were treated to a serenade from the coyotes, a ridiculous, wild and
unearthly chant, which became a positive nuisance when the dogs
undertook an accompaniment right at our ears. Occasionally a bull
elk, feeding during the full of the moon, would cause the cold
atmosphere to vibrate with his shrill whistle as he loped past the
camp. In all other respects we were entirely alone for the twenty-
two days I stayed in camp except one, when the game warden
dropped in to look at my license, and after a brief stay took his
departure. How different this was from most of the hunting in the
East, where the number of sportsmen has become so great as to
render the pastime almost as dangerous for the hunter as it is for
game. Particularly is this the case when “green sportsmen” persist in
shooting at anything that moves without first finding out what it is.
My guide expressed his surprise at the number of accidents which
occur every year in the Adirondacks through gross carelessness. He
remarked that he believed it would be best if one were hunting in
the Adirondacks and saw anything moving in the brush to shoot
without waiting to find out what it was, because the chances are
that it would be a man, and if you did not shoot him he would shoot
you. I was rather amused at this piece of grim humor, which is a
sample of what he generally had on tap.

The sun dawned auspiciously upon what proved to be my luckiest


day in camp. For some days I had hunted diligently without securing
the heads that would satisfy me. We had not journeyed over three
miles from camp before we saw, at quite a distance, a large bull
move into a thickly wooded valley. We turned our course in that
direction, keeping out of view as much as possible, riding along a hill
which overlooked the valley into which the bull had taken refuge. We
came to an open and slightly undulating country, which was covered
with about eighteen inches of snow, and gave evidence that quite a
number of elk had recently passed that way, and about 500 yards off
saw a herd with several good heads. The country was quite open,
but broken up with thick clumps of spruce trees here and there. To
get nearer the herd it was necessary to cross a wide open space, but
by a timely maneuver of the guide we traveled under cover until we
reached a point where a thick clump of trees standing out in the
open space obstructed the view between us and the elk. We then
rode out in the open toward the clump of trees which concealed us
from view. Having gained this point, which was about 175 to 200
yards from the herd, I dismounted and stepped out in the clearing.
The cows again provokingly ran between me and the largest bull,
which I had marked as my own. Fortunately, the cows ran ahead
and I got a quartering view of the large bull. The bright reflection of
the sun on the snow made it somewhat difficult to fully distinguish
the body of the animal in the dense moving mass, but I succeeded
in locating it. Drawing a fine sight on my Mauser I fired. The entire
herd disappeared over the crest of the hill. The guide, who by this
time had mounted his horse, cried, “You have got a bull.” I asked
him if it was the “big one.” He replied, “I don’t know.” In the
confused and changing mass it was indeed difficult to keep track of
any particular one. We urged the horses to their utmost speed; the
antlers of the bull continued growing larger to the view as we drew
near. Finally, with an exclamation of satisfaction, the guide slipped
off his horse and congratulated me upon the kill. “The largest head
in the bunch.” It was indeed a fine bull, with a spread just short of
four feet. There were twelve points on the antlers, six tines on each
side. The bullet had lodged a little back of the shoulder and the
animal had dropped without a struggle. In the space of fifteen or
twenty minutes the carcass was dressed; the mantle had been
stripped off, and we were ready to return for a couple of pack horses
to bring in the antlers and meat.

We had hardly mounted the horses when we saw another bull with a
fine head about 250 yards away. I slid off my horse, and getting the
distance from the guide, I drew a coarse sight and fired as the
animal was going over a hill. We hurried over to the spot where the
bull had been and saw faint splotches of blood on the snow. As we
descended the hill the guide remarked he hoped we would not have
as long a chase after this one as we did after the bull we hunted so
long a few days previous. I replied that I was certain we would not.
“How do you know?” he asked. For answer I pointed to a lifeless
form just beyond lying among some spruce trees. As the guide
stepped alongside of me, where he could get a view, he expressed
his surprise at the luck I had had in getting two such fine heads in
so short an interval. It was barely half an hour since I had secured
my first trophy, and now I had a second one which we both
regarded as better than the first. The ball had struck back of the
shoulder a little above the middle of the body. The spread of this
head was a trifle larger than the first one I had shot; the antlers
were more solid, especially at the base. My hard hunting had been
rewarded. I had obtained inside of half an hour two heads as
handsome and large as any that it had ever been my good fortune
to secure. I felt like a school boy about to take a vacation, for I had
hunted faithfully for about eleven days and I promised myself a rest
when I had won out with the bulls.

For several days I took it easy; a large part of the time I sat in a
comfortable chair in camp and read novels and played cards. I also
managed to work up quite a small medical practice, my victims being
Sheffield, Charles Herdick and Marcus Imo, the cock and horse
wrangler. The remedies which some people of the far West prescribe
for their ailments are quite original and simple. One day when I was
starting out on horseback to hunt in company with Herdick, I noticed
that he had not saddled his horse. I asked him the reason. He
replied that he was not feeling well and wanted exercise. Anyone
familiar with hunting in Jackson’s Hole knows how often one has to
leave the horse to travel on foot over rough country through snow
and up slippery ascents for hundreds of feet.

Herdick evidently thought this was not enough exercise to keep him
in condition. Another time Imo had contracted a severe cold which I
wanted to prescribe for. He replied that it had come on without
anything and it would go off without anything. After some
persuasion he consented to take a good dose of quinine and a hot
drink before retiring. The next morning the cold had about
disappeared, but when Imo went out to round up the horses he had
great difficulty in hearing the bell on account of the quinine buzzing
in his ear, which confirmed his bad opinion of medicine.

After I had tired of loafing I hunted with the dogs, tracking cougars,
bobcats and lynx. Occasionally I would take a shot at a coyote to
pay it back for some of the unearthly serenades we had been
treated to at night. One day, while following the track of a lynx,
Herdick came across a No. 5 bear trap. He discovered it by noticing
some fresh elk meat near it. The trap was carefully concealed, and
had he been an inexperienced hunter or perhaps walking along
there at night he might have made discovery by stepping in it. It is
against the law to bait a trap with elk meat, and it should be
forbidden to set traps around indiscriminately where sportsmen are
licensed to hunt; the permission implying reasonable safety, which is
not the case when dangerous traps are set without proper
safeguards. We sprung the trap and went on. Some men, who are
acquainted with the danger arising from this source, always carry a
monkey-wrench when hunting or trapping. A steel trap which could
hold a silver-tip would inflict a terrible injury upon anyone who was
unfortunate enough to become entrapped, even if assistance were
promptly rendered, and assistance being remote, might cause a
painful, lingering death. I knew of a case where a trapper had set
two No. 5 bear traps, and upon his return found a large silver-tip in
one of them. Venturing rather close to the bear the enraged animal
made a sudden lunge at him, which the man evaded by stepping
back hurriedly. In doing so he accidentally fell and sprung the other
trap with his knee and was caught in that position. The man was
unable to get to his rifle to dispatch the bear, which was making
efforts to reach him. Being in uncomfortably close quarters to the
bear, and apprehensive of his safety, the trapper devised a clever
plan to dispose of his disagreeable neighbor. Fastening his knife to
the end of a long pole he repeatedly stabbed the bear until death
ensued. His companion, going to examine the traps, at last found
him almost dead with pain and released him.
GROS VENTRE RIVER.

The end of my outing at length drew near, and it became necessary


to make arrangements to break camp. I had become quite attached
to the beautiful spot where I had spent such a pleasant time and
had so much luck. Although I had not bagged all the game the law
allowed me, yet I felt that I had obtained exceptionally good heads
and was satisfied. I had also collected a considerable number of
photographs, of which Sheffield took the greatest number; in fact,
he proved quite an expert in this line. The horses seemed no more
anxious to leave than we were, and occasionally proved refractory
and commenced to buck until something was bound over their eyes.
The first night of the journey homeward we camped on the banks of
the Gros Ventre. We put up no tents, but slept out in the open,
because, as I said to the guide, I wanted to see how it felt to rough
it.

During the day we had descended into a country where the


elevation was considerably lower. The snow, which we had seen
continuously in our former camp, had all disappeared and the
temperature was much warmer. Early the next day we reached
Jackson, where we put up at Nelson’s Hotel and were very
hospitably entertained. Although remote from the regular line of
travel and the railroad, the people in this locality live remarkably well
and in comfort, and on reaching this point I felt I was in touch with
the rest of the world. Although it is 100 miles from the railroad, yet
it is connected with St. Anthony by telephone. A musical
entertainment was arranged here for our benefit by the hospitable
inhabitants of the place, which proved very enjoyable.

Transcriber’s Note:
Obvious printer errors corrected silently.

Inconsistent spelling and hyphenation are as in the original.


*** END OF THE PROJECT GUTENBERG EBOOK INTER-OCEAN
HUNTING TALES ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like