Skip to content

Commit b8ce1eb

Browse files
MichaelZp0Michael Zappe
andauthored
Update files for remoterendering for deprecation (#43417)
* Update files for remoterendering for deprecation * Remove dot --------- Co-authored-by: Michael Zappe <[email protected]>
1 parent 41d0fea commit b8ce1eb

File tree

4 files changed

+9
-382
lines changed

4 files changed

+9
-382
lines changed

sdk/remoterendering/azure-mixedreality-remoterendering/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 1.0.0b3 (2025-10-01)
4+
5+
### Other Changes
6+
7+
- This package has been deprecated and will no longer be maintained after 10-01-2025. This package will only receive security fixes until 10-01-2025.
8+
39
## 1.0.0b2 (2023-07-03)
410

511
### Other Changes
Lines changed: 1 addition & 380 deletions
Original file line numberDiff line numberDiff line change
@@ -1,380 +1 @@
1-
[![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/azure-sdk-for-python.client?branchName=master)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=46?branchName=master)
2-
3-
# Azure Remote Rendering client library for Python
4-
5-
Azure Remote Rendering (ARR) is a service that enables you to render high-quality, interactive 3D content in the cloud and stream it in real time to devices, such as the HoloLens 2.
6-
7-
This SDK offers functionality to convert assets to the format expected by the runtime, and also to manage
8-
the lifetime of remote rendering sessions.
9-
10-
This SDK supports version "2021-01-01" of the [Remote Rendering REST API](https://docs.microsoft.com/rest/api/mixedreality/2021-01-01/remote-rendering).
11-
12-
> NOTE: Once a session is running, a client application will connect to it using one of the "runtime SDKs".
13-
> These SDKs are designed to best support the needs of an interactive application doing 3d rendering.
14-
> They are available in ([.net](https://docs.microsoft.com/dotnet/api/microsoft.azure.remoterendering)
15-
> or ([C++](https://docs.microsoft.com/cpp/api/remote-rendering/)).
16-
17-
[Product documentation](https://docs.microsoft.com/azure/remote-rendering/)
18-
19-
## _Disclaimer_
20-
21-
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
22-
23-
# Getting started
24-
25-
## Prerequisites
26-
27-
You will need an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an [Azure Remote Rendering account](https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account) to use this package.
28-
29-
In order to follow this tutorial it is highly recommended that you [link your storage account with your ARR account](https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts).
30-
31-
## Install the package
32-
33-
Install the Azure Remote Rendering client library for Python with [pip][pip]:
34-
35-
```bash
36-
pip install --pre azure-mixedreality-remoterendering
37-
```
38-
39-
## Create and authenticate the client
40-
41-
Constructing a remote rendering client requires an authenticated account, and a remote rendering endpoint.
42-
For an account created in the eastus region, the account domain will have the form "eastus.mixedreality.azure.com".
43-
There are several different forms of authentication:
44-
45-
- Account Key authentication
46-
- Account keys enable you to get started quickly with using Azure Remote Rendering. But before you deploy your application to production, we recommend that you update your app to use Azure AD authentication.
47-
- Azure Active Directory (AD) token authentication
48-
- If you're building an enterprise application and your company is using Azure AD as its identity system, you can use user-based Azure AD authentication in your app. You then grant access to your Azure Remote Rendering accounts by using your existing Azure AD security groups. You can also grant access directly to users in your organization.
49-
- Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this method for production applications because it allows you to avoid embedding the credentials for access in your client application.
50-
51-
See [here](https://docs.microsoft.com/azure/remote-rendering/how-tos/authentication) for detailed instructions and information.
52-
53-
In all the following examples, the client is constructed with a `endpoint` parameter.
54-
The available endpoints correspond to regions, and the choice of endpoint determines the region in which the service performs its work.
55-
An example is `https://remoterendering.eastus2.mixedreality.azure.com`.
56-
57-
A full list of endpoints in supported regions can be found in the [Azure Remote Rendering region list](https://docs.microsoft.com/azure/remote-rendering/reference/regions).
58-
59-
> NOTE: For converting assets, it is preferable to pick a region close to the storage containing the assets.
60-
61-
> NOTE: For rendering, it is strongly recommended that you pick the closest region to the devices using the service.
62-
> The time taken to communicate with the server impacts the quality of the experience.
63-
64-
### Authenticating with account key authentication
65-
66-
Use the `AzureKeyCredential` object to use an account identifier and account key to authenticate:
67-
68-
```python
69-
from azure.core.credentials import AzureKeyCredential
70-
from azure.mixedreality.remoterendering import RemoteRenderingClient
71-
72-
account_id = "<ACCOUNT_ID>"
73-
account_domain = "<ACCOUNT_DOMAIN>"
74-
account_key = "<ACCOUNT_KEY>"
75-
arr_endpoint = "<ARR_ENDPOINT>"
76-
77-
key_credential = AzureKeyCredential(account_key)
78-
client = RemoteRenderingClient(
79-
endpoint=arr_endpoint,
80-
account_id=account_id,
81-
account_domain=account_domain,
82-
credential=key_credential
83-
)
84-
```
85-
86-
### Authenticating with a static access token
87-
88-
You can pass a Mixed Reality access token as an `AccessToken` previously retrieved from the
89-
[Mixed Reality STS service](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/mixedreality/azure-mixedreality-authentication)
90-
to be used with a Mixed Reality client library:
91-
92-
```python
93-
from azure.mixedreality.authentication import MixedRealityStsClient
94-
from azure.mixedreality.remoterendering import RemoteRenderingClient
95-
account_id = "<ACCOUNT_ID>"
96-
account_domain = "<ACCOUNT_DOMAIN>"
97-
account_key = "<ACCOUNT_KEY>"
98-
99-
key_credential = AzureKeyCredential(account_key)
100-
101-
client = MixedRealityStsClient(account_id, account_domain, key_credential)
102-
103-
token = client.get_token()
104-
105-
client = RemoteRenderingClient(
106-
endpoint=arr_endpoint,
107-
account_id=account_id,
108-
account_domain=account_domain,
109-
credential=token,
110-
)
111-
```
112-
113-
### Authenticating with an Azure Active Directory Credential
114-
115-
Account key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory
116-
using the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use
117-
the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with
118-
the Azure SDK, please install the `@azure/identity` package:
119-
120-
You will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource
121-
by assigning the appropriate role for your Mixed Reality service to your service principal.
122-
123-
```python
124-
from azure.identity import DefaultAzureCredential
125-
from azure.mixedreality.remoterendering import RemoteRenderingClient
126-
127-
account_id = "<ACCOUNT_ID>"
128-
account_domain = "<ACCOUNT_DOMAIN>"
129-
default_credential = DefaultAzureCredential()
130-
131-
client = RemoteRenderingClient(
132-
endpoint=arr_endpoint,
133-
account_id=account_id,
134-
account_domain=account_domain,
135-
credential=default_credential
136-
)
137-
```
138-
139-
## Key concepts
140-
141-
### RemoteRenderingClient
142-
143-
The `RemoteRenderingClient` is the client library used to access the RemoteRenderingService.
144-
It provides methods to create and manage asset conversions and rendering sessions.
145-
146-
### Long-Running Operations
147-
Long-running operations are operations which consist of an initial request sent to the service to start an operation,
148-
followed by polling the service at intervals to determine whether the operation has completed or failed, and if it has
149-
succeeded, to get the result.
150-
151-
Methods that convert assets, or spin up rendering sessions are modelled as long-running operations.
152-
The client exposes a `begin_<method-name>` method that returns an LROPoller or AsyncLROPoller.
153-
Callers should wait for the operation to complete by calling result() on the poller object returned from the
154-
`begin_<method-name>` method. Sample code snippets are provided to illustrate using long-running operations
155-
[below](#examples "Examples").
156-
157-
## Examples
158-
159-
- [Convert an asset](#convert-an-asset)
160-
- [List conversions](#list-conversions)
161-
- [Create a session](#create-a-session)
162-
- [Extend the lease time of a session](#extend-the-lease-time-of-a-session)
163-
- [List sessions](#list-sessions)
164-
- [Stop a session](#stop-a-session)
165-
166-
### Convert an asset
167-
168-
We assume that a RemoteRenderingClient has been constructed as described in the [Authenticate the Client](#create-and-authenticate-the-client) section.
169-
The following snippet describes how to request that "box.fbx", found at at a path of "/input/box/box.fbx" of the blob container at the given storage container URI, gets converted.
170-
171-
Converting an asset can take anywhere from seconds to hours.
172-
This code uses an existing conversion poller and polls regularly until the conversion has finished or failed.
173-
The default polling period is 5 seconds.
174-
Note that a conversion poller can be retrieved using the client.get_asset_conversion_poller using the id of an existing conversion and a client.
175-
176-
Once the conversion process finishes the output is written to the specified output container under a path of "/output/<conversion_id>/box.arrAsset".
177-
The path can be retrieved from the output.asset_uri of a successful conversion.
178-
179-
```python
180-
conversion_id = str(uuid.uuid4()) # A randomly generated uuid is a good choice for a conversion_id.
181-
182-
input_settings = AssetConversionInputSettings(
183-
storage_container_uri="<STORAGE CONTAINER URI>",
184-
relative_input_asset_path="box.fbx",
185-
blob_prefix="input/box"
186-
)
187-
output_settings = AssetConversionOutputSettings(
188-
storage_container_uri="<STORAGE CONTAINER URI>",
189-
blob_prefix="output/"+conversion_id,
190-
output_asset_filename="convertedBox.arrAsset" #if no output_asset_filename <input asset filename>.arrAsset will be the name of the resulting converted asset
191-
)
192-
try:
193-
conversion_poller = client.begin_asset_conversion(
194-
conversion_id=conversion_id,
195-
input_settings=input_settings,
196-
output_settings=output_settings
197-
)
198-
199-
print("Conversion with id:", conversion_id, "created. Waiting for completion.")
200-
conversion = conversion_poller.result()
201-
print("conversion output:", conversion.output.asset_uri)
202-
203-
except Exception as e:
204-
print("Conversion failed", e)
205-
```
206-
207-
### List conversions
208-
209-
You can get information about your conversions using the `list_asset_conversions` method.
210-
This method may return conversions which have yet to start, conversions which are running and conversions which have finished.
211-
In this example, we list all conversions and print id and creation ad as well as the output asset URIs of successful conversions.
212-
213-
```python
214-
print("conversions:")
215-
for c in client.list_asset_conversions():
216-
print(
217-
"\t conversion: id:",
218-
c.id,
219-
"status:",
220-
c.status,
221-
"created on:",
222-
c.created_on.strftime("%m/%d/%Y, %H:%M:%S"),
223-
)
224-
if c.status == AssetConversionStatus.SUCCEEDED:
225-
print("\t\tconversion result URI:", c.output.asset_uri)
226-
```
227-
228-
### Create a session
229-
230-
We assume that a RemoteRenderingClient has been constructed as described in the [Authenticate the Client](#create-and-authenticate-the-client) section.
231-
The following snippet describes how to request that a new rendering session be started.
232-
233-
```python
234-
print("starting rendering session with id:", session_id)
235-
try:
236-
session_poller = client.begin_rendering_session(
237-
session_id=session_id, size=RenderingSessionSize.STANDARD, lease_time_minutes=20
238-
)
239-
print(
240-
"rendering session with id:",
241-
session_id,
242-
"created. Waiting for session to be ready.",
243-
)
244-
session = session_poller.result()
245-
print(
246-
"session with id:",
247-
session.id,
248-
"is ready. lease_time_minutes:",
249-
session.lease_time_minutes,
250-
)
251-
except Exception as e:
252-
print("Session startup failed", e)
253-
```
254-
255-
### Extend the lease time of a session
256-
257-
If a session is approaching its maximum lease time, but you want to keep it alive, you will need to make a call to
258-
increase its maximum lease time.
259-
This example shows how to query the current properties and then extend the lease if it will expire soon.
260-
261-
> NOTE: The runtime SDKs also offer this functionality, and in many typical scenarios, you would use them to
262-
> extend the session lease.
263-
264-
```python
265-
session = client.get_rendering_session(session_id)
266-
if session.lease_time_minutes - session.elapsed_time_minutes < 2:
267-
session = client.update_rendering_session(
268-
session_id=session_id, lease_time_minutes=session.lease_time_minutes + 10
269-
)
270-
```
271-
272-
### List sessions
273-
274-
You can get information about your sessions using the `list_rendering_sessions` method of the client.
275-
This method may return sessions which have yet to start and sessions which are ready.
276-
277-
```python
278-
print("sessions:")
279-
rendering_sessions = client.list_rendering_sessions()
280-
for session in rendering_sessions:
281-
print(
282-
"\t session: id:",
283-
session.id,
284-
"status:",
285-
session.status,
286-
"created on:",
287-
session.created_on.strftime("%m/%d/%Y, %H:%M:%S"),
288-
)
289-
```
290-
291-
### Stop a Session
292-
293-
The following code will stop a running session with given id. Since running sessions incur ongoing costs it is
294-
recommended to stop sessions which are not needed anymore.
295-
296-
```python
297-
client.stop_rendering_session(session_id)
298-
print("session with id:", session_id, "stopped")
299-
```
300-
301-
## Troubleshooting
302-
303-
For general troubleshooting advice concerning Azure Remote Rendering, see [the Troubleshoot page](https://docs.microsoft.com/azure/remote-rendering/resources/troubleshoot) for remote rendering at docs.microsoft.com.
304-
305-
The client methods and waiting for poller results will throw exceptions if the request failed.
306-
307-
If the asset in a conversion is invalid, the conversion poller will throw an exception with an error containing details.
308-
Once the conversion service is able to process the file, a &lt;assetName&gt;.result.json file will be written to the output container.
309-
If the input asset is invalid, then that file will contain a more detailed description of the problem.
310-
311-
Similarly, sometimes when a session is requested, the session ends up in an error state.
312-
The poller will throw an exception containing details of the error in this case. Session errors are usually transient
313-
and requesting a new session should succeed.
314-
315-
### Logging
316-
317-
This library uses the standard
318-
[logging][python_logging] library for logging.
319-
320-
Basic information about HTTP sessions (URLs, headers, etc.) is logged at `INFO` level.
321-
322-
Detailed `DEBUG` level logging, including request/response bodies and **unredacted**
323-
headers, can be enabled on the client or per-operation with the `logging_enable` keyword argument.
324-
325-
See full SDK logging documentation with examples [here][sdk_logging_docs].
326-
327-
### Optional Configuration
328-
329-
Optional keyword arguments can be passed in at the client and per-operation level.
330-
The azure-core [reference documentation][azure_core_ref_docs]
331-
describes available configurations for retries, logging, transport protocols, and more.
332-
333-
### Exceptions
334-
335-
The Remote Rendering client library will raise exceptions defined in [Azure Core][azure_core_exceptions].
336-
337-
### Async APIs
338-
339-
This library also includes a complete async API supported on Python 3.7+. To use it, you must
340-
first install an async transport, such as [aiohttp](https://pypi.org/project/aiohttp/). Async clients
341-
are found under the `azure.mixedreality.remoterendering.aio` namespace.
342-
343-
344-
345-
## Next steps
346-
347-
- Read the [Product documentation](https://docs.microsoft.com/azure/remote-rendering/)
348-
- Learn about the runtime SDKs:
349-
- .NET: https://docs.microsoft.com/dotnet/api/microsoft.azure.remoterendering
350-
- C++: https://docs.microsoft.com/cpp/api/remote-rendering/
351-
352-
## Contributing
353-
354-
This project welcomes contributions and suggestions. Most contributions require you to agree to a
355-
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
356-
the rights to use your contribution. For details, visit https://cla.microsoft.com.
357-
358-
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
359-
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
360-
provided by the bot. You will only need to do this once across all repos using our CLA.
361-
362-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
363-
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
364-
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
365-
366-
If you'd like to contribute to this library, please read the
367-
[contributing guide](https://github.com/Azure/azure-sdk-for-python/blob/master/CONTRIBUTING.md) to learn more about how
368-
to build and test the code.
369-
370-
<!-- LINKS -->
371-
372-
373-
[azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs
374-
[azure_core_exceptions]: https://aka.ms/azsdk/python/core/docs#module-azure.core.exceptions
375-
[azure_sub]: https://azure.microsoft.com/free/
376-
[azure_portal]: https://portal.azure.com
377-
[azure_identity]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/identity/azure-identity
378-
379-
[pip]: https://pypi.org/project/pip/
380-
[sdk_logging_docs]: https://docs.microsoft.com/azure/developer/python/azure-sdk-logging
1+
This package has been deprecated and will no longer be maintained after 10-01-2025. This package will only receive security fixes until 10-01-2025.

0 commit comments

Comments
 (0)