Skip to content
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

Remove references to deprecated service Azure Spatial Anchors #43991

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 1 addition & 24 deletions sdk/mixedreality/azure-mixedreality-authentication/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
# Azure Mixed Reality client library for Java

Mixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security
Mixed Reality services, like Azure Remote Rendering use the Mixed Reality security
token service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access
token from the STS that can be used to access Mixed Reality services.

[Source code][source] | [Package (Maven)][package] | [API reference documentation][api_documentation]
| [Product documentation][product_docs]

![Mixed Reality service authentication diagram](https://learn.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)

## Getting started

### Prerequisites

- You must have an [Azure subscription](https://azure.microsoft.com/free/).
- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):
- [Azure Remote Rendering](https://learn.microsoft.com/azure/remote-rendering/)
- [Azure Spatial Anchors](https://learn.microsoft.com/azure/spatial-anchors/)
- [Java Development Kit (JDK)](https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable) version 8 or above.
- [Apache Maven](https://maven.apache.org/download.cgi).
- Familiarity with the authentication and credential concepts from [Azure.Identity](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity).
Expand Down Expand Up @@ -80,8 +77,6 @@ Mixed Reality services support a few different forms of authentication:
method for production applications because it allows you to avoid embedding the credentials for access to a Mixed
Reality service in your client application.

See [here](https://learn.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.

## Key concepts

### MixedRealityStsClient
Expand Down Expand Up @@ -131,24 +126,6 @@ AccessToken token = client.getToken();

See the authentication examples [above](#authenticate-the-client) for more complex authentication scenarios.

#### Using the access token in a Mixed Reality client library

Some Mixed Reality client libraries might accept an access token in place of a credential. For example:

```java
// getMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves
// a Mixed Reality access token from a web service. The web service would use the
// MixedRealityStsClient and credentials to obtain an access token to be returned
// to the client.
AccessToken accessToken = getMixedRealityAccessTokenFromWebService();

SpatialAnchorsAccount account = new SpatialAnchorsAccount(accountId, accountDomain);
SpatialAnchorsClient client = new SpatialAnchorsClient(account, accessToken);
```

Note: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the
documentation for the client library you're using to determine if and how this might be supported.
Comment on lines -134 to -150
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Removing the sample does not remove the API.


## Troubleshooting

Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery.
Expand Down
257 changes: 0 additions & 257 deletions sdk/mixedreality/azure-resourcemanager-mixedreality/SAMPLE.md
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For mgmt SDK, removing the sample does not remove the API in code (and they are automatically generated upon your Swagger).

Please schedule an update on your specs sources https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mixedreality/resource-manager
and then request a new SDK release.

Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@

- [CheckNameAvailabilityLocal](#resourceprovider_checknameavailabilitylocal)

## SpatialAnchorsAccounts

- [Create](#spatialanchorsaccounts_create)
- [Delete](#spatialanchorsaccounts_delete)
- [GetByResourceGroup](#spatialanchorsaccounts_getbyresourcegroup)
- [List](#spatialanchorsaccounts_list)
- [ListByResourceGroup](#spatialanchorsaccounts_listbyresourcegroup)
- [ListKeys](#spatialanchorsaccounts_listkeys)
- [RegenerateKeys](#spatialanchorsaccounts_regeneratekeys)
- [Update](#spatialanchorsaccounts_update)
### Operations_List

```java
Expand Down Expand Up @@ -284,250 +274,3 @@ public final class RemoteRenderingAccountsUpdateSamples {
}
```

### ResourceProvider_CheckNameAvailabilityLocal

```java
import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityRequest;

/**
* Samples for ResourceProvider CheckNameAvailabilityLocal.
*/
public final class ResourceProviderCheckNameAvailabilityLocalSamples {
/*
* x-ms-original-file:
* specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/proxy/
* CheckNameAvailabilityForLocalUniqueness.json
*/
/**
* Sample code: CheckLocalNameAvailability.
*
* @param manager Entry point to MixedRealityManager.
*/
public static void checkLocalNameAvailability(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) {
manager.resourceProviders()
.checkNameAvailabilityLocalWithResponse("eastus2euap",
new CheckNameAvailabilityRequest().withName("MyAccount")
.withType("Microsoft.MixedReality/spatialAnchorsAccounts"),
com.azure.core.util.Context.NONE);
}
}
```

### SpatialAnchorsAccounts_Create

```java
/**
* Samples for SpatialAnchorsAccounts Create.
*/
public final class SpatialAnchorsAccountsCreateSamples {
/*
* x-ms-original-file:
* specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Put
* .json
*/
/**
* Sample code: Create spatial anchor account.
*
* @param manager Entry point to MixedRealityManager.
*/
public static void createSpatialAnchorAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) {
manager.spatialAnchorsAccounts()
.define("MyAccount")
.withRegion("eastus2euap")
.withExistingResourceGroup("MyResourceGroup")
.create();
}
}
```

### SpatialAnchorsAccounts_Delete

```java
/**
* Samples for SpatialAnchorsAccounts Delete.
*/
public final class SpatialAnchorsAccountsDeleteSamples {
/*
* x-ms-original-file:
* specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/
* Delete.json
*/
/**
* Sample code: Delete spatial anchors account.
*
* @param manager Entry point to MixedRealityManager.
*/
public static void deleteSpatialAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) {
manager.spatialAnchorsAccounts()
.deleteByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE);
}
}
```

### SpatialAnchorsAccounts_GetByResourceGroup

```java
/**
* Samples for SpatialAnchorsAccounts GetByResourceGroup.
*/
public final class SpatialAnchorsAccountsGetByResourceGroupSamples {
/*
* x-ms-original-file:
* specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Get
* .json
*/
/**
* Sample code: Get spatial anchors account.
*
* @param manager Entry point to MixedRealityManager.
*/
public static void getSpatialAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) {
manager.spatialAnchorsAccounts()
.getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE);
}
}
```

### SpatialAnchorsAccounts_List

```java
/**
* Samples for SpatialAnchorsAccounts List.
*/
public final class SpatialAnchorsAccountsListSamples {
/*
* x-ms-original-file:
* specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/
* GetBySubscription.json
*/
/**
* Sample code: List spatial anchors accounts by subscription.
*
* @param manager Entry point to MixedRealityManager.
*/
public static void
listSpatialAnchorsAccountsBySubscription(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) {
manager.spatialAnchorsAccounts().list(com.azure.core.util.Context.NONE);
}
}
```

### SpatialAnchorsAccounts_ListByResourceGroup

```java
/**
* Samples for SpatialAnchorsAccounts ListByResourceGroup.
*/
public final class SpatialAnchorsAccountsListByResourceGroupSamples {
/*
* x-ms-original-file:
* specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/
* GetByResourceGroup.json
*/
/**
* Sample code: List spatial anchor accounts by resource group.
*
* @param manager Entry point to MixedRealityManager.
*/
public static void
listSpatialAnchorAccountsByResourceGroup(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) {
manager.spatialAnchorsAccounts().listByResourceGroup("MyResourceGroup", com.azure.core.util.Context.NONE);
}
}
```

### SpatialAnchorsAccounts_ListKeys

```java
/**
* Samples for SpatialAnchorsAccounts ListKeys.
*/
public final class SpatialAnchorsAccountsListKeysSamples {
/*
* x-ms-original-file:
* specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/
* ListKeys.json
*/
/**
* Sample code: List spatial anchor account key.
*
* @param manager Entry point to MixedRealityManager.
*/
public static void listSpatialAnchorAccountKey(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) {
manager.spatialAnchorsAccounts()
.listKeysWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE);
}
}
```

### SpatialAnchorsAccounts_RegenerateKeys

```java
import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest;
import com.azure.resourcemanager.mixedreality.models.Serial;

/**
* Samples for SpatialAnchorsAccounts RegenerateKeys.
*/
public final class SpatialAnchorsAccountsRegenerateKeysSamples {
/*
* x-ms-original-file:
* specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/
* RegenerateKey.json
*/
/**
* Sample code: Regenerate spatial anchors account keys.
*
* @param manager Entry point to MixedRealityManager.
*/
public static void
regenerateSpatialAnchorsAccountKeys(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) {
manager.spatialAnchorsAccounts()
.regenerateKeysWithResponse("MyResourceGroup", "MyAccount",
new AccountKeyRegenerateRequest().withSerial(Serial.ONE), com.azure.core.util.Context.NONE);
}
}
```

### SpatialAnchorsAccounts_Update

```java
import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount;
import java.util.HashMap;
import java.util.Map;

/**
* Samples for SpatialAnchorsAccounts Update.
*/
public final class SpatialAnchorsAccountsUpdateSamples {
/*
* x-ms-original-file:
* specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/
* Patch.json
*/
/**
* Sample code: Update spatial anchors account.
*
* @param manager Entry point to MixedRealityManager.
*/
public static void updateSpatialAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) {
SpatialAnchorsAccount resource = manager.spatialAnchorsAccounts()
.getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withTags(mapOf("hero", "romeo", "heroine", "juliet")).apply();
}

// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
```