events
1月14日 20時 - 2月25日 19時
Azure Cosmos DB Conf 2025 の提案の呼び出し
2 月 25 日までにセッション提案を送信し、Azure Cosmos DB Conf 2025 に参加します。このブラウザーはサポートされなくなりました。
Microsoft Edge にアップグレードすると、最新の機能、セキュリティ更新プログラム、およびテクニカル サポートを利用できます。
適用対象: NoSQL
以下のガイドでは、PowerShell を使用して、Azure Cosmos DB アカウント、データベース、コンテナー、スループットなど、Azure Cosmos DB for NoSQL リソースの管理をスクリプト処理および自動化する方法について説明します。 他の API 用の PowerShell コマンドレットについては、Cassandra 用 PowerShell サンプル、MongoDB 用 API 用 PowerShell サンプル、Gremlin 用 PowerShell サンプル、Table 用 PowerShell サンプルに関する記述を参照してください
注意
この記事のサンプルでは、Az.CosmosDB 管理コマンドレットを使用します。 最新の変更については、Az.CosmosDB API リファレンス ページを参照してください。
クロスプラットフォームの Azure Cosmos DB の管理には、クロスプラットフォームの PowerShell での Az
コマンドレットと Az.CosmosDB
コマンドレットのほか、Azure CLI、REST API、Azure portal を使用できます。
注意
Azure を操作するには、Azure Az PowerShell モジュールを使用することをお勧めします。 作業を始めるには、「Azure PowerShell をインストールする」を参照してください。 Az PowerShell モジュールに移行する方法については、「AzureRM から Az への Azure PowerShell の移行」を参照してください。
Azure PowerShell のインストールおよび構成方法に関する記事の指示に従ってインストールし、PowerShell で Azure アカウントにサインインします。
重要
Azure Cosmos DB リソースの名前を変更することはできません。これは、Azure Resource Manager がリソース URI と連携する方法に違反するためです。
以下のセクションでは、次の内容を含む Azure Cosmos DB アカウントの管理方法について説明します。
このコマンドでは、複数リージョン、サービス管理フェールオーバー、有界整合性制約の一貫性ポリシーを使用し、Azure Cosmos DB データベース アカウントが作成されます。
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$apiKind = "Sql"
$consistencyLevel = "BoundedStaleness"
$maxStalenessInterval = 300
$maxStalenessPrefix = 100000
$locations = @()
$locations += New-AzCosmosDBLocationObject -LocationName "East US" -FailoverPriority 0 -IsZoneRedundant 0
$locations += New-AzCosmosDBLocationObject -LocationName "West US" -FailoverPriority 1 -IsZoneRedundant 0
New-AzCosmosDBAccount `
-ResourceGroupName $resourceGroupName `
-LocationObject $locations `
-Name $accountName `
-ApiKind $apiKind `
-EnableAutomaticFailover:$true `
-DefaultConsistencyLevel $consistencyLevel `
-MaxStalenessIntervalInSeconds $maxStalenessInterval `
-MaxStalenessPrefix $maxStalenessPrefix
$resourceGroupName
Azure Cosmos DB アカウントのデプロイ先となる Azure リソース グループ。 あらかじめ存在している必要があります。$locations
データベース アカウントのリージョン。FailoverPriority 0
を持つリージョンが書き込みリージョンです。$accountName
Azure Cosmos DB アカウントの名前。 小文字で一意の名前にする必要があります。使用できるのは、英数字と "-" 文字のみで、長さは 3 から 31 文字としてください。$apiKind
作成する Azure Cosmos DB アカウントの種類。 詳細については、Azure Cosmos DB の API に関するページを参照してください。$consistencyPolicy
、$maxStalenessInterval
、$maxStalenessPrefix
Azure Cosmos DB アカウントの既定の一貫性レベルと設定。 詳細については、Azure Cosmos DB の一貫性レベルに関する記事をご覧ください。Azure Cosmos DB アカウントは、IP ファイアウォール、仮想ネットワーク サービス エンドポイント、プライベート エンドポイントを使用して構成できます。 Azure Cosmos DB 用に IP ファイアウォールを構成する方法については、IP ファイアウォールの構成に関する記事を参照してください。 Azure Cosmos DB のサービス エンドポイントを有効にする方法については、「仮想ネットワークからのアクセスの構成」を参照してください。 Azure Cosmos DB のプライベート エンドポイントを有効にする方法については、「プライベート エンドポイントからのアクセスを構成する」を参照してください。
このコマンドは、リソース グループ内のすべての Azure Cosmos DB アカウントを一覧表示します。
$resourceGroupName = "myResourceGroup"
Get-AzCosmosDBAccount -ResourceGroupName $resourceGroupName
このコマンドを使用すると、既存の Azure Cosmos DB アカウントのプロパティを取得できます。
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
Get-AzCosmosDBAccount -ResourceGroupName $resourceGroupName -Name $accountName
このコマンドでは、Azure Cosmos DB データベース アカウントのプロパティを更新できます。 更新できるプロパティは次のとおりです。
注意
Azure Cosmos DB アカウントに対し、リージョン (locations
) の追加または削除と、他のプロパティの変更を同時に行うことはできません。 リージョンの変更は、アカウントに対する他のあらゆる変更とは別の操作として実行する必要があります。
注意
このコマンドでは、リージョンの追加および削除が可能ですが、フェールオーバー優先度を変更したり手動フェールオーバーをトリガーしたりすることはできません。 「フェールオーバー優先度を変更する」と「手動フェールオーバーをトリガーする」を参照してください。
ヒント
新しいリージョンが追加されるとき、すべてのデータが新しいリージョンに完全にレプリケートおよびコミットされるまで、リージョンには使用可能のマークが付きません。 この操作にかかる時間は、アカウント内に保存されているデータの量によって変動します。 非同期スループット スケーリング操作が進行中の場合、スループットのスケールアップ操作は一時停止され、リージョンの追加または削除操作が完了すると自動的に再開されます。
# Create account with two regions
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$apiKind = "Sql"
$consistencyLevel = "Session"
$enableAutomaticFailover = $true
$locations = @()
$locations += New-AzCosmosDBLocationObject -LocationName "East US" -FailoverPriority 0 -IsZoneRedundant 0
$locations += New-AzCosmosDBLocationObject -LocationName "West US" -FailoverPriority 1 -IsZoneRedundant 0
# Create the Azure Cosmos DB account
New-AzCosmosDBAccount `
-ResourceGroupName $resourceGroupName `
-LocationObject $locations `
-Name $accountName `
-ApiKind $apiKind `
-EnableAutomaticFailover:$enableAutomaticFailover `
-DefaultConsistencyLevel $consistencyLevel
# Add a region to the account
$locationObject2 = @()
$locationObject2 += New-AzCosmosDBLocationObject -LocationName "East US" -FailoverPriority 0 -IsZoneRedundant 0
$locationObject2 += New-AzCosmosDBLocationObject -LocationName "West US" -FailoverPriority 1 -IsZoneRedundant 0
$locationObject2 += New-AzCosmosDBLocationObject -LocationName "South Central US" -FailoverPriority 2 -IsZoneRedundant 0
Update-AzCosmosDBAccountRegion `
-ResourceGroupName $resourceGroupName `
-Name $accountName `
-LocationObject $locationObject2
Write-Host "Update-AzCosmosDBAccountRegion returns before the region update is complete."
Write-Host "Check account in Azure portal or using Get-AzCosmosDBAccount for region status."
Write-Host "When region was added, press any key to continue."
$HOST.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | OUT-NULL
$HOST.UI.RawUI.Flushinputbuffer()
# Remove West US region from the account
$locationObject3 = @()
$locationObject3 += New-AzCosmosDBLocationObject -LocationName "East US" -FailoverPriority 0 -IsZoneRedundant 0
$locationObject3 += New-AzCosmosDBLocationObject -LocationName "South Central US" -FailoverPriority 1 -IsZoneRedundant 0
Update-AzCosmosDBAccountRegion `
-ResourceGroupName $resourceGroupName `
-Name $accountName `
-LocationObject $locationObject3
Write-Host "Update-AzCosmosDBAccountRegion returns before the region update is complete."
Write-Host "Check account in Azure portal or using Get-AzCosmosDBAccount for region status."
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$enableAutomaticFailover = $false
$enableMultiMaster = $true
# First disable service-managed failover - cannot have both service-managed
# failover and multi-region writes on an account
Update-AzCosmosDBAccount `
-ResourceGroupName $resourceGroupName `
-Name $accountName `
-EnableAutomaticFailover:$enableAutomaticFailover
# Now enable multi-region writes
Update-AzCosmosDBAccount `
-ResourceGroupName $resourceGroupName `
-Name $accountName `
-EnableMultipleWriteLocations:$enableMultiMaster
このコマンドは、既存の Azure Cosmos DB アカウントを削除します。
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
Remove-AzCosmosDBAccount `
-ResourceGroupName $resourceGroupName `
-Name $accountName `
-PassThru:$true
このコマンドは、Azure Cosmos DB アカウントに Azure リソース タグ を設定します。 タグは、アカウントの作成時に New-AzCosmosDBAccount
を使用して設定できるほか、アカウントの更新時に Update-AzCosmosDBAccount
を使用して設定することもできます。
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$tags = @{dept = "Finance"; environment = "Production";}
Update-AzCosmosDBAccount `
-ResourceGroupName $resourceGroupName `
-Name $accountName `
-Tag $tags
次のコマンドは、プライマリ リージョンが使用できなくなった場合に、そのセカンダリ リージョンに対してサービスマネージド フェールオーバーを実行するように Azure Cosmos DB アカウントを設定します。
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$enableAutomaticFailover = $true
$enableMultiMaster = $false
# First disable multi-region writes - cannot have both automatic
# failover and multi-region writes on an account
Update-AzCosmosDBAccount `
-ResourceGroupName $resourceGroupName `
-Name $accountName `
-EnableMultipleWriteLocations:$enableMultiMaster
# Now enable service-managed failover
Update-AzCosmosDBAccount `
-ResourceGroupName $resourceGroupName `
-Name $accountName `
-EnableAutomaticFailover:$enableAutomaticFailover
サービス管理フェールオーバーを使用して構成されたアカウントでは、プライマリが利用不可になった場合に、Azure Cosmos DB がどのような順序でセカンダリ レプリカをプライマリに昇格するかを変更することができます。
以下の例では、現在のフェールオーバー優先度が West US = 0
、East US = 1
、South Central US = 2
であることを想定しています。 それが、このコマンドによって West US = 0
、South Central US = 1
、East US = 2
に変更されます。
注意事項
failoverPriority=0
の場所を変更すると、Azure Cosmos DB アカウントの手動フェールオーバーがトリガーされます。 他の優先度を変更しても、フェールオーバーはトリガーされません。
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$locations = @("West US", "South Central US", "East US") # Regions ordered by UPDATED failover priority
Update-AzCosmosDBAccountFailoverPriority `
-ResourceGroupName $resourceGroupName `
-Name $accountName `
-FailoverPolicy $locations
手動フェールオーバーを使用して構成されたアカウントでは、failoverPriority=0
に変更することでフェールオーバーを実行し、任意のセカンダリ レプリカをプライマリに昇格することができます。 この操作は、ディザスター リカバリーの訓練を開始し、ディザスター リカバリー計画をテストする際に使用できます。
以下の例では、アカウントの現在のフェールオーバー優先度が West US = 0
および East US = 1
であるものとして、リージョンを反転させます。
注意事項
failoverPriority=0
に対する locationName
を変更すると、Azure Cosmos DB アカウントの手動フェールオーバーがトリガーされます。 他の優先度を変更しても、フェールオーバーはトリガーされません。
注意
非同期スループット スケーリング操作の進行中に手動フェールオーバー操作を実行すると、スループットのスケールアップ操作は一時停止されます。 フェールオーバー操作が完了すると、自動的に再開されます。
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$locations = @("East US", "West US") # Regions ordered by UPDATED failover priority
Update-AzCosmosDBAccountFailoverPriority `
-ResourceGroupName $resourceGroupName `
-Name $accountName `
-FailoverPolicy $locations
リソース ロックは、データベースやコレクションなどの Azure Cosmos DB リソースに設定できます。 次の例は、Azure Cosmos DB アカウントのすべての Azure リソース ロックを一覧表示する方法を示しています。
$resourceGroupName = "myResourceGroup"
$resourceTypeAccount = "Microsoft.DocumentDB/databaseAccounts"
$accountName = "mycosmosaccount"
Get-AzResourceLock `
-ResourceGroupName $resourceGroupName `
-ResourceType $resourceTypeAccount `
-ResourceName $accountName
以下のセクションでは、Azure Cosmos DB データベースの管理方法について説明します。
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
New-AzCosmosDBSqlDatabase `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-Name $databaseName
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$databaseRUs = 400
New-AzCosmosDBSqlDatabase `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-Name $databaseName `
-Throughput $databaseRUs
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
Get-AzCosmosDBSqlDatabaseThroughput `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-Name $databaseName
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
Invoke-AzCosmosDBSqlDatabaseThroughputMigration `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-Name $databaseName `
-ThroughputType Autoscale
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
Get-AzCosmosDBSqlDatabase `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
Get-AzCosmosDBSqlDatabase `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-Name $databaseName
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
Remove-AzCosmosDBSqlDatabase `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-Name $databaseName
$resourceGroupName = "myResourceGroup"
$resourceType = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$resourceName = "$accountName/$databaseName"
$lockName = "myResourceLock"
$lockLevel = "CanNotDelete"
New-AzResourceLock `
-ResourceGroupName $resourceGroupName `
-ResourceType $resourceType `
-ResourceName $resourceName `
-LockName $lockName `
-LockLevel $lockLevel
$resourceGroupName = "myResourceGroup"
$resourceType = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$resourceName = "$accountName/$databaseName"
$lockName = "myResourceLock"
Remove-AzResourceLock `
-ResourceGroupName $resourceGroupName `
-ResourceType $resourceType `
-ResourceName $resourceName `
-LockName $lockName
以下のセクションでは、Azure Cosmos DB コンテナーの管理方法について説明します。
# Create an Azure Cosmos DB container with default indexes and throughput at 400 RU
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
$partitionKeyPath = "/myPartitionKey"
$throughput = 400 #minimum = 400
New-AzCosmosDBSqlContainer `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName `
-PartitionKeyKind Hash `
-PartitionKeyPath $partitionKeyPath `
-Throughput $throughput
# Create an Azure Cosmos DB container with default indexes and autoscale throughput at 4000 RU
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
$partitionKeyPath = "/myPartitionKey"
$autoscaleMaxThroughput = 4000 #minimum = 4000
New-AzCosmosDBSqlContainer `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName `
-PartitionKeyKind Hash `
-PartitionKeyPath $partitionKeyPath `
-AutoscaleMaxThroughput $autoscaleMaxThroughput
# Create an Azure Cosmos DB container with a large partition key value (version = 2)
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
$partitionKeyPath = "/myPartitionKey"
New-AzCosmosDBSqlContainer `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName `
-PartitionKeyKind Hash `
-PartitionKeyPath $partitionKeyPath `
-PartitionKeyVersion 2
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
Get-AzCosmosDBSqlContainerThroughput `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
Invoke-AzCosmosDBSqlContainerThroughputMigration `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName `
-ThroughputType Autoscale
# Create a container with a custom indexing policy
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
$partitionKeyPath = "/myPartitionKey"
$indexPathIncluded = "/*"
$indexPathExcluded = "/myExcludedPath/*"
$includedPathIndex = New-AzCosmosDBSqlIncludedPathIndex -DataType String -Kind Range
$includedPath = New-AzCosmosDBSqlIncludedPath -Path $indexPathIncluded -Index $includedPathIndex
$indexingPolicy = New-AzCosmosDBSqlIndexingPolicy `
-IncludedPath $includedPath `
-ExcludedPath $indexPathExcluded `
-IndexingMode Consistent `
-Automatic $true
New-AzCosmosDBSqlContainer `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName `
-PartitionKeyKind Hash `
-PartitionKeyPath $partitionKeyPath `
-IndexingPolicy $indexingPolicy
# Create an Azure Cosmos DB container with no indexing
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
$partitionKeyPath = "/myPartitionKey"
$indexingPolicy = New-AzCosmosDBSqlIndexingPolicy `
-IndexingMode None
New-AzCosmosDBSqlContainer `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName `
-PartitionKeyKind Hash `
-PartitionKeyPath $partitionKeyPath `
-IndexingPolicy $indexingPolicy
# Create a container with a unique key policy and TTL of one day
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
$partitionKeyPath = "/myPartitionKey"
$uniqueKeyPath = "/myUniqueKeyPath"
$ttlInSeconds = 86400 # Set this to -1 (or don't use it at all) to never expire
$uniqueKey = New-AzCosmosDBSqlUniqueKey `
-Path $uniqueKeyPath
$uniqueKeyPolicy = New-AzCosmosDBSqlUniqueKeyPolicy `
-UniqueKey $uniqueKey
New-AzCosmosDBSqlContainer `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName `
-PartitionKeyKind Hash `
-PartitionKeyPath $partitionKeyPath `
-UniqueKeyPolicy $uniqueKeyPolicy `
-TtlInSeconds $ttlInSeconds
すべての競合を ConflictsFeed に書き込み、別々に処理するには、-Type "Custom" -Path ""
を渡します。
# Create container with last-writer-wins conflict resolution policy
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
$partitionKeyPath = "/myPartitionKey"
$conflictResolutionPath = "/myResolutionPath"
$conflictResolutionPolicy = New-AzCosmosDBSqlConflictResolutionPolicy `
-Type LastWriterWins `
-Path $conflictResolutionPath
New-AzCosmosDBSqlContainer `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName `
-PartitionKeyKind Hash `
-PartitionKeyPath $partitionKeyPath `
-ConflictResolutionPolicy $conflictResolutionPolicy
ストアド プロシージャを使用する競合の解決ポリシーを作成するには、New-AzCosmosDBSqlConflictResolutionPolicy
を呼び出して、パラメーター -Type
および -ConflictResolutionProcedure
を渡します。
# Create container with custom conflict resolution policy using a stored procedure
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
$partitionKeyPath = "/myPartitionKey"
$conflictResolutionSprocName = "mysproc"
$conflictResolutionSproc = "/dbs/$databaseName/colls/$containerName/sprocs/$conflictResolutionSprocName"
$conflictResolutionPolicy = New-AzCosmosDBSqlConflictResolutionPolicy `
-Type Custom `
-ConflictResolutionProcedure $conflictResolutionSproc
New-AzCosmosDBSqlContainer `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName `
-PartitionKeyKind Hash `
-PartitionKeyPath $partitionKeyPath `
-ConflictResolutionPolicy $conflictResolutionPolicy
# List all Azure Cosmos DB containers in a database
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
Get-AzCosmosDBSqlContainer `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName
# Get a single Azure Cosmos DB container in a database
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
Get-AzCosmosDBSqlContainer `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName
# Delete an Azure Cosmos DB container
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
Remove-AzCosmosDBSqlContainer `
-ResourceGroupName $resourceGroupName `
-AccountName $accountName `
-DatabaseName $databaseName `
-Name $containerName
$resourceGroupName = "myResourceGroup"
$resourceType = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
$resourceName = "$accountName/$databaseName/$containerName"
$lockName = "myResourceLock"
$lockLevel = "CanNotDelete"
New-AzResourceLock `
-ResourceGroupName $resourceGroupName `
-ResourceType $resourceType `
-ResourceName $resourceName `
-LockName $lockName `
-LockLevel $lockLevel
$resourceGroupName = "myResourceGroup"
$resourceType = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers"
$accountName = "mycosmosaccount"
$databaseName = "myDatabase"
$containerName = "myContainer"
$resourceName = "$accountName/$databaseName/$containerName"
$lockName = "myResourceLock"
Remove-AzResourceLock `
-ResourceGroupName $resourceGroupName `
-ResourceType $resourceType `
-ResourceName $resourceName `
-LockName $lockName
events
1月14日 20時 - 2月25日 19時
Azure Cosmos DB Conf 2025 の提案の呼び出し
2 月 25 日までにセッション提案を送信し、Azure Cosmos DB Conf 2025 に参加します。トレーニング
モジュール
Azure Cosmos DB for NoSQL の管理スクリプトを作成する - Training
Azure CLI を使用して Azure Cosmos DB for NoSQL アカウント、データベース、コンテナーを管理する方法について説明します。
認定資格
Microsoft Certified: Azure Cosmos DB Developer Specialty - Certifications
Microsoft Azure Cosmos DB を使用して SQL API と SDK で効率的なクエリの作成、インデックス作成ポリシーの作成、リソースの管理とプロビジョニングを行います。