Skip to content

Planetarycomputer dotnet sdk public #50909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
71516c5
add planetary computer sdk for dotnet
Jun 24, 2025
7052dfa
Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/…
shaktichetan23 Jun 24, 2025
4e370cc
Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/…
shaktichetan23 Jun 24, 2025
924bd2c
readme update
Jun 24, 2025
2ea9d94
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
Jun 24, 2025
27c8887
Merge branch 'planetarycomputer_dotnet_sdk' of https://github.com/Azu…
Jun 24, 2025
e87c14a
fix checks
Jun 24, 2025
b291f58
fix checks
Jun 24, 2025
9bb6c0a
fix recorded tests
Jun 25, 2025
0dd75c2
fix readme
Jun 25, 2025
18f94a0
fix readme 2
Jun 25, 2025
3f3f78b
fix readme 3
Jun 25, 2025
c44f01e
fix readme 4
Jun 25, 2025
540cc34
fix readme 5
Jun 26, 2025
63bd0a4
fix readme 6
Jun 26, 2025
8607be2
fix readme 7
Jun 26, 2025
4cc3354
ignore spell check for the word spatio
Jun 26, 2025
2d3ffa4
add planetary computer sdk for dotnet
Jun 24, 2025
9fd6464
readme update
Jun 24, 2025
bdc0f9e
Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/…
shaktichetan23 Jun 24, 2025
9c5b029
Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/…
shaktichetan23 Jun 24, 2025
e353f01
fix checks
Jun 24, 2025
66d8282
fix checks
Jun 24, 2025
7a59c22
fix recorded tests
Jun 25, 2025
9526fad
fix readme
Jun 25, 2025
459cde2
fix readme 2
Jun 25, 2025
25615cc
fix readme 3
Jun 25, 2025
79d46df
fix readme 4
Jun 25, 2025
b0dd914
fix readme 5
Jun 26, 2025
941855a
fix readme 6
Jun 26, 2025
af000b5
fix readme 7
Jun 26, 2025
fa44ba8
ignore spell check for the word spatio
Jun 26, 2025
c165a18
Merge branch 'planetarycomputer_dotnet_sdk' of https://github.com/Azu…
Jun 26, 2025
a9bb61b
change tsp location config
Jun 26, 2025
050ae1f
Update API surface files after code generation
Jun 26, 2025
3f086a6
Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/…
shaktichetan23 Jun 26, 2025
0f2d540
add codeowner
Jun 26, 2025
f8781b8
add codeowners
Jun 30, 2025
3888d8d
fix codeowners
Jul 1, 2025
3f9ef4c
fix codeowners
Jul 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,12 @@
# ServiceLabel: %Image Analysis
# ServiceOwners: @rhurey @dargilco

# PRLabel: %Planetary Computer
/sdk/planetarycomputer/ @shaktichetan23 @thisisdevanshu

# ServiceLabel: %Planetary Computer
# ServiceOwners: @shaktichetan23 @thisisdevanshu

