sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md
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.
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
Install the package via NuGet:
dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease
dotnet tool install --global Azure.Sdk.Tools.TestProxy
az login
$env:AZURE_SUBSCRIPTION_ID = "<your-subscription-id>"
$env:AZURE_TEST_MODE = "Record" # or "Playback"
$env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com"
To authenticate the client, use the DefaultAzureCredential from the Azure.Identity library. Ensure your environment is set up with the necessary Azure credentials.
using Azure.Identity;
using Azure.ResourceManager.PlanetaryComputer;
var credential = new DefaultAzureCredential();
var client = new PlanetaryComputerManagementClient(credential);
| 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 |
test-proxy
$env:AZURE_TEST_MODE = "Record"
dotnet test -f net8.0 --filter "Name=CreateUpdateDeleteGeoCatalog"
.azure-sdk-for-net/.assets/<hash>/net/sdk/PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer/tests/SessionRecords
$env:AZURE_TEST_MODE = "Playback"
test-proxy restore -a ./assets.json
dotnet test -f net8.0 --filter "Name=CreateUpdateDeleteGeoCatalog"
The PlanetaryComputer SDK provides management capabilities for GeoCatalog resources. Key concepts include:
var geoCatalogData = new GeoCatalogData(new AzureLocation("uksouth"))
{
Properties = new GeoCatalogProperties
{
Tier = CatalogTier.Basic
}
};
var geoCatalog = await client.GeoCatalogs.CreateOrUpdateAsync("resourceGroupName", "geoCatalogName", geoCatalogData);
var geoCatalogs = await client.GeoCatalogs.ListAsync("resourceGroupName");
foreach (var catalog in geoCatalogs)
{
Console.WriteLine(catalog.Name);
}
If you encounter issues, check the following:
az login).Explore additional features of the PlanetaryComputer SDK:
We welcome contributions! Please see our Contributing Guide for details on how to get started.