Skip to content
Open
3 changes: 3 additions & 0 deletions .changes/unreleased/optimization-20251223-155633.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: optimization
body: Improve the error message to clearly indicate when the MPE creator does not have sufficient Azure permissions on the resource.
time: 2025-12-23T15:56:33.427481409Z
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from fabric_cli.core import fab_constant
from fabric_cli.core.fab_exceptions import FabricCLIError
from fabric_cli.core.hiearchy.fab_hiearchy import VirtualItem
from fabric_cli.errors import ErrorMessages
from fabric_cli.utils import fab_cmd_mkdir_utils as mkdir_utils
from fabric_cli.utils import fab_mem_store as utils_mem_store
from fabric_cli.utils import fab_ui as utils_ui
Expand Down Expand Up @@ -86,16 +87,22 @@ def exec(managed_private_endpoint: VirtualItem, args: Namespace) -> None:
# Wait exponentially
time.sleep(2**iteration)
iteration += 1
except Exception:
state = "Failed"
except FabricCLIError as exc:
if (
exc.status_code == fab_constant.ERROR_FORBIDDEN
or exc.message == ErrorMessages.Common.forbidden()
):
state = "Pending"
else:
state = "Failed"
break

if state != "Succeeded":
if state not in ["Succeeded", "Pending"]:
raise FabricCLIError(
f"Managed Private Endpoint was created on Fabric but encountered an issue on Azure provisioning. State: {state}",
fab_constant.ERROR_OPERATION_FAILED,
)
result_message = f"'{managed_private_endpoint.name}' created"
result_message = f"'{managed_private_endpoint.name}' created. {'Private endpoint provisioning in Azure is pending approval' if state == 'Pending' else ''}"

