Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.54 KB

accept-share-invitations-powershell.md

File metadata and controls

47 lines (35 loc) · 1.54 KB
title description services author ms.author ms.service ms.topic ms.date ms.custom
PowerShell script: Accept invitation from an Azure Data Share
This PowerShell script accepts invitations from an existing data share.
data-share
sidontha
sidontha
data-share
article
10/31/2022
devx-track-azurepowershell

Use PowerShell to accept a data share invitation

This PowerShell script accepts invitations sent to a consumer.

Sample script

#List invitations sent to a consumer
Get-AzDataShareInvitation

# Set variables with your own values
$resourceGroupName = "<Resource group name>"
$dataShareAccountName = "<Data share account name>"
$dataShareName = "<Data share name>"
$invitationId = "<Invitation id>"

#Accept a specific invitation by creating a share subscription
New-AzDataShareSubscription -ResourceGroupName $resourceGroupName -AccountName $dataShareAccountName -Name $dataShareName -InvitationId $invitationId

Script explanation

This script uses the following commands:

Command Notes
Get-AzDataShareInvitation Get and list sent data share invitations.
New-AzDataShareSubscription Create a data share subscription.

Next steps

For more information on the Azure PowerShell, see Azure PowerShell documentation.

Additional Azure Data Share PowerShell script samples can be found in the Azure Data Share PowerShell samples.