Skip to content

Commit 31aa7cc

Browse files
Merge pull request #224444 from edebar01/patch-1
updating environment definition issues
2 parents 03ea19c + 12e5638 commit 31aa7cc

File tree

1 file changed

+141
-25
lines changed

1 file changed

+141
-25
lines changed

articles/machine-learning/how-to-troubleshoot-environments.md

Lines changed: 141 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -295,37 +295,153 @@ ml_client.environments.create_or_update(env_docker_image)
295295
* [Environment class v1](https://aka.ms/azureml/environment/environment-class-v1)
296296

297297
### Container registry credentials missing either username or password
298-
- To access the base image in the container registry specified, you must provide both a username and password. One is missing.
299-
- Providing credentials in this way is deprecated. For the current method of providing credentials, see the *secrets in base image registry* section.
298+
<!--issueDescription-->
299+
300+
**Potential causes:**
301+
302+
* You've specified either a username or a password for your container registry in your environment definition, but not both
303+
304+
**Affected areas (symptoms):**
305+
* Failure in registering your environment
306+
<!--/issueDescription-->
307+
308+
**Troubleshooting steps**
309+
310+
*Applies to: Python SDK azureml V1*
311+
312+
Add the missing username or password to your environment definition to fix the issue
313+
314+
```
315+
myEnv.docker.base_image_registry.username = "username"
316+
```
317+
318+
Alternatively, provide authentication via [workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
319+
320+
```
321+
from azureml.core import Workspace
322+
ws = Workspace.from_config()
323+
ws.set_connection("connection1", "ACR", "<URL>", "Basic", "{'Username': '<username>', 'Password': '<password>'}")
324+
```
325+
326+
*Applies to: Azure CLI extensions V1 & V2*
327+
328+
Create a workspace connection from a YAML specification file
329+
330+
```
331+
az ml connection create --file connection.yml --resource-group my-resource-group --workspace-name my-workspace
332+
```
333+
334+
> [!NOTE]
335+
> * Providing credentials in your environment definition is deprecated. Use workspace connections instead.
336+
337+
**Resources**
338+
* [Python SDK AzureML v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
339+
* [Python SDK AzureML v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
340+
* [Azure CLI workspace connections](/cli/azure/ml/connection)
300341

301342
### Multiple credentials for base image registry
302-
- When specifying credentials for a base image registry, you must specify only one set of credentials.
303-
- The following authentication types are currently supported:
304-
- Basic (username/password)
305-
- Registry identity (clientId/resourceId)
306-
- If you're using workspace connections to specify credentials, [delete one of the connections](https://aka.ms/azureml/environment/delete-connection-v1)
307-
- If you've specified credentials directly in your environment definition, choose either username/password or registry identity
308-
to use, and set the other credentials you won't use to `null`
309-
- Specifying credentials in this way is deprecated. It's recommended that you use workspace connections. See
310-
*secrets in base image registry* below
343+
<!--issueDescription-->
344+
345+
**Potential causes:**
346+
347+
* You've specified more than one set of credentials for your base image registry
348+
349+
**Affected areas (symptoms):**
350+
* Failure in registering your environment
351+
<!--/issueDescription-->
352+
353+
**Troubleshooting steps**
354+
355+
*Applies to: Python SDK azureml V1*
356+
357+
If you're using workspace connections, view the connections you have set, and delete whichever one(s) you don't want to use
358+
359+
```
360+
from azureml.core import Workspace
361+
ws = Workspace.from_config()
362+
ws.list_connections()
363+
ws.delete_connection("myConnection2")
364+
```
365+
366+
If you've specified credentials in your environment definition, choose one set of credentials to use, and set all others to null
367+
368+
```
369+
myEnv.docker.base_image_registry.registry_identity = None
370+
```
371+
372+
> [!NOTE]
373+
> * Providing credentials in your environment definition is deprecated. Use workspace connections instead.
374+
375+
**Resources**
376+
* [Delete a workspace connection v1](https://aka.ms/azureml/environment/delete-connection-v1)
377+
* [Python SDK AzureML v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
378+
* [Python SDK AzureML v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
379+
* [Azure CLI workspace connections](/cli/azure/ml/connection)
311380

312381
### Secrets in base image registry
313-
- If you specify a base image in your `DockerSection`, you must specify the registry address from which the image will be pulled,
314-
and credentials to authenticate to the registry, if needed.
315-
- Historically, credentials have been specified in the environment definition. However, this method isn't secure and should be
316-
avoided.
317-
- Users should set credentials using workspace connections. For instructions, see [set_connection](https://aka.ms/azureml/environment/set-connection-v1)
382+
<!--issueDescription-->
383+
384+
**Potential causes:**
385+
386+
* You've specified credentials in your environment definition
387+
388+
**Affected areas (symptoms):**
389+
* Failure in registering your environment
390+
<!--/issueDescription-->
391+
392+
**Troubleshooting steps**
393+
394+
Specifying credentials in your environment definition is deprecated. Delete credentials from your environment definition and use workspace connections instead.
395+
396+
*Applies to: Python SDK azureml V1*
397+
398+
Set a workspace connection on your workspace
399+
400+
```
401+
from azureml.core import Workspace
402+
ws = Workspace.from_config()
403+
ws.set_connection("connection1", "ACR", "<URL>", "Basic", "{'Username': '<username>', 'Password': '<password>'}")
404+
```
405+
406+
*Applies to: Azure CLI extensions V1 & V2*
407+
408+
Create a workspace connection from a YAML specification file
409+
410+
```
411+
az ml connection create --file connection.yml --resource-group my-resource-group --workspace-name my-workspace
412+
```
413+
414+
**Resources**
415+
* [Python SDK AzureML v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
416+
* [Python SDK AzureML v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
417+
* [Azure CLI workspace connections](/cli/azure/ml/connection)
318418

319419
### Deprecated Docker attribute
320-
- The following `DockerSection` attributes are deprecated:
321-
- `enabled`
322-
- `arguments`
323-
- `shared_volumes`
324-
- `gpu_support`
325-
- Azure Machine Learning now automatically detects and uses NVIDIA Docker extension when available.
326-
- `smh_size`
327-
- Use [DockerConfiguration](https://aka.ms/azureml/environment/docker-configuration-class) instead
328-
- See [DockerSection deprecated variables](https://aka.ms/azureml/environment/docker-section-class)
420+
<!--issueDescription-->
421+
422+
**Potential causes:**
423+
424+
* You've specified Docker attributes in your environment definition that are now deprecated
425+
* The following are deprecated:
426+
* `enabled`
427+
* `arguments`
428+
* `shared_volumes`
429+
* `gpu_support`
430+
* AzureML now automatically detects and uses NVIDIA Docker extension when available
431+
* `smh_size`
432+
433+
**Affected areas (symptoms):**
434+
* Failure in registering your environment
435+
<!--/issueDescription-->
436+
437+
**Troubleshooting steps**
438+
439+
*Applies to: Python SDK azureml V1*
440+
441+
Instead of specifying these attributes in the `DockerSection` of your environment definition, use [DockerConfiguration](https://aka.ms/azureml/environment/docker-configuration-class)
442+
443+
**Resources**
444+
* See `DockerSection` [deprecated variables](https://aka.ms/azureml/environment/docker-section-class)
329445

330446
### Dockerfile length over limit
331447
- The specified Dockerfile can't exceed the maximum Dockerfile size of 100 KB

0 commit comments

Comments
 (0)