Azure.Analytics.Purview.Sharing
1.0.0-beta.2
Prefix Reserved
See the version list below for details.
dotnet add package Azure.Analytics.Purview.Sharing --version 1.0.0-beta.2
NuGet\Install-Package Azure.Analytics.Purview.Sharing -Version 1.0.0-beta.2
<PackageReference Include="Azure.Analytics.Purview.Sharing" Version="1.0.0-beta.2" />
paket add Azure.Analytics.Purview.Sharing --version 1.0.0-beta.2
#r "nuget: Azure.Analytics.Purview.Sharing, 1.0.0-beta.2"
// Install Azure.Analytics.Purview.Sharing as a Cake Addin
#addin nuget:?package=Azure.Analytics.Purview.Sharing&version=1.0.0-beta.2&prerelease
// Install Azure.Analytics.Purview.Sharing as a Cake Tool
#tool nuget:?package=Azure.Analytics.Purview.Sharing&version=1.0.0-beta.2&prerelease
Azure Purview Share client library for .NET
Microsoft Purview Share is a fully managed cloud service.
Please rely heavily on the service's documentation and our protocol client docs to use this library
Source code | Package (NuGet) | Product documentation
Getting started
Install the package
Install the Microsoft Purview Share client library for .NET with NuGet:
dotnet add package Azure.Analytics.Purview.Sharing --prerelease
Prerequisites
- You must have an Azure subscription and a Purview resource to use this package.
Authenticate the client
Using Azure Active Directory
This example demonstrates using DefaultAzureCredential to authenticate via Azure Active Directory. However, any of the credentials offered by the Azure.Identity will be accepted. See the Azure.Identity documentation for more information about other credentials.
Once you have chosen and configured your credential, you can create instances of the SentSharesClient
.
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var sentShareClient = new SentSharesClient(endPoint, credential);
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var receivedSharesClient = new ReceivedSharesClient(endPoint, credential);
Key concepts
Protocol Methods
Operations exposed by the Purview Share client library for .NET use protocol methods to expose the underlying REST operations. You can learn more about how to use Azure SDK clients which use protocol methods in our documentation.
Thread safety
We guarantee that all client instance methods are thread-safe and independent of each other (guideline). This ensures that the recommendation of reusing client instances is always safe, even across threads.
Additional concepts
Client options | Accessing the response | Long-running operations | Handling failures | Diagnostics | Mocking | Client lifetime
Examples
The following section shows you how to initialize and authenticate your client and share data.
Create a sent share
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var sentShareClient = new SentSharesClient(endPoint, credential);
var data = new
{
shareKind = "InPlace",
properties = new
{
artifact = new
{
storeKind = "AdlsGen2Account",
storeReference = new
{
referenceName = "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Storage/storageAccounts/sharerStorageAccount",
type = "ArmResourceReference"
},
properties = new
{
paths = new[]
{
new
{
containerName = "containerName",
senderPath = "senderPath",
receiverPath = "receiverPath"
}
}
}
},
displayName = "displayName",
description = "description",
}
};
Operation<BinaryData> createResponse = await sentShareClient.CreateOrReplaceSentShareAsync(WaitUntil.Completed, "sentShareId", RequestContent.Create(data));
Get a sent share
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var sentShareClient = new SentSharesClient(endPoint, credential);
Response response = await sentShareClient.GetSentShareAsync("sentShareId");
List sent shares
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var sentShareClient = new SentSharesClient(endPoint, credential);
List<BinaryData> response = await sentShareClient.GetAllSentSharesAsync("referenceName").ToEnumerableAsync();
Create a sent share invitation
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var sentShareClient = new SentSharesClient(endPoint, credential);
var data = new
{
invitationKind = "Service",
properties = new
{
TargetActiveDirectoryId = "targetActiveDirectoryId",
TargetObjectId = "targetObjectId",
}
};
Response response = await sentShareClient.CreateSentShareInvitationAsync("sentShareId", "sentShareInvitationId", RequestContent.Create(data));
Get a sent share invitation
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var sentShareClient = new SentSharesClient(endPoint, credential);
Response response = await sentShareClient.GetSentShareInvitationAsync("sentShareId", "sentShareInvitationId");
List sent share invitations
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var sentShareClient = new SentSharesClient(endPoint, credential);
List<BinaryData> sentShareInvitations = await sentShareClient.GetAllSentShareInvitationsAsync("sentShareId").ToEnumerableAsync();
List detached received shares
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var receivedSharesClient = new ReceivedSharesClient(endPoint, credential);
List<BinaryData> createResponse = await receivedSharesClient.GetAllDetachedReceivedSharesAsync().ToEnumerableAsync();
Create a received share
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var receivedSharesClient = new ReceivedSharesClient(endPoint, credential);
var data = new
{
shareKind = "InPlace",
properties = new
{
sink = new
{
storeKind = "AdlsGen2Account",
storeReference = new
{
referenceName = "/subscriptions/suscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Storage/storageAccounts/receiverStorageAccount",
type = "ArmResourceReference"
},
properties = new
{
containerName = "containerName",
folder = "folder",
mountPath = "mountPath",
}
},
displayName = "displayName",
}
};
Operation<BinaryData> createResponse = await receivedSharesClient.CreateOrReplaceReceivedShareAsync(WaitUntil.Completed, "receivedShareId", RequestContent.Create(data));
Get a received share
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var receivedSharesClient = new ReceivedSharesClient(endPoint, credential);
Response operation = await receivedSharesClient.GetReceivedShareAsync("receivedShareId");
List attached received shares
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var receivedSharesClient = new ReceivedSharesClient(endPoint, credential);
List<BinaryData> createResponse = await receivedSharesClient.GetAllAttachedReceivedSharesAsync("referenceName").ToEnumerableAsync();
Delete a received share
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var receivedSharesClient = new ReceivedSharesClient(endPoint, credential);
Operation operation = await receivedSharesClient.DeleteReceivedShareAsync(WaitUntil.Completed, "receivedShareId");
Delete a sent share invitation
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var sentShareClient = new SentSharesClient(endPoint, credential);
Operation operation = await sentShareClient.DeleteSentShareInvitationAsync(WaitUntil.Completed, "sentShareId", "sentShareInvitationId");
Delete a sent share
var credential = new DefaultAzureCredential();
var endPoint = "https://my-account-name.purview.azure.com/share";
var sentShareClient = new SentSharesClient(endPoint, credential);
Operation operation = await sentShareClient.DeleteSentShareAsync(WaitUntil.Completed, "sentShareId");
Troubleshooting
Setting up console logging
The simplest way to see the logs is to enable the console logging. To create an Azure SDK log listener that outputs messages to console use AzureEventSourceListener.CreateConsoleLogger method.
// Setup a listener to monitor logged events.
using AzureEventSourceListener listener = AzureEventSourceListener.CreateConsoleLogger();
To learn more about other logging mechanisms see here.
Next steps
This client SDK exposes operations using protocol methods, you can learn more about how to use SDK Clients which use protocol methods in our documentation.
Contributing
See the CONTRIBUTING.md for details on building, testing, and contributing to this library.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Azure.Core (>= 1.30.0)
- System.Text.Json (>= 4.7.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0-beta.3 | 1,503 | 6/22/2023 |
1.0.0-beta.2 | 210 | 3/14/2023 |
1.0.0-beta.1 | 97 | 3/3/2023 |