{
    "id": "94ff6c19-3b48-4e15-ba4f-2c09a1470e51",
    "name": "Azure Container Registry Azure AD Authentication",
    "slug": "azure-container-registry-azure-ad-authentication",
    "status": "published",
    "lab_type": "pta",
    "is_sample": false,
    "duration_in_seconds": 1800,
    "metadata": {
        "courses": [
            "d912fd3f-d9a9-4107-a303-71f8d2b1f2e5"
        ],
        "pta_sdn": "441",
        "pta_namespace": "my.ine",
        "learning_paths": [],
        "has_published_parent": true
    },
    "session": null,
    "company": "a491bc32-c056-4946-9169-cc053387bada",
    "created": "2022-10-14T21:55:46.297929Z",
    "modified": "2023-10-03T18:58:52.001589Z",
    "is_beta": false,
    "lab_objectives": [],
    "main_learning_area": "d3f82c70-f4e7-428e-afd7-4b1d28988e18",
    "learning_areas": [
        {
            "id": "d3f82c70-f4e7-428e-afd7-4b1d28988e18",
            "name": "Cloud",
            "slug": "cloud"
        }
    ],
    "categories": [],
    "tags": [],
    "difficulty": null,
    "is_web_access": true,
    "is_lab_experience": false,
    "is_featured": false,
    "cve": null,
    "severity": null,
    "year": null,
    "classification": null,
    "is_trackable": false,
    "cpe_credits": null,
    "is_skill_check": false,
    "external_url": "",
    "solution_video": null,
    "explanation_video": null,
    "description": "In this task you will provision and configure an Azure container registry. You will set up RBAC based on Azure AD and verify that you can authenticate using an Azure AD account and upload an image to the registry.",
    "description_html": "<p>In this task you will provision and configure an Azure container registry. You will set up RBAC based on Azure AD and verify that you can authenticate using an Azure AD account and upload an image to the registry.</p>",
    "tasks": "",
    "tasks_html": "",
    "published_date": "2020-06-16T15:32:04Z",
    "solutions": "## Login to the Azure Portal\n\nClick on the login URL and enter the given credentials to log in to the Azure portal.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/1.png)\n\nNote: Your credentials will be different from the ones shown in the image.\n\nAfter logging in to the portal using the credentials. You will see a resource group with some pre-defined resources created for the lab, you will be using this resource group throughout the lab.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/2.png)\n\nType **\"container registries\"** in the search box and click on **\"Container registries\"**.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/3.png)\n\nNow, click on the \"Create\" or \"Create container registry\".\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/4.png)\n\nSelect the pre-defined resource group. Give container registry a name and select \"Basic\" from the drop-down menu of SKU. Now, click on \"Review + create\".\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/5.png)\n\nClick on the \"Create\".\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/6.png)\n\nNow, search \"all resources\" in the search box and click on that.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/7.png)\n\nClick on the **\"docker-VM\"**.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/8.png)\n\nNow, copy the **Public IP address** of the docker-VM.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/9.png)\n\n\n***NOTE: Save this Public IP address somewhere for future reference.***\n\nSearch **\"Resource groups\"** in the search box and click on that.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/10.png)\n\nClick on the pre-defined resource group.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/11.png)\n\nClick on the \"Deployments\".\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/12.png)\n\nSelect **\"AzureContainerRegistryAzureADAuthentication-v2\"**.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/13.png)\n\nGo to **\"Template\"** and look for the **\"adminPassword\"**. \n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/14.png)\n\n***NOTE: Save the adminPassword somewhere for the future reference.***\n\nNow, open the cloud shell by clicking the icon as shown in the below image.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/15.png)\n\nClick on the \"Bash\".\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/16.png)\n\nSelect the **\"Show advanced settings\"** option.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/17.png)\n\nGive the \"Storage account\" and the \"File share\" a name and click on \"Create storage\".\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/18.png)\n\nWait for the shell to get configured and type the below-mentioned command to connect to the virtual machine.\n\n```\nssh student@<Public IP Address of docker-VM>\n```\n***NOTE: Replace the IP Address of the docker-VM in the above command.***\n\nType \"yes\" when asked for continue connecting.\n\nEnter the password (**\"Pa55w.rd!\"**) which you saved earlier.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/19.png)\n\nNow install the Azure CLI with the help of the following command:\n\n```\ncurl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash\n```\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/20.png)\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/21.png)\n\nNow login to the Azure CLI.\n\n```\naz login\n```\nCopy the given code, visit the URL and enter the code when asked. \n\n***NOTE: If clicking on the URL is not returning anything in the response, copy the URL and paste it into the browser manually .\"***\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/22.png)\n\nEnter the code and click on the \"Next\" button.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/23.png)\n\nSelect the account you are using for this lab.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/24.png)\n\nClick on the \"Continue\".\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/25.png)\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/26.png)\n\nGo back to the azure portal, you will see the following output.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/27.png)\n\nNow, login to the acr repository.\n\n```\nsudo az acr login --name <Name of the Repository>\n```\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/28.png)\n\nPull the docker image.\n\n```\nsudo docker pull twallace27603/pythonserver:latest\n```\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/29.png)\n\nGo to the \"Resource Group\", click on the Deployment. (Without closing the cloud shell)\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/30.png)\n\nClick on the \"MicrosoftContainerRegistry\".\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/31.png)\n\nClick on the \"Go to resource\".\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/32.png)\n\nCopy the **Login server** name.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/33.png)\n\nNow tag the docker image.\n\n```\nsudo docker tag twallace27603/pythonserver:latest <your ACR server>/pythonserver:1.0\n```\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/34.png)\n\nReplace the name of your ACR server in the command before running.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/35.png)\n\nPush the docker image.\n\n```\nsudo docker push <your ACR server>/pythonserver:1.0\n```\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/36.png)\n\nGo to the Container registry select the Repositories and click on the **\"pythonserver\"**.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/37.png)\n\nYou will see, the version 1.0 is present there!\n\n![](https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/38.png)\n\n\n## Your lab is completed now.",
    "solutions_html": "<h2>Login to the Azure Portal</h2>\n<p>Click on the login URL and enter the given credentials to log in to the Azure portal.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/1.png\" /></p>\n<p>Note: Your credentials will be different from the ones shown in the image.</p>\n<p>After logging in to the portal using the credentials. You will see a resource group with some pre-defined resources created for the lab, you will be using this resource group throughout the lab.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/2.png\" /></p>\n<p>Type <strong>\"container registries\"</strong> in the search box and click on <strong>\"Container registries\"</strong>.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/3.png\" /></p>\n<p>Now, click on the \"Create\" or \"Create container registry\".</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/4.png\" /></p>\n<p>Select the pre-defined resource group. Give container registry a name and select \"Basic\" from the drop-down menu of SKU. Now, click on \"Review + create\".</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/5.png\" /></p>\n<p>Click on the \"Create\".</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/6.png\" /></p>\n<p>Now, search \"all resources\" in the search box and click on that.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/7.png\" /></p>\n<p>Click on the <strong>\"docker-VM\"</strong>.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/8.png\" /></p>\n<p>Now, copy the <strong>Public IP address</strong> of the docker-VM.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/9.png\" /></p>\n<p><strong><em>NOTE: Save this Public IP address somewhere for future reference.</em></strong></p>\n<p>Search <strong>\"Resource groups\"</strong> in the search box and click on that.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/10.png\" /></p>\n<p>Click on the pre-defined resource group.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/11.png\" /></p>\n<p>Click on the \"Deployments\".</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/12.png\" /></p>\n<p>Select <strong>\"AzureContainerRegistryAzureADAuthentication-v2\"</strong>.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/13.png\" /></p>\n<p>Go to <strong>\"Template\"</strong> and look for the <strong>\"adminPassword\"</strong>. </p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/14.png\" /></p>\n<p><strong><em>NOTE: Save the adminPassword somewhere for the future reference.</em></strong></p>\n<p>Now, open the cloud shell by clicking the icon as shown in the below image.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/15.png\" /></p>\n<p>Click on the \"Bash\".</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/16.png\" /></p>\n<p>Select the <strong>\"Show advanced settings\"</strong> option.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/17.png\" /></p>\n<p>Give the \"Storage account\" and the \"File share\" a name and click on \"Create storage\".</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/18.png\" /></p>\n<p>Wait for the shell to get configured and type the below-mentioned command to connect to the virtual machine.</p>\n<p><pre class=\"codehilite\"><code>ssh student@&lt;Public IP Address of docker-VM&gt;</code></pre>\n<strong><em>NOTE: Replace the IP Address of the docker-VM in the above command.</em></strong></p>\n<p>Type \"yes\" when asked for continue connecting.</p>\n<p>Enter the password (<strong>\"Pa55w.rd!\"</strong>) which you saved earlier.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/19.png\" /></p>\n<p>Now install the Azure CLI with the help of the following command:</p>\n<pre class=\"codehilite\"><code>curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/20.png\" /></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/21.png\" /></p>\n<p>Now login to the Azure CLI.</p>\n<p><pre class=\"codehilite\"><code>az login</code></pre>\nCopy the given code, visit the URL and enter the code when asked. </p>\n<p><strong><em>NOTE: If clicking on the URL is not returning anything in the response, copy the URL and paste it into the browser manually .\"</em></strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/22.png\" /></p>\n<p>Enter the code and click on the \"Next\" button.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/23.png\" /></p>\n<p>Select the account you are using for this lab.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/24.png\" /></p>\n<p>Click on the \"Continue\".</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/25.png\" /></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/26.png\" /></p>\n<p>Go back to the azure portal, you will see the following output.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/27.png\" /></p>\n<p>Now, login to the acr repository.</p>\n<pre class=\"codehilite\"><code>sudo az acr login --name &lt;Name of the Repository&gt;</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/28.png\" /></p>\n<p>Pull the docker image.</p>\n<pre class=\"codehilite\"><code>sudo docker pull twallace27603/pythonserver:latest</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/29.png\" /></p>\n<p>Go to the \"Resource Group\", click on the Deployment. (Without closing the cloud shell)</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/30.png\" /></p>\n<p>Click on the \"MicrosoftContainerRegistry\".</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/31.png\" /></p>\n<p>Click on the \"Go to resource\".</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/32.png\" /></p>\n<p>Copy the <strong>Login server</strong> name.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/33.png\" /></p>\n<p>Now tag the docker image.</p>\n<pre class=\"codehilite\"><code>sudo docker tag twallace27603/pythonserver:latest &lt;your ACR server&gt;/pythonserver:1.0</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/34.png\" /></p>\n<p>Replace the name of your ACR server in the command before running.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/35.png\" /></p>\n<p>Push the docker image.</p>\n<pre class=\"codehilite\"><code>sudo docker push &lt;your ACR server&gt;/pythonserver:1.0</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/36.png\" /></p>\n<p>Go to the Container registry select the Repositories and click on the <strong>\"pythonserver\"</strong>.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/37.png\" /></p>\n<p>You will see, the version 1.0 is present there!</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/azure-container-registry-azure-ad-authentication/38.png\" /></p>\n<h2>Your lab is completed now.</h2>",
    "flags": [],
    "min_points_to_pass": null,
    "access_type": "web",
    "user_status": "unstarted",
    "user_lab_status": null,
    "user_status_modified": null,
    "user_flags": [],
    "global_running_session": null
}