Skip to content

Commit a5e527d

Browse files
committed
fix code
1 parent db25c3a commit a5e527d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

articles/machine-learning/service/quickstart-create-workspace-with-python.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,22 @@ Create a new Azure resource group and a new workspace.
9393

9494
Find a value for `<azure-subscription-id>` in the [subscriptions list in the Azure portal](https://ms.portal.azure.com/#blade/Microsoft_Azure_Billing/SubscriptionsBlade). Use any subscription in which your role is owner or contributor.
9595

96-
[!code-python[](~/aml-sdk-samples/ignore/doc-qa/quickstart-create-workspace-with-python/quickstart.py?name=getDetails)]
96+
```python
97+
from azureml.core import Workspace
98+
ws = Workspace.create(name='myworkspace',
99+
subscription_id='<azure-subscription-id>',
100+
resource_group='myresourcegroup',
101+
create_resource_group=True,
102+
location='eastus2' # or other supported Azure region
103+
)
104+
```
97105

98106
Executing the preceding code might trigger a new browser window for you to sign into your Azure account. After you sign in, the authentication token is cached locally.
99107

100108
To see the workspace details, such as associated storage, container registry, and key vault, enter the following code.
101109

102-
```python
103-
ws.get_details()
104-
```
110+
[!code-python[](~/aml-sdk-samples/ignore/doc-qa/quickstart-create-workspace-with-python/quickstart.py?name=getDetails)]
111+
105112

106113
## Write a configuration file
107114

0 commit comments

Comments
 (0)