官术网_书友最值得收藏!

Configuring and using Azure Blob Storage

In the previous chapter, we created an Azure storage account using PowerShell and from the Azure Storage Explorer, we created a blob container for that storage account and uploaded some files to it as well.

In this section, we are going to configure Azure Blob Storage from PowerShell. We are going to use the same storage account that we created in the previous chapter, but now we will use PowerShell to add a blob container to it. We will also provide an example to create multiple blob containers at once. Therefore, take the following steps:

  1. First, we need to log in to the Azure account as follows:
Connect-AzAccount
  1. If necessary, select the right subscription as follows:
Select-AzSubscription -SubscriptionId "********-****-****-****-***********"
  1. Select the storage account that we created in the previous chapter and add it to a variable as follows:
$accountObject = Get-AzStorageAccount -ResourceGroupName "PacktPubStorageAccount" -AccountName "packtpubstorage"
  1. Then retrieve the context of the storage account:
$Context = $accountObject.Context
  1. Create a blob container to it with public access as Blob as follows:
new-AzStoragecontainer -Name "packtblobcontainerps" -Context $Context -Permission blob

We are going to use this blob container in the next section, where we will create an import into and an export using Azure Job.

主站蜘蛛池模板: 赤城县| 濉溪县| 南京市| 凉城县| 乐东| 信宜市| 无锡市| 吴旗县| 中牟县| 怀来县| 修武县| 蓬溪县| 大石桥市| 剑川县| 潍坊市| 棋牌| 宜城市| 卓资县| 高安市| 凤阳县| 美姑县| 玉田县| 绥化市| 唐河县| 巩义市| 绵竹市| 广元市| 五莲县| 雅江县| 布尔津县| 沙田区| 金昌市| 晋宁县| 永安市| 高要市| 沅陵县| 新余市| 吉首市| 青浦区| 永仁县| 武城县|