Azure / Azure/azure-powershell

[Az.Synapse 0.14.0] Get-AzSynapseWorkspace resource provider 2021-04-01-preview unsupported in some clouds

Open
#15,616 10 comments 0 reactions 0 assignees View on GitHub
act-codegen-extensibility-squad Service Attention Synapse
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

## Description
* dotnet SDK update: https://github.com/Azure/azure-sdk-for-net/pull/21769#event-4957007194
* Az.Synapse update: https://github.com/Azure/azure-powershell/commit/0b8a9d22bbf5a81aca2677cfc3c22dc9e8e5c6ff
We work in AzureUSGovernment and had a script that defaulted to the latest version of Az.Synapse and broke on a `Get-AzSynapseWorkspace` call. I think it's because of the update to the dotnet-sdk Synapse management package. I'm now passing `-RequiredVersion`, but thought it may be important to raise the issue.

## Debug Output
```
021-08-04T22:06:31.7665348Z
2021-08-04T22:06:31.7666132Z https://management.usgovcloudapi.net/subscriptions/****/providers/Microsoft.Synapse/wor
2021-08-04T22:06:31.7666949Z kspaces?api-version=2021-04-01-preview
2021-08-04T22:06:31.7667181Z
2021-08-04T22:06:31.7667536Z
2021-08-04T22:06:31.7667691Z
2021-08-04T22:06:31.7668086Z Headers:
2021-08-04T22:06:31.7668259Z
2021-08-04T22:06:31.7668777Z x-ms-client-request-id : f0909aed-68b9-434c-a13c-134b501b1ffb
2021-08-04T22:06:31.7669081Z
2021-08-04T22:06:31.7669529Z accept-language : en-US
2021-08-04T22:06:31.7669777Z
2021-08-04T22:06:31.7669923Z
2021-08-04T22:06:31.7670084Z
2021-08-04T22:06:31.7670580Z Body:
2021-08-04T22:06:31.7670740Z
2021-08-04T22:06:31.7670890Z
2021-08-04T22:06:31.7671041Z
2021-08-04T22:06:31.7671261Z
2021-08-04T22:06:31.7691055Z DEBUG: ============================ HTTP RESPONSE ============================
2021-08-04T22:06:31.7691410Z
2021-08-04T22:06:31.7691885Z
2021-08-04T22:06:31.7692209Z
2021-08-04T22:06:31.7692763Z Status Code:
2021-08-04T22:06:31.7693083Z
2021-08-04T22:06:31.7693576Z NotFound
2021-08-04T22:06:31.7693878Z
2021-08-04T22:06:31.7694152Z
2021-08-04T22:06:31.7694425Z
2021-08-04T22:06:31.7695033Z Headers:
2021-08-04T22:06:31.7695461Z
2021-08-04T22:06:31.7696043Z Pragma : no-cache
2021-08-04T22:06:31.7696400Z
2021-08-04T22:06:31.7696999Z x-ms-failure-cause : gateway
2021-08-04T22:06:31.7697370Z
2021-08-04T22:06:31.7698098Z x-ms-request-id : 09f3c706-fced-435b-a57c-5b4826c752c4
2021-08-04T22:06:31.7698641Z
2021-08-04T22:06:31.7699254Z x-ms-correlation-request-id : 09f3c706-fced-435b-a57c-5b4826c752c4
2021-08-04T22:06:31.7699658Z
2021-08-04T22:06:31.7700343Z x-ms-routing-request-id : USGOVTEXAS:20210804T220631Z:09f3c706-fced-435b-a57c-5b4826c752c4
2021-08-04T22:06:31.7700926Z
2021-08-04T22:06:31.7701561Z Strict-Transport-Security : max-age=31536000; includeSubDomains
2021-08-04T22:06:31.7701980Z
2021-08-04T22:06:31.7702570Z X-Content-Type-Options : nosniff
2021-08-04T22:06:31.7702935Z
2021-08-04T22:06:31.7703532Z Cache-Control : no-cache
2021-08-04T22:06:31.7703883Z
2021-08-04T22:06:31.7704527Z Date : Wed, 04 Aug 2021 22:06:30 GMT
2021-08-04T22:06:31.7704952Z
2021-08-04T22:06:31.7705230Z
2021-08-04T22:06:31.7705916Z
2021-08-04T22:06:31.7706630Z Body:
2021-08-04T22:06:31.7706996Z
2021-08-04T22:06:31.7707496Z {
2021-08-04T22:06:31.7707984Z
2021-08-04T22:06:31.7708780Z "error": {
2021-08-04T22:06:31.7709131Z
2021-08-04T22:06:31.7709707Z "code": "InvalidResourceType",
2021-08-04T22:06:31.7710041Z
2021-08-04T22:06:31.7710775Z "message": "The resource type 'workspaces' could not be found in the namespace 'Microsoft.Synapse' for api version
2021-08-04T22:06:31.7711708Z '2021-04-01-preview'. The supported api-versions are '2019-06-01-preview,2020-12-01,2021-03-01,2021-05-01'."
2021-08-04T22:06:31.7712188Z
2021-08-04T22:06:31.7712707Z }
2021-08-04T22:06:31.7712998Z
2021-08-04T22:06:31.7713495Z }
2021-08-04T22:06:31.7713772Z
```
### Error Output
```
##[debug]+ Get-AzSynapseWorkspace -name "***********"
##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[debug] + CategoryInfo : CloseError: (:) [Get-AzSynapseWorkspace], AzPSResourceNotFoundCloudException
##[debug] + FullyQualifiedErrorId : Microsoft.Azure.Commands.Synapse.GetAzureSynapseWorkspace
##[debug]
##[debug]Script stack trace:
##[debug]at , C:\agent\_work\_temp\97a5d7ff-b8c7-488b-b51e-59e84d3642d1.ps1: line 46
##[debug]at , : line 1
##[debug]Exception:
##[debug]Microsoft.Azure.Commands.Common.Exceptions.AzPSResourceNotFoundCloudException: Operation returned an invalid status code 'NotFound' The resource type 'workspaces' could not be found in the namespace 'Microsoft.Synapse' for api version '2021-04-01-preview'. The supported api-versions are '2019-06-01-preview,2020-12-01,2021-03-01,2021-05-01'. ---> Microsoft.Azure.Management.Synapse.Models.ErrorResponseException: Operation returned an invalid status code 'NotFound'
##[debug] at Microsoft.Azure.Management.Synapse.WorkspacesOperations.d__10.MoveNext()
##[debug]--- End of stack trace from previous location where exception was thrown ---
##[debug] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
##[debug] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
##[debug] at Microsoft.Azure.Management.Synapse.WorkspacesOperationsExtensions.d__11.MoveNext()
##[debug]--- End of stack trace from previous location where exception was thrown ---
##[debug] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
##[debug] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
##[debug] at Microsoft.Azure.Management.Synapse.WorkspacesOperationsExtensions.List(IWorkspacesOperations operations)
##[debug] at Microsoft.Azure.Commands.Synapse.Models.SynapseAnalyticsManagementClient.ListWorkspaces(String resourceGroupName)
##[debug] --- End of inner exception stack trace ---
##[debug] at Microsoft.Azure.Commands.Synapse.Models.SynapseAnalyticsManagementClient.ListWorkspaces(String resourceGroupName)
##[debug] at Microsoft.Azure.Commands.Synapse.Models.SynapseAnalyticsManagementClient.GetResourceGroupByWorkspaceName(String workspaceName)
##[debug] at Microsoft.Azure.Commands.Synapse.Models.SynapseAnalyticsManagementClient.GetWorkspace(String resourceGroupName, String workspaceName)
##[debug] at Microsoft.Azure.Commands.Synapse.GetAzureSynapseWorkspace.ExecuteCmdlet()
##[debug] at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
##[error]Operation returned an invalid status code 'NotFound' The resource type 'workspaces' could not be found in the namespace 'Microsoft.Synapse' for api version '2021-04-01-preview'. The supported api-versions are '2019-06-01-preview,2020-12-01,2021-03-01,2021-05-01'.
##[debug]Processed: ##vso[task.logissue type=error]Operation returned an invalid status code 'NotFound' The resource type 'workspaces' could not be found in the namespace 'Microsoft.Synapse' for api version '2021-04-01-preview'. The supported api-versions are '2019-06-01-preview,2020-12-01,2021-03-01,2021-05-01'.
##[debug]Exit code: 1

```

## Steps to reproduce

```powershell
(Get-AzSynapseWorkspace -WorkspaceName "workspaceName").ConnectivityEndpoints.SqlOnDemand
```

## Environment data
```
Name Value
---- -----
PSVersion 5.1.19041.1023
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1023
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.