# PRLabel: %Microsoft Playwright Testing
/sdk/playwrighttesting/ @Sid200026 @puagarwa @ShreyaAnand

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29709.97
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.PlanetaryComputer.Samples", "samples\Azure.ResourceManager.PlanetaryComputer.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.PlanetaryComputer", "src\Azure.ResourceManager.PlanetaryComputer.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.PlanetaryComputer.Tests", "tests\Azure.ResourceManager.PlanetaryComputer.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU
{8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU
{7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU
{A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Release History

## 1.0.0-beta.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
## Microsoft Azure PlanetaryComputer client library for .NET

The `Azure.ResourceManager.PlanetaryComputer` SDK is the **.NET Management Plane SDK** for working with `GeoCatalog` resources under the **PlanetaryComputer** service.

It supports full **CRUD operations**, as well as **recorded** and **playback testing** using the Azure SDK's standard test framework.

---

## Project Structure

```
sdk/
└── planetarycomputer/
└── Azure.ResourceManager.PlanetaryComputer/
├── src/ # Generated SDK source code
├── tests/
│ ├── Scenario/
│ │ └── GeoCatalogCollectionTests.cs # Main scenario tests
│ ├── PlanetaryComputerManagementTestBase.cs # Base test infrastructure
│ └── PlanetaryComputerManagementTestEnvironment.cs
├── Azure.ResourceManager.PlanetaryComputer.csproj
├── Azure.ResourceManager.PlanetaryComputer.Tests.csproj
└── assets.json # Required for test recording/playback
```

---

## Getting started

### Install the Package

Install the package via [NuGet](https://www.nuget.org/):

```bash
dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease
```

---

### Prerequisites

- [.NET SDK 8.0+](https://dotnet.microsoft.com/download)
- [Azure SDK Test Proxy](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md)
```bash
dotnet tool install --global Azure.Sdk.Tools.TestProxy
```
- Logged in to Azure CLI:
```bash
az login
```
- Set the following environment variables for test execution:

```bash
$env:AZURE_SUBSCRIPTION_ID = "<your-subscription-id>"
$env:AZURE_TEST_MODE = "Record" # or "Playback"
$env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com"
```
---

### Authenticate the Client

To authenticate the client, use the `DefaultAzureCredential` from the Azure.Identity library. Ensure your environment is set up with the necessary Azure credentials.

```csharp
using Azure.Identity;
using Azure.ResourceManager.PlanetaryComputer;

var credential = new DefaultAzureCredential();
var client = new PlanetaryComputerManagementClient(credential);
```

## Supported Tests

| Test Name | Description |
|----------------------------------|---------------------------------------------|
| `CreateGeoCatalog` | Creates a GeoCatalog |
| `UpdateGeoCatalog` | Updates an existing GeoCatalog |
| `DeleteGeoCatalog` | Deletes a GeoCatalog |
| `GetGeoCatalog` | Retrieves a specific GeoCatalog |
| `ListGeoCatalogsInResourceGroup`| Lists GeoCatalogs in a resource group |
| `ListGeoCatalogsBySubscription` | Lists GeoCatalogs under a subscription |
| `CreateUpdateDeleteGeoCatalog` | Full CRUD scenario combined |

---

## Running Tests

### Record Mode (Live with Azure)

1. Start the test proxy:
```bash
test-proxy
```
2. Set mode:
```bash
$env:AZURE_TEST_MODE = "Record"
```
3. Run a specific test:
```bash
dotnet test -f net8.0 --filter "Name=CreateUpdateDeleteGeoCatalog"
```
4. Recordings are saved to:
```
.azure-sdk-for-net/.assets/<hash>/net/sdk/PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer/tests/SessionRecords
```

---

### Playback Mode (Offline Testing)

1. Set mode:
```bash
$env:AZURE_TEST_MODE = "Playback"
```
2. (Optional) Restore recordings:
```bash
test-proxy restore -a ./assets.json
```
3. Run test:
```bash
dotnet test -f net8.0 --filter "Name=CreateUpdateDeleteGeoCatalog"
```

---


## Key concepts

The PlanetaryComputer SDK provides management capabilities for GeoCatalog resources. Key concepts include:
- **GeoCatalog**: Represents a catalog of geospatial data.
- **CRUD Operations**: Create, Read, Update, and Delete operations for GeoCatalog resources.
- **Authentication**: Uses Azure Active Directory for secure access.

## Examples

### Create a GeoCatalog

```csharp
var geoCatalogData = new GeoCatalogData(new AzureLocation("uksouth"))
{
Properties = new GeoCatalogProperties
{
Tier = CatalogTier.Basic
}
};

var geoCatalog = await client.GeoCatalogs.CreateOrUpdateAsync("resourceGroupName", "geoCatalogName", geoCatalogData);
```

### List GeoCatalogs

```csharp
var geoCatalogs = await client.GeoCatalogs.ListAsync("resourceGroupName");
foreach (var catalog in geoCatalogs)
{
Console.WriteLine(catalog.Name);
}
```

## Troubleshooting

If you encounter issues, check the following:
- Ensure Azure CLI is logged in (`az login`).
- Verify the subscription and resource group names.
- Check for network connectivity issues.

## Next steps

Explore additional features of the PlanetaryComputer SDK:
- [Samples Repository](https://github.com/Azure/azure-sdk-for-net)

## Contributing

We welcome contributions! Please see our [Contributing Guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for details on how to get started.
Loading