if params.get("autoapproveenabled", "false").lower() == "true":

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interactions:
Content-Type:
- application/json
User-Agent:
- ms-fabric-cli/1.2.0 (None; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
- ms-fabric-cli/1.3.1 (None; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
method: GET
uri: https://api.fabric.microsoft.com/v1/workspaces
response:
Expand All @@ -26,15 +26,15 @@ interactions:
Content-Encoding:
- gzip
Content-Length:
- '1054'
- '1662'
Content-Type:
- application/json; charset=utf-8
Date:
- Wed, 10 Dec 2025 14:36:12 GMT
- Wed, 24 Dec 2025 11:16:19 GMT
Pragma:
- no-cache
RequestId:
- 46a76ab9-a143-451d-90d0-f9fd657b1dbe
- e9e82624-60b4-40ae-8d9d-f0a28bd1b1b3
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand All @@ -60,7 +60,7 @@ interactions:
Content-Type:
- application/json
User-Agent:
- ms-fabric-cli/1.2.0 (None; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
- ms-fabric-cli/1.3.1 (None; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
method: GET
uri: https://api.fabric.microsoft.com/v1/workspaces
response:
Expand All @@ -75,15 +75,15 @@ interactions:
Content-Encoding:
- gzip
Content-Length:
- '1054'
- '1662'
Content-Type:
- application/json; charset=utf-8
Date:
- Wed, 10 Dec 2025 14:36:12 GMT
- Wed, 24 Dec 2025 11:16:20 GMT
Pragma:
- no-cache
RequestId:
- b659f6f2-2390-446e-ab99-3b090cc635ea
- 7d6ce758-a563-429c-9a19-79023b416099
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand All @@ -109,7 +109,7 @@ interactions:
Content-Type:
- application/json
User-Agent:
- ms-fabric-cli/1.2.0 (None; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
- ms-fabric-cli/1.3.1 (None; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
method: GET
uri: https://api.fabric.microsoft.com/v1/capacities
response:
Expand All @@ -125,15 +125,15 @@ interactions:
Content-Encoding:
- gzip
Content-Length:
- '873'
- '874'
Content-Type:
- application/json; charset=utf-8
Date:
- Wed, 10 Dec 2025 14:36:16 GMT
- Wed, 24 Dec 2025 11:16:23 GMT
Pragma:
- no-cache
RequestId:
- b23c547e-bc6b-4a83-9f1c-248239404869
- 23ef28a2-85d7-45a7-a94a-0e19f62a4fde
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand Down Expand Up @@ -162,12 +162,12 @@ interactions:
Content-Type:
- application/json
User-Agent:
- ms-fabric-cli/1.2.0 (None; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
- ms-fabric-cli/1.3.1 (None; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
method: POST
uri: https://api.fabric.microsoft.com/v1/workspaces
response:
body:
string: '{"id": "b14aea11-ff9f-40fd-a872-21636c090395", "displayName": "fabriccli_WorkspacePerTestclass_000001",
string: '{"id": "030399b4-bbf7-4216-b61d-6698ae4292b6", "displayName": "fabriccli_WorkspacePerTestclass_000001",
"description": "Created by fab", "type": "Workspace", "capacityId": "00000000-0000-0000-0000-000000000004"}'
headers:
Access-Control-Expose-Headers:
Expand All @@ -177,17 +177,17 @@ interactions:
Content-Encoding:
- gzip
Content-Length:
- '187'
- '188'
Content-Type:
- application/json; charset=utf-8
Date:
- Wed, 10 Dec 2025 14:36:23 GMT
- Wed, 24 Dec 2025 11:16:32 GMT
Location:
- https://api.fabric.microsoft.com/v1/workspaces/b14aea11-ff9f-40fd-a872-21636c090395
- https://api.fabric.microsoft.com/v1/workspaces/030399b4-bbf7-4216-b61d-6698ae4292b6
Pragma:
- no-cache
RequestId:
- 97eb7f80-4e28-4201-ae75-5570c99ad930
- 5610440d-2709-49e0-add4-a27a5418d396
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand All @@ -213,13 +213,13 @@ interactions:
Content-Type:
- application/json
User-Agent:
- ms-fabric-cli/1.2.0 (mkdir; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
- ms-fabric-cli/1.3.1 (mkdir; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
method: GET
uri: https://api.fabric.microsoft.com/v1/workspaces
response:
body:
string: '{"value": [{"id": "3634a139-2c9e-4205-910b-3b089a31be47", "displayName":
"My workspace", "description": "", "type": "Personal"}, {"id": "b14aea11-ff9f-40fd-a872-21636c090395",
"My workspace", "description": "", "type": "Personal"}, {"id": "030399b4-bbf7-4216-b61d-6698ae4292b6",
"displayName": "fabriccli_WorkspacePerTestclass_000001", "description": "Created
by fab", "type": "Workspace", "capacityId": "00000000-0000-0000-0000-000000000004"}]}'
headers:
Expand All @@ -230,15 +230,15 @@ interactions:
Content-Encoding:
- gzip
Content-Length:
- '1091'
- '1693'
Content-Type:
- application/json; charset=utf-8
Date:
- Wed, 10 Dec 2025 14:36:57 GMT
- Wed, 24 Dec 2025 11:20:26 GMT
Pragma:
- no-cache
RequestId:
- 9d54b68b-5a87-439a-90ba-d343916423c8
- 8dc7f29e-0e56-4649-a292-e761d9e72634
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand All @@ -264,9 +264,9 @@ interactions:
Content-Type:
- application/json
User-Agent:
- ms-fabric-cli/1.2.0 (mkdir; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
- ms-fabric-cli/1.3.1 (mkdir; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
method: GET
uri: https://api.fabric.microsoft.com/v1/workspaces/b14aea11-ff9f-40fd-a872-21636c090395/items
uri: https://api.fabric.microsoft.com/v1/workspaces/030399b4-bbf7-4216-b61d-6698ae4292b6/items
response:
body:
string: '{"value": []}'
Expand All @@ -282,11 +282,11 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Wed, 10 Dec 2025 14:36:58 GMT
- Wed, 24 Dec 2025 11:20:31 GMT
Pragma:
- no-cache
RequestId:
- 353f6d45-0cff-4127-a474-a9b1317790c4
- cd256475-316e-4801-814c-e88852073bb3
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand Down Expand Up @@ -314,9 +314,9 @@ interactions:
Content-Type:
- application/json
User-Agent:
- ms-fabric-cli/1.2.0 (mkdir; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
- ms-fabric-cli/1.3.1 (mkdir; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
method: DELETE
uri: https://api.fabric.microsoft.com/v1/workspaces/b14aea11-ff9f-40fd-a872-21636c090395
uri: https://api.fabric.microsoft.com/v1/workspaces/030399b4-bbf7-4216-b61d-6698ae4292b6
response:
body:
string: ''
Expand All @@ -332,11 +332,11 @@ interactions:
Content-Type:
- application/octet-stream
Date:
- Wed, 10 Dec 2025 14:36:59 GMT
- Wed, 24 Dec 2025 11:20:36 GMT
Pragma:
- no-cache
RequestId:
- 522420d0-d4cb-4d93-8a13-a5a9bdf30d41
- b97b5b4b-c4a7-43c8-a192-fece84c53bac
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand Down
Loading