File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,10 @@ const (
116
116
// StackAPIVersion is the API version profile to set for ARM clients. See:
117
117
// https://learn.microsoft.com/en-us/azure-stack/user/azure-stack-profiles-azure-resource-manager-versions?view=azs-2408#overview-of-the-2020-09-01-hybrid-profile
118
118
StackAPIVersionProfile = "2020-06-01"
119
+
120
+ // StackDiskAPIVersionProfile is the API Version to set for the disk client.
121
+ // API Version Profile "2020-06-01" is not supported for disks.
122
+ StackDiskAPIVersionProfile = "2018-06-01"
119
123
)
120
124
121
125
var (
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package disks
18
18
19
19
import (
20
20
"context"
21
+ "strings"
21
22
"time"
22
23
23
24
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
@@ -38,6 +39,9 @@ type azureClient struct {
38
39
// newClient creates a new disks client from an authorizer.
39
40
func newClient (auth azure.Authorizer , apiCallTimeout time.Duration ) (* azureClient , error ) {
40
41
opts , err := azure .ARMClientOptions (auth .CloudEnvironment (), auth .BaseURI ())
42
+ if strings .EqualFold (auth .CloudEnvironment (), azure .StackCloudName ) {
43
+ opts .APIVersion = azure .StackDiskAPIVersionProfile
44
+ }
41
45
if err != nil {
42
46
return nil , errors .Wrap (err , "failed to create disks client options" )
43
47
}
You can’t perform that action at this time.
0 commit comments